/* Modern Hero Section */
.books-hero-modern {
    position: relative;
    padding: 140px 0 80px;
    overflow: hidden;
    background: linear-gradient(135deg, #10b981 0%, #059669 35%, #3b82f6 100%);
    min-height: 85vh;
    display: flex;
    align-items: center;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 0;
}

/* Animated Gradient Orbs */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #10b981, #059669);
    top: -200px;
    left: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    bottom: -250px;
    right: -150px;
    animation-delay: 7s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #14b8a6, #06b6d4);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 3.5s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Floating Book Icons */
.floating-books {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.floating-icon {
    position: absolute;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.15);
    animation: floatIcon 15s ease-in-out infinite;
}

.floating-icon:nth-child(1) {
    animation-delay: 0s;
}

.floating-icon:nth-child(2) {
    animation-delay: 2s;
}

.floating-icon:nth-child(3) {
    animation-delay: 4s;
}

.floating-icon:nth-child(4) {
    animation-delay: 6s;
}

.floating-icon:nth-child(5) {
    animation-delay: 8s;
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-25px) rotate(10deg);
    }
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 24px;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 30px;
    animation: fadeInDown 0.8s ease-out;
}

.hero-badge i {
    color: #fde047;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 25px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.gradient-text-animated {
    background: linear-gradient(90deg, #10b981, #3b82f6, #10b981);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
    display: inline-block;
}

@keyframes shimmer {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

.hero-description {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.8;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Hero Search */
.hero-search {
    margin-bottom: 50px;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto 25px;
}

.search-box i {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1.1rem;
}

.search-box input {
    width: 100%;
    padding: 18px 24px 18px 60px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

.search-box input::placeholder {
    color: #9ca3af;
}

/* Category Filters */
.category-filters {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: white;
    color: #10b981;
    border-color: white;
}

/* Hero Stats */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 700px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.stat-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-5px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-content {
    text-align: left;
}

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin: 0;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 5px 0 0;
    font-weight: 600;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .books-hero-modern {
        padding: 120px 0 60px;
        min-height: auto;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1.1rem;
    }

    .hero-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-item {
        padding: 20px;
    }

    .gradient-orb {
        filter: blur(40px);
    }

    .orb-1,
    .orb-2,
    .orb-3 {
        width: 300px;
        height: 300px;
    }

    .floating-icon {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .category-filters {
        flex-direction: column;
        gap: 10px;
    }

    .filter-btn {
        width: 100%;
        justify-content: center;
    }

    .hero-badge {
        font-size: 0.8rem;
        padding: 8px 16px;
    }
}


.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding: 60px 0;
}

@media (max-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
        padding: 40px 15px;
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 books per row on small phones */
        gap: 12px;
        padding: 30px 10px;
    }
}

.book-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #f1f5f9;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.book-cover {
    height: 350px;
    overflow: hidden;
    position: relative;
}

@media (max-width: 480px) {
    .book-cover {
        height: 200px;
        /* Shorter covers on mobile to fit 2 per row better */
    }
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}

.book-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 5px 15px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.book-badge.paid {
    background: #ef4444;
    /* Red for paid */
    color: white;
}

.book-badge.free {
    background: #10b981;
    /* Green for free */
    color: white;
}

.book-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

@media (max-width: 480px) {
    .book-info {
        padding: 12px;
    }
}

.book-category {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: block;
}

.book-title {
    font-size: 1.4rem;
    margin-bottom: 15px;
    line-height: 1.3;
    color: var(--dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Added for compatibility */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 480px) {
    .book-title {
        font-size: 1rem;
        margin-bottom: 10px;
    }
}

.book-description {
    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.book-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.book-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dark);
}

.btn-book {
    background: var(--dark);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-book:hover {
    background: var(--primary);
}

.btn-book.secondary {
    background: var(--gray);
}

.book-actions {
    display: flex;
    gap: 10px;
}

/* Book Details Page Styles */
.book-details-container {
    padding: 180px 0 100px;
    background: #f8fafc;
    min-height: 100vh;
}

.book-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.book-visual {
    position: sticky;
    top: 140px;
}

.book-visual img {
    width: 100%;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.book-content h1 {
    font-size: 3rem;
    color: var(--dark);
    margin-bottom: 20px;
    line-height: 1.2;
}

.book-meta-top {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.meta-badge {
    padding: 6px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-badge i {
    color: var(--primary);
}

.book-pricing {
    background: white;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    margin-bottom: 40px;
}

.price-label {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 5px;
}

.price-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 20px;
    display: block;
}

.buy-button {
    display: block;
    width: 100%;
    text-align: center;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

.buy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(16, 185, 129, 0.4);
}

.book-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.spec-item {
    padding: 15px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.spec-label {
    font-size: 0.8rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
    display: block;
}

.spec-value {
    font-weight: 700;
    color: var(--dark);
}

@media (max-width: 992px) {
    .book-details-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .book-visual {
        position: static;
        max-width: 400px;
        margin: 0 auto;
    }

    .book-content h1 {
        font-size: 2.2rem;
    }
}