/* === ULTRA MODERN BEAUTIFUL DESIGN === */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Playfair+Display:wght@700;800&display=swap');

.similar-container-beautiful {
    position: relative;
    margin-top: 80px;
    padding: 60px 20px 80px;
    background: linear-gradient(180deg, #fafafa 0%, #ffffff 50%, #f8fafc 100%);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    
    /* Mobile Performance */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Gradient Effect */
.background-gradient {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    height: 300px;
    background: radial-gradient(ellipse at top, rgba(139, 92, 246, 0.08), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Header Styling */
.similar-header-beautiful {
    position: relative;
    text-align: center;
    margin-bottom: 50px;
    z-index: 1;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.badge-icon {
    font-size: 14px;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.main-title {
    margin: 0 0 15px 0;
    font-size: 48px;
    font-weight: 900;
    line-height: 1.2;
}

.title-gradient {
    display: block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Playfair Display', serif;
}

.title-highlight {
    display: block;
    color: #1e293b;
    font-family: 'Playfair Display', serif;
}

@media (max-width: 768px) {
    .title-gradient {
        display: inline;
    }
    
    .title-highlight {
        display: inline;
    }
}

.subtitle {
    margin: 0;
    color: #64748b;
    font-size: 16px;
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto;
}

.header-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.deco-dot {
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
}

.deco-line {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, #764ba2, transparent);
}

/* Grid Layout */
.similar-grid-beautiful {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Book Card */
.book-card-beautiful {
    animation: cardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
    position: relative;
}

@keyframes cardFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.95); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.book-link-beautiful {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
    
    /* Better touch interaction */
    -webkit-tap-highlight-color: rgba(102, 126, 234, 0.1);
    touch-action: manipulation;
}

/* Cover Wrapper */
.book-cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    margin-bottom: 15px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-card-beautiful:hover .book-cover-wrapper {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.25);
}

/* Glow Effect */
.cover-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.book-card-beautiful:hover .cover-glow {
    opacity: 1;
}

/* Cover Frame */
.cover-frame {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-card-beautiful:hover .cover-image {
    transform: scale(1.1);
}

/* Hover Overlay */
.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.book-card-beautiful:hover .hover-overlay {
    opacity: 1;
}

.read-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: #667eea;
    font-size: 13px;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.book-card-beautiful:hover .read-button {
    transform: translateY(0);
}

.read-button:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* Quality Badge */
.quality-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 9px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 1px;
}

/* Book Info */
.book-info {
    padding: 0 5px;
}

.book-title {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
    
    transition: color 0.3s ease;
}

.book-card-beautiful:hover .book-title {
    color: #667eea;
}

.book-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}

.meta-icon {
    font-size: 14px;
}

/* No Results */
.no-results-beautiful {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-results-beautiful p {
    color: #94a3b8;
    font-size: 16px;
    font-weight: 500;
}

/* Bottom Fade */
.bottom-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to top, #f8fafc, transparent);
    pointer-events: none;
}

/* === MOBILE RESPONSIVE DESIGN === */

/* Tablet */
@media (max-width: 1024px) {
    .similar-grid-beautiful {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 25px;
    }
}

/* Mobile Large */
@media (max-width: 768px) {
    .similar-container-beautiful {
        padding: 35px 15px 50px;
        margin-top: 40px;
    }
    
    .background-gradient {
        height: 200px;
    }
    
    .similar-header-beautiful {
        margin-bottom: 35px;
    }
    
    .header-badge {
        font-size: 11px;
        padding: 7px 15px;
    }
    
    .main-title {
        font-size: 32px;
    }
    
    .title-gradient,
    .title-highlight {
        display: inline;
    }
    
    .subtitle {
        font-size: 14px;
        padding: 0 10px;
    }
    
    .header-decoration {
        margin-top: 20px;
    }
    
    .deco-line {
        width: 60px;
    }
    
    .similar-grid-beautiful {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    
    /* Mobile: Always show overlay slightly for better UX */
    .hover-overlay {
        background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.6) 100%);
        opacity: 0.6;
    }
    
    .read-button {
        font-size: 11px;
        padding: 9px 16px;
        transform: translateY(0);
    }
    
    /* Better touch targets */
    .book-link-beautiful {
        -webkit-tap-highlight-color: transparent;
    }
    
    .book-cover-wrapper {
        margin-bottom: 12px;
    }
    
    .quality-badge {
        top: 8px;
        right: 8px;
        font-size: 8px;
        padding: 3px 6px;
    }
}

/* Mobile Small */
@media (max-width: 480px) {
    .similar-container-beautiful {
        padding: 30px 12px 40px;
        margin-top: 30px;
    }
    
    .header-badge {
        font-size: 10px;
        padding: 6px 12px;
    }
    
    .main-title {
        font-size: 26px;
        line-height: 1.3;
    }
    
    .subtitle {
        font-size: 13px;
        line-height: 1.5;
    }
    
    .similar-grid-beautiful {
        gap: 15px;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .book-cover-wrapper {
        border-radius: 12px;
        margin-bottom: 10px;
    }
    
    .read-button {
        font-size: 10px;
        padding: 8px 14px;
        gap: 6px;
    }
    
    .read-button svg {
        width: 12px;
        height: 12px;
    }
    
    .book-title {
        font-size: 13px;
        min-height: 36px;
    }
    
    .book-meta {
        font-size: 11px;
    }
    
    .meta-icon {
        font-size: 12px;
    }
}

/* Mobile Extra Small */
@media (max-width: 360px) {
    .similar-container-beautiful {
        padding: 25px 10px 35px;
    }
    
    .main-title {
        font-size: 24px;
    }
    
    .similar-grid-beautiful {
        gap: 12px;
    }
    
    .book-title {
        font-size: 12px;
        min-height: 34px;
    }
    
    .read-button {
        font-size: 9px;
        padding: 7px 12px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .book-card-beautiful:hover .book-cover-wrapper {
        transform: none;
    }
    
    /* Show overlay by default on touch */
    .hover-overlay {
        opacity: 0.7;
    }
    
    .read-button {
        transform: translateY(0);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
    }
    
    /* Active state for touch */
    .book-link-beautiful:active .book-cover-wrapper {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Remove glow effect on touch devices */
    .cover-glow {
        display: none;
    }
    
    /* Simplify animations on mobile for performance */
    .book-card-beautiful {
        animation-duration: 0.5s;
    }
}

/* Smooth Scrolling Enhancement */
@media (prefers-reduced-motion: no-preference) {
    .book-card-beautiful {
        scroll-margin-top: 100px;
    }
}