/* Dashboard-specific styles */
.dashboard-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
}

/* Custom Navbar */
.dashboard-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(180deg, rgba(15, 15, 35, 0.95) 0%, transparent 100%);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.dashboard-nav.scrolled {
    background: rgba(15, 15, 35, 0.98);
    backdrop-filter: blur(20px);
    padding: 1rem 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

html,
body {
    overflow-x: hidden;
    overflow-y: auto;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-logo {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -2px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-pink), var(--neon-purple));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientFlow 6s ease-in-out infinite;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-search {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 250px;
    transition: all 0.3s ease;
}

.nav-search:focus {
    outline: none;
    border-color: var(--primary);
    width: 300px;
    background: rgba(255, 255, 255, 0.08);
}

.nav-search-wrap {
    position: relative;
}

.home-search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    max-height: 360px;
    overflow: auto;
    background: rgba(15, 15, 35, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(16px);
    z-index: 2000;
}

body.nav-open {
    overflow: hidden;
}

.home-search-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.nav-open {
    overflow: hidden;
}

.home-search-item:last-child {
    border-bottom: none;
}

.home-search-item:hover,
.home-search-item.active {
    background: rgba(99, 102, 241, 0.14);
}

.home-search-cover {
    width: 38px;
    height: 52px;
    border-radius: 10px;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    overflow: hidden;
}

.home-search-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-search-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.home-search-title {
    font-weight: 650;
    font-size: 0.92rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-search-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* Hero Section */
.hero-section {
    height: 85vh;
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 3rem;
    margin-top: 80px;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    /* remove opacity so the cover image you set via JS is crisp */
    opacity: 1;
}


@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Softer + smoother gradient */
    background: linear-gradient(90deg,
            rgba(15, 15, 35, 0.75) 20%,
            /* darker just behind text */
            rgba(15, 15, 35, 0.35) 55%,
            /* softer in middle */
            transparent 100%
            /* right side almost clear */
        );
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
}

.hero-badge {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid var(--primary);
    border-radius: 50px;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.hero-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.hero-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.hero-btn {
    padding: 16px 32px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.hero-btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.hero-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

.hero-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.hero-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
}

.hero-tts-controls {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.hero-tts-btn {
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(15, 15, 35, 0.7);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    backdrop-filter: blur(12px);
}

.hero-tts-btn:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.hero-tts-btn-secondary {
    background: rgba(255, 255, 255, 0.06);
}

.tts-toggle-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.tts-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.tts-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.tts-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: .4s;
    border-radius: 24px;
}

.tts-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.tts-slider {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

input:checked+.tts-slider:before {
    transform: translateX(20px);
}

.tts-toggle-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Book Rows Section */
.content-rows {
    padding: 3rem;
    position: relative;
    z-index: 5;
}

.book-row {
    margin-bottom: 4rem;
}

.row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.row-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.row-see-all {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.row-see-all:hover {
    color: var(--primary);
}

.books-slider {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.5) transparent;
}

.books-slider::-webkit-scrollbar {
    height: 8px;
}

.books-slider::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.books-slider::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.5);
    border-radius: 10px;
}

.books-slider::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.book-item {
    min-width: 200px;
    max-width: 200px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.book-item:hover {
    transform: scale(1.08) translateY(-10px);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.book-item-cover {
    width: 100%;
    height: 280px;
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    background-size: 300% 300%;
    animation: gradientFlow 8s ease-in-out infinite;
    position: relative;
}

.book-item-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.book-item-info {
    padding: 1rem;
}

.book-item-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.book-item-author {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.book-item-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.book-item-rating .stars {
    color: #fbbf24;
}

/* Quick Stats Section */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(99, 102, 241, 0.3);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dashboard-nav {
        padding: 1rem 1.5rem;
    }

    .nav-links,
    .nav-search {
        display: none;
    }

    .hero-section {
        height: auto;
        padding: 2rem 1.5rem;
        margin-top: 60px;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-btn {
        width: 100%;
        justify-content: center;
    }

    .content-rows {
        padding: 2rem 1.5rem;
    }

    .row-title {
        font-size: 1.4rem;
    }

    .book-item {
        min-width: 160px;
        max-width: 160px;
    }

    .book-item-cover {
        height: 220px;
    }
}

/* Hamburger (hidden on desktop) */
.nav-hamburger {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    cursor: pointer;
    transition: all .25s ease;
}

.nav-hamburger:hover {
    border-color: rgba(99, 102, 241, 0.55);
    transform: translateY(-1px);
}

/* Mobile drawer */
.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    z-index: 1200;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(360px, 92vw);
    height: 100vh;
    background: rgba(7, 7, 24, 0.92);
    border-left: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(18px);
    transform: translateX(110%);
    transition: transform .25s ease;
    z-index: 1300;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-nav.open {
    transform: translateX(0);
}

.mobile-nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Ensure mobile dropdown is anchored to the mobile search container */
.mobile-nav-search {
    position: relative;
}

/* Override absolute width/positioning for the mobile dropdown */
.mobile-nav-search .home-search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    width: auto;
    max-height: 320px;
    overflow: auto;
    z-index: 2000;
}

.mobile-nav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.mobile-nav-logo {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -1px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-pink), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-nav-close {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    cursor: pointer;
}

.mobile-nav-search .nav-search-mobile {
    width: 100%;
    display: block;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

/* Unified drawer extras (profile.php) */
.mobile-nav {
    overflow-y: auto;
}

.mobile-nav-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.35);
    padding: 0 0.25rem;
    margin-top: 0.25rem;
}

.mobile-nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0.25rem 0;
}

/* Profile section buttons in drawer — styled identically to nav-link anchors */
.mobile-section-btn {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    transition: background .2s, color .2s, transform .15s;
}

.mobile-section-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    color: #fff;
    transform: translateX(4px);
}

.mobile-section-btn.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.18), transparent);
    color: var(--neon-blue, #00d4ff);
    border-left: 3px solid var(--neon-blue, #00d4ff);
}

@media (max-width: 768px) {

    .nav-links,
    .nav-search {
        display: none;
    }

    .nav-hamburger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}