/* ---
// ===============================================
//   GLOBAL STYLES
// ===============================================
// --- */

/* CSS Variables */
:root {
    --primary-color: #E50914; /* Netflix Red */
    --bg-color: #141414; /* Netflix Black */
    --bg-color-rgb: 20, 20, 20; /* For new gradient */
    --card-bg: #1C1C1C;
    --border-color: #303030;
    --text-color: #FFFFFF;
    --text-color-secondary: #B3B3B3;
    --font-main: 'Inter', sans-serif;
}

/* Base Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow-x: hidden; /* Prevent horizontal scroll */
}

a {
    color: var(--text-color);
    text-decoration: none;
}

ul {
    list-style: none;
}

/* ---
// ===============================================
//   HEADER / NAVIGATION
// ===============================================
// --- */

.main-header {
    width: 100%;
    height: 70px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 10%, rgba(0,0,0,0));
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 4%;
}

.main-nav {
    width: 100%;
    display: flex;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 25px;
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    gap: 20px;
    /* ADD THIS LINE to center the nav links */
    margin: 0 auto;
}

.nav-link {
    color: var(--text-color-secondary);
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-color);
}

.nav-link.active {
    color: var(--text-color);
    font-weight: 700;
}

.nav-profile {
    margin-left: auto;
    cursor: pointer;
}

.nav-profile i {
    width: 28px;
    height: 28px;
}

/* ---
// ===============================================
//   ANIMATED AIBOOK NAV LINK
// ===============================================
// --- */
.nav-link-anim {
    position: relative;
    display: flex;
    overflow: hidden;
    width: 32px; /* Initial width for "AI" */
    transition: width 0.4s cubic-bezier(0.6, 0, 0.4, 1);
}

.nav-link-anim.active {
    width: 100px; /* Full width when active */
}

.nav-link-anim .book-part {
    position: absolute;
    left: 14px; /* Position it after "A" */
    transform: translateX(-150%); /* Start hidden to the left */
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.6, 0, 0.4, 1), opacity 0.3s ease;
    white-space: nowrap;
}

.nav-link-anim .i-part {
    margin-left: 2px;
    transition: transform 0.4s cubic-bezier(0.6, 0, 0.4, 1);
}

/* Hover/Active State */
.nav-link-anim.hovered,
.nav-link-anim.active {
    width: 100px; /* Expand */
    color: var(--primary-color);
}

.nav-link-anim.hovered .book-part,
.nav-link-anim.active .book-part {
    transform: translateX(0); /* Slide in */
    opacity: 1;
}

.nav-link-anim.hovered .i-part,
.nav-link-anim.active .i-part {
    transform: translateX(62px); /* Push "I" to the end */
}


/* ---
// ===============================================
//   HERO / FEATURED SECTION
// ===============================================
// --- */

.hero-section {
    min-height: 90vh;
    background-size: cover;
    background-position: center 20%;
    display: flex;
    align-items: center;
    padding: 0 4%;
    position: relative;
}

/* Faded overlay at the bottom */
.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 10rem;
    background: linear-gradient(to top, var(--bg-color) 20%, transparent);
}

.hero-content {
    max-width: 50%;
    z-index: 10;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 2rem;
    max-width: 600px;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.7);

    /* --- "Show More" Truncation --- */
    /* This uses line-clamp to hide text after 3 lines */
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3; 
    transition: -webkit-line-clamp 0.3s ease; /* Animate the clamp */
}

/* "Show More" Expanded State */
.hero-description.expanded {
    -webkit-line-clamp: 50; /* Show up to 50 lines */
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-icon {
    margin-right: 0.5rem;
    width: 20px;
    height: 20px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}
.btn-primary:hover {
    background-color: #b00710; /* Darker red */
}

.btn-secondary {
    background-color: rgba(109, 109, 110, 0.7);
    color: white;
}
.btn-secondary:hover {
    background-color: rgba(109, 109, 110, 0.4);
}

.btn-show-more {
    background: none;
    border: none;
    color: var(--text-color-secondary);
    font-family: var(--font-main);
    font-size: 1rem;
    cursor: pointer;
    margin-top: -1rem; /* Pulls it closer to text */
    padding: 0.5rem 0;
}
.btn-show-more:hover {
    color: var(--text-color);
}


/* ---
// ===============================================
//   BOOK SHELVES SECTION
// ===============================================
// --- */

.book-shelves {
    padding: 0 4%;
    margin-top: -5rem; /* Pull shelves up into hero gradient */
    position: relative;
    z-index: 20;
}

.book-shelf {
    margin-bottom: 3rem;
}

.shelf-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.shelf-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 20px; /* Space for scrollbar */
}

/* Hide scrollbar by default */
.shelf-scroll::-webkit-scrollbar {
    height: 8px;
}
.shelf-scroll::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}
/* Show scrollbar on hover */
.shelf-scroll:hover::-webkit-scrollbar-thumb {
    background-color: #555;
}


.book-card {
    flex: 0 0 160px; /* Don't grow, don't shrink, base width 160px */
    width: 160px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-card.clickable {
    cursor: pointer;
}

.book-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
}

.book-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 20%, transparent);
    padding: 1.5rem 0.75rem 0.5rem 0.75rem;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease;
}

.book-card-title {
    font-size: 0.9rem;
    color: var(--text-color);
    /* Truncate long titles */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Book Card Hover Effect --- */
.book-card.clickable:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.book-card.clickable:hover .book-card-info {
    opacity: 1;
}

/* ---
// ===============================================
//   FOOTER
// ===============================================
// --- */

.main-footer {
    padding: 2rem 4%;
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    text-align: center;
    color: var(--text-color-secondary);
}

/* ---
// ===============================================
//   RESPONSIVE DESIGN
// ===============================================
// --- */

@media (max-width: 768px) {
    .main-nav {
        /* This is a simple mobile layout. A drawer menu is better */
        flex-wrap: wrap;
    }
    
    .nav-links {
        /* On mobile, spread links out */
        width: 100%;
        order: 3; /* Move links to the bottom */
        justify-content: space-around;
        padding-top: 10px;
        gap: 5px;
    }

    .nav-profile {
        order: 2; /* Keep profile on the right */
    }

    .logo {
        order: 1;
    }

    .hero-section {
        min-height: 70vh;
        /* Center content on mobile */
        align-items: flex-end;
        padding-bottom: 8rem; /* Space for buttons */
    }

    .hero-content {
        max-width: 100%;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1rem;
        -webkit-line-clamp: 4; /* Show 4 lines on mobile */
    }

    .hero-buttons {
        justify-content: center;
    }

    .book-shelves {
        padding: 0 2%;
    }

    /* Fix for class name mismatch */
    .book-shelf {
        margin-bottom: 2rem;
    }
    
    .shelf-title {
        font-size: 1.25rem;
    }

    .shelf-scroll {
        /* Make cards slightly smaller on mobile */
        gap: 8px;
    }

    .book-card {
        flex-basis: 140px;
        width: 140px;
    }

    .book-card img {
        height: 210px;
    }
}

/* --- (AI GENERATOR STYLES HAVE BEEN MOVED) --- */