:root {
    --primary: #FF6B35;
    --primary-gradient: linear-gradient(135deg, #FF6B35 0%, #FE8BBB 100%);
    --magic-gradient: linear-gradient(135deg, #9E7AFF 0%, #FE8BBB 100%);
    --primary-hover: #E85D22;
    --bg-main: #FFFFFF;
    --bg-accent: #FFF7F4;
    --bg-soft: #FFF2EE;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: rgba(15, 23, 42, 0.06);
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 20px 50px rgba(0,0,0,0.04);
    --radius-lg: 32px;
    --radius-md: 20px;
    --brown: #8D5A25;
    --success: #2ecc71;
}

/* --- Download Indicator --- */
.download-counter-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(46, 204, 113, 0.1);
    color: var(--success);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    border: 1px solid rgba(46, 204, 113, 0.2);
    transition: all 0.3s ease;
}

.download-counter-pill i {
    font-size: 16px;
}

.download-counter-pill.urgent {
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary);
    border-color: rgba(255, 107, 53, 0.2);
}

@media (max-width: 991px) {
    .download-counter-pill {
        display: none; /* We will show a floating one or inside mobile menu */
    }
}

.floating-download-pill {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--glass-shadow);
    z-index: 999;
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.floating-download-pill i {
    color: var(--success);
    font-size: 18px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 10px 25px rgba(255, 107, 53, 0.25);
}

.search-container {
    position: relative;
    max-width: 600px;
    margin: 40px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 10;
}

.search-form {
    width: 100%;
}

.search-form .input-group {
    background: white;
    border-radius: 50px;
    padding: 6px;
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.search-form .input-group:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.12);
    border-color: var(--primary);
}

.search-form .search-icon {
    margin-left: 20px;
    font-size: 20px;
    color: var(--text-muted);
}

.search-form input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 20px;
    font-size: 16px;
    outline: none;
    color: var(--text-main);
    font-family: inherit;
}

.search-form .btn {
    padding: 12px 30px;
}

.search-submit-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.search-submit-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 12px 28px rgba(255,107,53,0.35);
}

.search-submit-btn i {
    font-size: 17px;
}

.search-btn {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 100px; /* Prevent being just a line */
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255,107,53,0.3);
}

@media (max-width: 480px) {
    .search-btn span {
        display: none;
    }
    .search-btn {
        min-width: 45px;
        padding: 0;
        width: 45px;
        height: 45px;
        justify-content: center;
    }
}

.highlight-text {
    font-family: 'Caveat', cursive !important;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 1.4em;
    font-weight: 700;
    display: inline-block;
    vertical-align: middle;
}

/* Responsive Greeting Visibility */
.header-welcome-message {
    display: none !important; /* Default hidden (mobile) */
}

.mobile-welcome-hero {
    display: flex !important;
    justify-content: center;
    align-items: center;
    font-family: 'Caveat', cursive !important;
    font-size: 26px;
    margin-bottom: 20px;
    color: var(--text-main);
}

@media (min-width: 992px) {
    .header-welcome-message {
        display: inline-flex !important;
    }
    .mobile-welcome-hero {
        display: none !important;
    }
}

.header-welcome-message, 
.header-welcome-message span, 
.header-welcome-message strong,
.mobile-welcome-hero,
.mobile-welcome-hero span,
.mobile-welcome-hero strong {
    font-family: 'Caveat', cursive !important;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--text-main);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--text-main);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-large {
    padding: 15px 30px;
    font-size: 18px;
}

#login-btn-header {
    background: var(--primary-gradient);
    border: none;
    color: white;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.2);
}

#logout-btn {
    background: rgba(255, 107, 53, 0.08);
    border: 1px solid rgba(255, 107, 53, 0.15);
    color: var(--primary);
    cursor: pointer;
    display: none !important;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 50px;
}

body.logged-in #login-btn-header {
    display: none !important;
}
body.logged-in #logout-btn {
    display: flex !important;
}
@media (min-width: 992px) {
    body.logged-in .header-welcome-message {
        display: inline-flex !important;
    }
}

/* --- Close Button for Login Modal --- */
.login-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.05);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.login-close-btn:hover {
    background: rgba(255,107,53,0.1);
    color: var(--primary);
    transform: rotate(90deg);
}

/* --- Gated Login / Modal Popups --- */
.gate-login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #FFF2EE;
    background: linear-gradient(145deg, rgba(255,248,245,0.98) 0%, rgba(255,235,228,0.97) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: none; /* Fixed: Should be hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    padding: 40px 36px;
    position: relative;
    background: #FFFFFF;
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    animation: modalSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-box::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(255,107,53,0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* --- Magic UI Sparkles Text Effect (Vanilla Port) --- */
.sparkles-container {
    position: relative;
    display: inline-block;
}

.sparkle-icon {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    animation: sparkle-anim linear forwards;
    width: 14px;
    height: 14px;
}

@keyframes sparkle-anim {
    0% { opacity: 0; transform: scale(0) rotate(0deg); }
    50% { opacity: 1; transform: scale(var(--sparkle-scale)) rotate(180deg); }
    100% { opacity: 0; transform: scale(0) rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes staggerIn {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.login-logo {
    width: 70px; height: 70px;
    background: var(--bg-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 35px;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 5px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    font-size: 20px;
}

.input-wrapper input {
    width: 100%;
    padding: 15px 15px 15px 50px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    background: white;
    transition: all 0.3s;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 87, 34, 0.1);
}

/* --- Header --- */
.glass-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--glass-shadow);
    z-index: 1000;
    padding: 16px 0;
    transition: all 0.3s ease;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.logo i {
    font-size: 32px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 10px rgba(255, 107, 53, 0.2));
}

.logo span {
    font-family: 'Caveat', cursive;
    font-size: 30px;
    font-weight: 700;
    background: var(--text-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    padding-right: 5px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

@media (max-width: 991px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 40px;
        gap: 25px;
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1001;
        display: flex; /* Always flex when active, we use right to hide */
    }
    
    .nav-menu.active {
        right: 0;
    }
}

.nav-link {
    font-weight: 500;
    color: var(--text-main);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-btn {
    background: transparent;
    border: none;
    font-family: inherit;
    font-weight: 500;
    font-size: 16px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    transform: translateY(10px);
    background: white;
    min-width: 180px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 10px 0;
    z-index: 10;
}

.dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: block;
    padding: 10px 20px;
    color: var(--text-main);
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background: var(--bg-accent);
    color: var(--primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    height: 100%;
}

.menu-auth-section {
    display: none; /* Hidden on desktop by default */
}

@media (max-width: 991px) {
    .menu-auth-section {
        display: block; /* Visible in the mobile drawer */
        margin-top: auto;
        padding-top: 30px;
        border-top: 1px solid var(--border);
        width: 100%;
    }
}

.menu-user-info {
    display: none; /* Hidden on desktop — saudação fica no header-welcome-message */
}

@media (max-width: 991px) {
    .menu-user-info {
        display: block; /* Visible inside mobile drawer */
    }
}

.desktop-auth-btn {
    /* visível no desktop por padrão — display controlado pelo JS (flex/none) */
}

@media (max-width: 991px) {
    .desktop-auth-btn {
        display: none !important; /* no mobile os botões ficam no drawer */
    }
}

.header-action-group {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    border-right: 1px solid var(--border);
}

.header-action-group:last-child {
    border-right: none;
}

@media (max-width: 991px) {
    .header-action-group {
        border-right: none;
        padding: 0;
        margin: 0;
    }
}

.mobile-menu-toggle {
    display: none;
    background: rgba(15, 23, 42, 0.05);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 24px;
    color: var(--text-main);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 991px) {
    .mobile-menu-toggle {
        display: flex;
        z-index: 1002;
    }
}

.desktop-nav-toggle {
    display: flex;
    background: rgba(15, 23, 42, 0.05);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 20px;
    color: var(--text-main);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.desktop-nav-toggle:hover { background: rgba(15,23,42,0.1); }

@media (max-width: 991px) {
    .desktop-nav-toggle { display: none; }
}

@media (min-width: 992px) {
    .header-container.nav-hidden .nav-menu {
        display: none;
    }
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    padding: 120px 0 100px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(circle at 50% -20%, rgba(255,107,53,0.1) 0%, var(--bg-main) 100%);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-bottom: 1px solid var(--border);
}

.hero-bg-shapes {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.6;
}

.shape-1 {
    width: 600px; height: 600px;
    background: var(--primary-gradient);
    top: -200px; right: -150px;
    animation: float 12s ease-in-out infinite;
    opacity: 0.2;
}

.shape-2 {
    width: 500px; height: 500px;
    background: var(--magic-gradient);
    bottom: -150px; left: -200px;
    animation: float 15s ease-in-out infinite reverse;
    opacity: 0.15;
}

.shape-3 {
    width: 400px; height: 400px;
    background: rgba(255,107,53,0.15);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.25;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.05); }
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero-title {
    font-size: 64px;
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 24px;
    color: var(--text-main);
    letter-spacing: -2px;
}

.hero-subtitle {
    font-size: 22px;
    color: var(--text-muted);
    margin-bottom: 50px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.mobile-welcome-hero {
    display: flex;
    font-family: 'Caveat', cursive;
    font-size: 30px;
    color: var(--text-muted);
    font-weight: 600;
    margin: 0 auto 15px auto;
    width: fit-content;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.mobile-welcome-hero i {
    color: var(--primary);
    font-size: 20px;
    opacity: 0.8;
}
.mobile-welcome-hero strong {
    font-weight: 700;
    color: var(--primary);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--glass-shadow);
}

.search-heading {
    margin: 0;
    font-size: 20px;
    color: var(--text-main);
    font-weight: 700;
    text-align: center;
}

.search-form .input-group {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    padding: 8px 8px 8px 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s;
}

.search-form .input-group:focus-within {
    box-shadow: 0 4px 25px rgba(255, 87, 34, 0.2);
    outline: 2px solid var(--primary);
}

.search-icon {
    font-size: 20px;
    color: var(--text-muted);
}

.search-form input {
    flex: 1;
    border: none;
    outline: none;
    padding: 15px;
    font-size: 18px;
    font-family: inherit;
    background: transparent;
}

.quick-links {
    margin-top: 40px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.quick-link {
    background: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.quick-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* --- Footer --- */
.site-footer {
    background: white;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    color: var(--brown);
}

.footer-logo i {
    color: var(--primary);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 15px;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-copy {
    color: var(--text-muted);
    font-size: 14px;
}

/* --- Responsive Layout --- */
@media (max-width: 991px) {
    .dropdown {
        width: 100%;
    }
    
    .dropdown-content {
        position: static;
        box-shadow: none;
        transform: none !important;
        opacity: 1;
        visibility: visible;
        display: none;
        padding-left: 15px;
        border-left: 2px solid var(--border);
        margin-left: 10px;
        margin-top: 10px;
    }
    
    .dropdown.active .dropdown-content {
        display: block;
    }

    .header-welcome-message,
    .admin-badge,
    .mod-badge {
        display: none !important;
    }

    .mobile-welcome-hero {
        display: block !important;
    }

    .header-actions {
        gap: 8px;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 32px;
    }

    .search-form .input-group {
        flex-direction: column;
        padding: 10px;
        border-radius: 20px;
        gap: 10px;
    }

    .search-container {
        padding: 20px;
        border-radius: 24px;
    }

    .search-form .input-group i {
        display: none;
    }

    .search-form input {
        width: 100%;
        text-align: center;
        padding: 10px;
    }

    .search-form .btn {
        width: 100%;
    }
}
/* Autocomplete Styles */
.autocomplete-suggestions { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-card); border-radius: 0 0 12px 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); z-index: 1000; overflow: hidden; display: none; border: 1px solid var(--border); border-top: none; }
.autocomplete-suggestion { padding: 12px 20px; cursor: pointer; color: var(--text-main); font-size: 15px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; transition: background 0.2s; }
.autocomplete-suggestion:last-child { border-bottom: none; }
.autocomplete-suggestion:hover { background: rgba(56, 126, 114, 0.05); color: var(--primary); }
.autocomplete-suggestion i { color: var(--primary); opacity: 0.7; }
/* Netflix Grid Styles */
.search-results-section {
    padding: 120px 0 60px 0;
    background: transparent;
}
.search-results-title {
    color: var(--text-main);
    font-size: 24px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 30px;
}
.book-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    position: relative;
    cursor: pointer;
}

.book-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    border-color: var(--primary);
}

.favorite-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #cbd5e1;
    font-size: 18px;
}

.favorite-btn:hover {
    transform: scale(1.1);
    background: #fff;
    color: var(--primary);
}

.favorite-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.book-card-cover {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.book-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    position: relative;
    z-index: 2;
}

.book-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
}

.book-card-author {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: auto;
    display: flex;
    align-items: center;
    gap: 5px;
}
.book-card-btn {
    width: 100%;
    padding: 12px;
    border: none;
    background: var(--bg-accent);
    color: var(--text-main);
    font-weight: 700;
    font-size: 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.book-card:hover .book-card-btn {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.3);
}

/* --- Loader Ripple --- */
.loader-ripple {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}
.loader-ripple div {
  position: absolute;
  border: 4px solid var(--primary);
  opacity: 1;
  border-radius: 50%;
  animation: loader-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}
.loader-ripple div:nth-child(2) {
  animation-delay: -0.5s;
}
@keyframes loader-ripple {
  0% { top: 36px; left: 36px; width: 0; height: 0; opacity: 0; }
  5% { top: 36px; left: 36px; width: 0; height: 0; opacity: 1; }
  100% { top: 0px; left: 0px; width: 72px; height: 72px; opacity: 0; }
}
.search-loading {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.search-loading i {
    animation: spin 1s linear infinite;
    font-size: 24px;
}
@keyframes spin { 
    100% { transform: rotate(360deg); } 
}
/* --- Book Grid --- */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.book-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.book-card-cover {
    width: 100%;
    height: 280px; /* Fixed height to prevent distortion */
    object-fit: cover;
    display: block;
    background: var(--bg-soft);
}

@media (max-width: 600px) {
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .book-card-cover {
        height: 220px;
    }
}

/* Animations */
@keyframes spin { 
    to { transform: rotate(360deg); } 
}

/* Fix for overlapping elements */
.glass-header {
    z-index: 1000;
}

#main-site-content {
    overflow-x: hidden;
}

/* Smooth Transitions */
.nav-link, .btn, .book-card, .search-container {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.lang-code { font-weight: 700; color: var(--primary); margin-right: 12px; font-size: 13px; min-width: 24px; }
.active-dot { width: 6px; height: 6px; border-radius: 50%; background: white; margin-left: auto; opacity: 0; box-shadow: 0 0 8px rgba(255,255,255,0.5); }
.lang-item.active .active-dot { opacity: 1; }
.lang-item.active { color: white; background: rgba(255,255,255,0.08); }

/* --- Clean Language Switcher --- */
.lang-dropdown-wrapper { position: relative; z-index: 1000; }
.lang-dropdown-toggle {
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.lang-dropdown-toggle span {
    pointer-events: none;
}

.lang-dropdown-toggle:hover {
    background: rgba(255, 107, 53, 0.1);
    color: var(--primary);
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 16px;
    padding: 10px;
    min-width: 150px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border);
}

.lang-dropdown-wrapper:hover .lang-dropdown-menu,
.lang-dropdown-wrapper.active .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-item {
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.lang-item:hover {
    background: var(--bg-accent);
    color: var(--primary);
}

.lang-item .lang-code {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    font-size: 11px;
    padding: 2px 4px;
    border: 1px solid rgba(255,107,53,0.3);
    border-radius: 4px;
}

/* --- GLOBAL RESPONSIVENESS FIXES --- */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 36px !important;
        padding: 0 10px;
    }
    
    .search-container {
        width: calc(100% - 20px);
        margin: 20px auto 0;
    }

    .login-box {
        width: 95%;
        padding: 40px 20px;
    }
}

@media (max-width: 480px) {
    .logo span {
        font-size: 24px !important;
    }
    
    .hero-title {
        font-size: 28px !important;
    }
    
    .hero-section {
        padding: 100px 0 60px;
    }

    .header-actions {
        gap: 8px;
    }

    .lang-dropdown-toggle {
        width: 38px;
        height: 38px;
        font-size: 13px;
    }
    
    .mobile-menu-toggle {
        width: 38px;
        height: 38px;
    }
    
    #login-btn-header, #logout-btn {
        padding: 8px 15px;
        font-size: 13px;
    }
}

/* Fix for potential horizontal overflow */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Smooth mobile menu — só aplica abaixo de 991px */
@media (max-width: 991px) {
    .nav-menu {
        transition: transform 0.3s ease, opacity 0.3s ease;
    }
    .nav-menu:not(.active) {
        transform: translateY(-10px);
        pointer-events: none;
        opacity: 0;
    }
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }
}

/* ============================================
   ADMIN DASHBOARD
   ============================================ */
.admin-float-btn {
    position: fixed;
    bottom: 90px;
    right: 25px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #0F172A;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.12);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 998;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    transition: all 0.3s ease;
}
.admin-float-btn:hover {
    transform: scale(1.1) rotate(25deg);
    background: var(--primary);
    border-color: transparent;
}

.admin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.admin-modal-box {
    width: 100%;
    max-width: 580px;
    max-height: 88vh;
    overflow-y: auto;
    padding: 32px;
    border-radius: 28px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.25s ease;
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.admin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.admin-modal-header h2 {
    margin: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}
.admin-close-btn {
    background: rgba(0,0,0,0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.admin-close-btn:hover { background: rgba(0,0,0,0.1); color: var(--text-main); }

.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
    padding-bottom: 14px;
}
.admin-tab {
    background: none;
    border: none;
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
}
.admin-tab.active {
    background: var(--primary-gradient);
    color: white;
}
.admin-tab:not(.active):hover {
    background: rgba(0,0,0,0.05);
    color: var(--text-main);
}

.admin-tab-content { display: none; }
.admin-tab-content.active { display: block; }

/* Metric Cards */
.admin-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 10px;
}
.admin-metric-card {
    background: #F8FAFC;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 18px;
    padding: 22px 18px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}
.admin-metric-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    background: #fff;
}
.admin-metric-card > i {
    font-size: 26px;
    color: var(--primary);
    margin-bottom: 10px;
    display: block;
}
.admin-metric-value {
    font-size: 38px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    font-family: 'Caveat', cursive;
    line-height: 1;
}
.admin-metric-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Premium Tab */
.admin-grant-form {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.admin-grant-form input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    background: #F8FAFC;
    color: var(--text-main);
    transition: border-color 0.2s, background 0.2s;
}
.admin-grant-form input:focus { border-color: var(--primary); background: #fff; }

.admin-premium-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.09);
    margin-bottom: 8px;
    background: #FFFBEB;
    transition: border-color 0.2s;
}
.admin-premium-item:hover { border-color: rgba(251,191,36,0.5); }
.admin-premium-item-email { font-weight: 600; font-size: 14px; color: var(--text-main); }
.admin-premium-item-date  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.admin-revoke-btn {
    background: rgba(231,76,60,0.1);
    border: none;
    color: #e74c3c;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: background 0.2s;
}
.admin-revoke-btn:hover { background: rgba(231,76,60,0.2); }

.admin-premium-list {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}
.admin-feedback {
    display: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    margin-top: 10px;
}

.admin-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.admin-section-title i { color: var(--primary); }

/* Admin Logo Icon */
.admin-logo-icon {
    width: 44px;
    height: 44px;
    background: #0F172A;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.admin-logo-icon i { color: #FFD700; font-size: 22px; }

/* Spin animation */
.admin-spin {
    display: inline-block;
    animation: spin 1s linear infinite;
}

/* ── KPI Grid ── */
.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 6px;
}
.admin-kpi-card {
    background: #F8FAFC;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 16px;
    padding: 18px 14px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.admin-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: rgba(15, 23, 42, 0.18);
}
.admin-kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 20px;
}
.admin-kpi-value {
    font-size: 30px;
    font-weight: 700;
    color: var(--text-main);
    font-family: 'Caveat', cursive;
    line-height: 1;
    margin-bottom: 4px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.admin-kpi-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ── Users Tab ── */
.admin-users-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.admin-search-wrapper {
    flex: 1;
    min-width: 180px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #F8FAFC;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 12px;
    padding: 0 14px;
    transition: border-color 0.2s, background 0.2s;
}
.admin-search-wrapper:focus-within { border-color: var(--primary); background: #fff; }
.admin-search-wrapper i { color: var(--text-muted); font-size: 16px; flex-shrink: 0; }
.admin-search-wrapper input {
    border: none;
    background: transparent;
    padding: 10px 0;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    width: 100%;
    outline: none;
}
.admin-filter-btns { display: flex; gap: 6px; flex-shrink: 0; }
.admin-filter-btn {
    background: #F8FAFC;
    border: 1px solid rgba(15, 23, 42, 0.12);
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s;
    white-space: nowrap;
}
.admin-filter-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}
.admin-filter-btn:not(.active):hover {
    border-color: var(--primary);
    color: var(--primary);
}

.admin-users-list {
    max-height: 340px;
    overflow-y: auto;
    padding-right: 2px;
}
.admin-users-count {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    margin-top: 8px;
    font-weight: 600;
}

/* User Row */
.admin-user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.09);
    margin-bottom: 8px;
    background: #F8FAFC;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.admin-user-row:hover {
    border-color: rgba(255,107,53,0.35);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    background: #fff;
}
.admin-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    font-family: 'Outfit', sans-serif;
}
.admin-user-avatar-vip {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-user-email {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 2px 0 5px;
}
.admin-user-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.admin-tag {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 5px;
    font-weight: 700;
    background: rgba(0,0,0,0.06);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.admin-tag-vip {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
}
.admin-tag-free { background: rgba(100,116,139,0.15); color: #64748b; }

.admin-user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}
.admin-grant-btn {
    background: rgba(251,191,36,0.12);
    border: 1px solid rgba(251,191,36,0.3);
    color: #d97706;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    font-family: inherit;
}
.admin-grant-btn:hover { background: rgba(251,191,36,0.25); }

.admin-empty-state {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 30px 20px;
    line-height: 1.6;
}

/* Wider modal for the full panel */
.admin-modal-box { max-width: 720px; }

@media (max-width: 600px) {
    .admin-metrics-grid    { grid-template-columns: 1fr 1fr; }
    .admin-kpi-grid        { grid-template-columns: 1fr 1fr; }
    .admin-modal-box       { padding: 20px 16px; }
    .admin-grant-form      { flex-direction: column; }
    .admin-users-toolbar   { flex-direction: column; align-items: stretch; }
    .admin-filter-btns     { justify-content: stretch; }
    .admin-filter-btn      { flex: 1; text-align: center; }
    .admin-user-meta       { display: none; }
}

/* =====================================================
   PAYWALL — PLANOS (3 cards inline)
   ===================================================== */
.pw-plans-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-bottom: 8px;
}

/* Wrapper: badge acima + card abaixo */
.pw-plan-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.pw-plan-wrap .pw-plan-badge {
    align-self: flex-start;
    margin-left: 14px;
    margin-bottom: -1px;
    position: relative;
    z-index: 2;
    background: var(--primary-gradient);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 10px 10px 0 0;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    box-shadow: 0 -2px 8px rgba(255,107,53,0.15);
}
.pw-plan-wrap .pw-plan-badge.pw-badge-best {
    background: linear-gradient(135deg,#22c55e,#16a34a);
    box-shadow: 0 -2px 8px rgba(34,197,94,0.15);
}

.pw-plan-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: white;
    border: 1.5px solid #ede9e6;
    border-radius: 16px;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
    cursor: pointer;
}
.pw-plan-wrap:has(.pw-plan-badge) .pw-plan-card {
    border-radius: 0 16px 16px 16px;
}
.pw-plan-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 18px rgba(255,107,53,0.12);
    transform: translateY(-1px);
}
.pw-plan-card.pw-plan-popular {
    border-color: var(--primary);
    background: linear-gradient(135deg, #fff9f7 0%, #fff 100%);
    box-shadow: 0 4px 20px rgba(255,107,53,0.1);
}
.pw-plan-card.pw-plan-annual {
    border-color: #22c55e;
    background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
}
.pw-plan-card.pw-plan-annual:hover {
    border-color: #16a34a;
    box-shadow: 0 4px 18px rgba(34,197,94,0.15);
}

.pw-plan-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
    text-align: left;
}
.pw-plan-name {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.pw-plan-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
}
.pw-plan-price small {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}
.pw-plan-save {
    font-size: 11px;
    font-weight: 600;
    color: #16a34a;
}

.pw-plan-btn {
    flex-shrink: 0;
    padding: 11px 22px;
    border: none;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    background: #fff2ee;
    color: var(--primary);
    transition: all 0.2s;
    white-space: nowrap;
}
.pw-plan-btn:hover {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(255,107,53,0.3);
}
.pw-plan-card.pw-plan-popular .pw-plan-btn {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(255,107,53,0.25);
}
.pw-plan-card.pw-plan-annual .pw-plan-btn {
    background: rgba(34,197,94,0.12);
    color: #16a34a;
}
.pw-plan-card.pw-plan-annual .pw-plan-btn:hover {
    background: linear-gradient(135deg,#22c55e,#16a34a);
    color: white;
    box-shadow: 0 4px 14px rgba(34,197,94,0.3);
}

/* ── MP Payment Modal ─────────────────────────────── */
.mp-payment-box {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 24px;
    padding: 32px 24px 24px;
    background: #FAFAFA;
    border: 1px solid #E8E8E8;
    box-shadow: 0 24px 60px rgba(0,0,0,0.18);
}
.mp-close-btn {
    position: absolute; top: 14px; right: 14px;
    background: #F0F0F0; border: none; border-radius: 50%;
    width: 34px; height: 34px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; color: #888; transition: 0.2s;
}
.mp-close-btn:hover { background: #E5E5E5; color: #333; }
.mp-header { text-align: center; margin-bottom: 18px; }
.mp-header-icon { font-size: 34px; margin-bottom: 6px; }
.mp-header-title { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: #1a1a1a; }
.mp-price-row { display: flex; align-items: baseline; justify-content: center; gap: 4px; }
.mp-price-value { font-size: 30px; font-weight: 800; color: #FF6B35; }
.mp-price-period { font-size: 13px; color: #999; }
.mp-method-tabs {
    display: flex; gap: 6px; margin-bottom: 18px;
    background: #EFEFEF; border-radius: 12px; padding: 4px;
    border: 1px solid #E0E0E0;
}
.mp-method-tab {
    flex: 1; padding: 10px 8px; border: none; border-radius: 9px;
    background: transparent; cursor: pointer; font-size: 13px; font-weight: 600;
    color: #888; display: flex; align-items: center; justify-content: center;
    gap: 6px; transition: 0.18s; font-family: inherit;
}
.mp-method-tab.mp-tab-active {
    background: #fff; color: #1a1a1a;
    box-shadow: 0 1px 6px rgba(0,0,0,0.12);
    border: 1px solid #E0E0E0;
}
.mp-off-badge {
    background: linear-gradient(135deg,#FF6B35,#FF4500); color: white;
    font-size: 10px; padding: 2px 6px; border-radius: 4px;
    font-style: normal; font-weight: 700;
}
.mp-security-note {
    text-align: center; font-size: 11px; color: #aaa;
    margin: 14px 0 0; display: flex; align-items: center; justify-content: center; gap: 5px;
}
@media (max-width: 520px) {
    .mp-payment-box { padding: 22px 16px 18px; border-radius: 20px; }
    .mp-price-value { font-size: 26px; }
}

/* ════════════════════════════════════════════════════
   POPUP FLUTUANTE DE PLANOS
════════════════════════════════════════════════════ */
#plan-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(30,15,10,0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    padding: 20px;
    opacity: 0;
    animation: ppFadeIn 0.22s ease forwards;
}
@keyframes ppFadeIn { to { opacity: 1; } }

#plan-popup-box {
    background: #FAF6F3;
    border-radius: 28px;
    padding: 28px 18px 20px;
    width: 100%;
    max-width: 340px;
    overflow: hidden;
    box-shadow: 0 40px 80px rgba(0,0,0,0.35), 0 0 0 1px rgba(200,150,130,0.2);
    transform: translateY(28px) scale(0.95);
    opacity: 0;
    animation: ppSlideUp 0.38s cubic-bezier(0.16,1,0.3,1) 0.05s forwards;
    position: relative;
}
@keyframes ppSlideUp { to { transform: translateY(0) scale(1); opacity: 1; } }

.pp-close {
    position: absolute; top: 14px; right: 14px;
    width: 30px; height: 30px; border-radius: 50%;
    border: none; background: rgba(0,0,0,0.07); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; color: #888;
    transition: background 0.18s, transform 0.18s;
}
.pp-close:hover { background: rgba(0,0,0,0.13); transform: scale(1.08); color: #333; }

.pp-title {
    text-align: center;
    font-size: 17px; font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 3px;
    letter-spacing: -0.3px;
}
.pp-subtitle {
    text-align: center;
    font-size: 12px; color: #888;
    margin: 0 0 16px;
}

/* ── Cards radio ── */
.pp-plans { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

.pp-plan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 15px;
    border-radius: 16px;
    border: 1.5px solid #E8DDD8;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    gap: 12px;
    user-select: none;
}
.pp-plan:hover { background: #FFF4F0; border-color: rgba(255,107,53,0.35); }
.pp-plan.pp-selected {
    border-color: var(--primary);
    background: #FFF4EE;
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

.pp-plan-info { flex: 1; min-width: 0; }
.pp-plan-name {
    font-size: 14px; font-weight: 700;
    color: #1a1a1a;
    display: flex; align-items: center; gap: 7px;
    margin-bottom: 2px;
}
.pp-badge {
    font-size: 9px; padding: 2px 8px;
    border-radius: 20px; font-weight: 700;
    letter-spacing: 0; display: inline-block;
}
.pp-badge-hot { background: var(--primary-gradient); color: #fff; }

.pp-plan-price {
    font-size: 15px; font-weight: 800;
    color: #1a1a1a; line-height: 1.2;
}
.pp-plan-price small { font-size: 12px; font-weight: 500; color: #aaa; }
.pp-plan-save { font-size: 11px; font-weight: 600; color: var(--primary); margin-top: 1px; }

/* Radio circle */
.pp-radio {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid #D0C8C4;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: border-color 0.2s;
    position: relative;
}
.pp-radio::after {
    content: '';
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--primary);
    transform: scale(0);
    transition: transform 0.22s cubic-bezier(0.16,1,0.3,1);
}
.pp-plan.pp-selected .pp-radio { border-color: var(--primary); }
.pp-plan.pp-selected .pp-radio::after { transform: scale(1); }

/* CTA único */
.pp-cta {
    width: 100%;
    padding: 15px;
    border: none; border-radius: 16px;
    background: var(--primary-gradient);
    color: #fff;
    font-size: 15px; font-weight: 700;
    font-family: inherit; cursor: pointer;
    transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
    letter-spacing: -0.2px;
    box-shadow: 0 6px 20px rgba(255,107,53,0.35);
    margin-top: 4px;
}
.pp-cta:hover { opacity: 0.9; box-shadow: 0 10px 28px rgba(255,107,53,0.5); }
.pp-cta:active { transform: scale(0.98); }

.pp-footer {
    text-align: center; margin-top: 12px;
    font-size: 11px; color: #bbb;
    display: flex; align-items: center; justify-content: center; gap: 4px;
}

/* ── Toast flutuante ── */
#toast-container {
    position: fixed; top: 18px; left: 18px;
    z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.toast-item {
    display: flex; align-items: center; gap: 10px;
    background: #1a1a1a; color: #fff;
    padding: 12px 16px; border-radius: 14px;
    font-size: 13px; font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    opacity: 0; transform: translateX(-20px);
    animation: toastIn 0.3s cubic-bezier(0.16,1,0.3,1) forwards;
    pointer-events: auto;
    max-width: 280px;
}
.toast-item.toast-out {
    animation: toastOut 0.25s ease forwards;
}
.toast-item i { font-size: 16px; flex-shrink: 0; }
@keyframes toastIn { to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-16px); } }


/* ════════════════════════════════════════════════════
   ANIMAÇÕES GLOBAIS DO SITE
════════════════════════════════════════════════════ */

/* Entrada dos elementos no scroll */
.anim-fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s cubic-bezier(0.16,1,0.3,1),
                transform 0.55s cubic-bezier(0.16,1,0.3,1);
}
.anim-fade-up.anim-visible {
    opacity: 1;
    transform: translateY(0);
}
.anim-delay-1 { transition-delay: 0.08s; }
.anim-delay-2 { transition-delay: 0.16s; }
.anim-delay-3 { transition-delay: 0.24s; }
.anim-delay-4 { transition-delay: 0.32s; }

/* Cards de livro — shimmer no hover */
.book-card {
    transition: transform 0.35s cubic-bezier(0.16,1,0.3,1),
                box-shadow 0.35s cubic-bezier(0.16,1,0.3,1),
                border-color 0.2s !important;
}
.book-card:hover {
    transform: translateY(-6px) scale(1.015) !important;
    box-shadow: 0 16px 40px rgba(255,107,53,0.12), 0 4px 12px rgba(0,0,0,0.06) !important;
}
.book-card-cover {
    transition: transform 0.5s cubic-bezier(0.16,1,0.3,1) !important;
}
.book-card:hover .book-card-cover {
    transform: scale(1.05) !important;
}

/* Botões — ripple suave */
.btn {
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s, opacity 0.2s !important;
}
.btn:active { transform: scale(0.97) !important; }

/* Nav links */
.nav-link {
    transition: color 0.2s, opacity 0.2s !important;
}

/* Modais — entrada padrão */
@keyframes modalPop {
    from { opacity: 0; transform: scale(0.94) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.gate-login-screen .login-box,
.gate-login-screen .mp-payment-box {
    animation: modalPop 0.35s cubic-bezier(0.16,1,0.3,1) !important;
}

/* Floating download pill — pulse */
@keyframes pillPulse {
    0%,100% { box-shadow: 0 4px 20px rgba(255,107,53,0.2); }
    50%      { box-shadow: 0 4px 28px rgba(255,107,53,0.45); }
}
.floating-download-pill { animation: pillPulse 2.5s ease-in-out infinite; }

/* Shimmer no skeleton loading */
@keyframes shimmer {
    from { background-position: -400px 0; }
    to   { background-position: 400px 0; }
}
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 400px 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    border-radius: 8px;
}

/* Filter chips */
.filter-chip {
    padding: 5px 14px;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    background: white;
    color: var(--text-main);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
    font-family: inherit;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--primary-gradient); color: white; border-color: transparent; }

/* ── Desktop Header Redesign ─────────────────────────────────────────── */
@media (min-width: 992px) {
    /* nav-menu sempre como drawer, nunca inline */
    .nav-menu {
        position: fixed !important;
        top: 0 !important;
        right: -320px !important;
        width: 300px !important;
        height: 100vh !important;
        background: white !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 80px 40px !important;
        gap: 25px !important;
        box-shadow: -10px 0 30px rgba(0,0,0,0.15) !important;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
        z-index: 1001 !important;
        display: flex !important;
        overflow-y: auto;
    }
    .nav-menu.active {
        right: 0 !important;
    }
    .header-container.nav-hidden .nav-menu {
        right: -320px !important;
        display: flex !important;
    }

    /* hamburger visível no desktop */
    .mobile-menu-toggle {
        display: flex !important;
        z-index: 1002;
    }

    /* welcome centralizado via posição absoluta */
    .header-container {
        position: relative;
    }
    .header-welcome-message {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: inline-flex !important;
        pointer-events: none;
    }

    /* auth section e user info visíveis no drawer do desktop */
    .menu-auth-section {
        display: block !important;
    }
    .menu-user-info {
        display: block !important;
    }

    /* esconde botões de auth que eram só do desktop no header */
    .desktop-auth-btn { display: none !important; }
    .desktop-nav-toggle { display: none !important; }
}

/* ── Genre Section ──────────────────────────────────────────────────────────── */
.genres-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}
@media (min-width: 600px)  { .genres-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .genres-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .genres-grid { grid-template-columns: repeat(5, 1fr); } }

.genre-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 2/3;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: #1a1a2e;
}
.genre-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 32px rgba(0,0,0,0.22);
}
.genre-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.genre-card:hover .genre-card-bg { transform: scale(1.06); }
.genre-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.15) 60%, transparent 100%);
}
.genre-card-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 18px 14px 16px;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    letter-spacing: -0.2px;
}
