@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=Inter:wght@300;400;500;600;700;800&display=swap&display=swap');
/* font-display: swap is included in the URL but adding it here as a reminder */

:root {
    /* Modern Vibrant Color Palette - Purple/Blue Theme */
    --primary-bg: #0a0e27;
    /* Deep Navy */
    --secondary-bg: #141b3a;
    /* Rich Dark Blue */
    --card-bg: rgba(20, 27, 58, 0.75);
    /* Glassy Navy */
    --accent-primary: #6366f1;
    /* Vibrant Indigo */
    --accent-secondary: #8b5cf6;
    /* Vivid Purple */
    --accent-gold: #fbbf24;
    /* Bright Gold */
    --accent-pink: #f472b6;
    /* Hot Pink accent */
    --accent-cyan: #06b6d4;
    /* Electric Cyan */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Premium Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --gradient-gold: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #ea580c 100%);
    --gradient-card: linear-gradient(145deg, rgba(20, 27, 58, 0.9) 0%, rgba(10, 14, 39, 0.9) 100%);
    --gradient-hero: linear-gradient(135deg, #6366f1 0%, #8b5cf6 35%, #f472b6 100%);
    --gradient-text: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);

    /* Enhanced Shadows & Glows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.5);
    --shadow-glow-strong: 0 0 50px rgba(99, 102, 241, 0.7);

    /* Glassmorphism Effects */
    --glass-bg: rgba(20, 27, 58, 0.5);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(15px);
}

[data-theme="light"] {
    --primary-bg: #f8fafc;
    --secondary-bg: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.98);
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.1);
    --gradient-card: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
    --glass-bg: rgba(255, 255, 255, 0.85);
}

/* Light Mode visibility fixes */
[data-theme="light"] .results-close-btn,
[data-theme="light"] .tool-close-btn {
    color: var(--text-primary) !important;
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .btn-widget {
    color: white !important;
    /* Ensure widget buttons remain readable */
}

[data-theme="light"] .widget-card-ai::before {
    opacity: 0.8;
}

[data-theme="light"] .btn-register {
    color: var(--accent-primary) !important;
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: var(--accent-primary) !important;
    text-shadow: none !important;
}

[data-theme="light"] .btn-login {
    color: white !important;
}

[data-theme="light"] .header-offline-btn {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

[data-theme="light"] .ai-status-zone {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .drawer-list-item {
    color: var(--text-primary) !important;
}

[data-theme="light"] .drawer-list-item:hover,
[data-theme="light"] .drawer-list-item:active {
    background: rgba(0, 0, 0, 0.05);
}

/* Light Mode Input/Textarea Fixes */
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
    background: white !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder {
    color: var(--text-muted);
}

/* Light Mode Button Fixes */
[data-theme="light"] .btn-secondary,
[data-theme="light"] .btn-sm {
    background: white !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="light"] .btn-secondary:hover,
[data-theme="light"] .btn-sm:hover {
    background: var(--gray-100) !important;
    border-color: var(--accent-primary) !important;
    color: var(--accent-primary) !important;
}

[data-theme="light"] .drawer-main-btn {
    color: white !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =========================================
   PREMIUM MODE: NO ADS
   This creates a clean version of the app
   for Premium and Admin users.
   ========================================= */
body.premium-mode .sky-ad-left,
body.premium-mode .sky-ad-right,
body.premium-mode .ad-banner-container,
body.premium-mode .ad-container,
body.premium-mode .ad-container-mobile,
body.premium-mode .ad-container-sidebar,
body.premium-mode .mobile-ad-spot,
body.premium-mode .mobile-sky-strip,
body.premium-mode .sky-ad-item,
body.premium-mode iframe[src*="effectivegatecpm"],
body.premium-mode iframe[src*="highperformanceformat"],
body.premium-mode div[id^="ad-"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    position: absolute !important;
    opacity: 0 !important;
    z-index: -9999 !important;
}

/* Reclaim space in main container for Premium users if ads were squeezing it */
body.premium-mode .container {
    max-width: 1200px !important;
}

/* Ensure full height if needed */
body.premium-mode .main-content {
    min-height: calc(100vh - 80px);
}


body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background with Vibrant Glows */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(244, 114, 182, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 30% 70%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
        var(--primary-bg);
    z-index: -1;
    animation: backgroundPulse 20s ease-in-out infinite alternate;
}

@keyframes backgroundPulse {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }

    100% {
        opacity: 0.6;
        transform: scale(1);
    }
}

/* Header Navigation & Organization */
header {
    background: var(--gradient-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 2rem;
    /* Slimmer header */
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(15px);
}

.header-content {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* Group 1: Brand */
.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.logo-section img {
    width: 42px;
    height: 42px;
    border-radius: 10px;
}

.logo-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    line-height: 1;
    display: block;
}

.h1-style {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.brand-text p {
    font-size: 0.75rem;
    margin: 0;
    opacity: 0.7;
}

/* Group 2: Navigation */
nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

nav a:hover,
nav a.active {
    color: var(--accent-primary);
}

/* Group 3: AI & Actions Area */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.ai-status-zone {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
    gap: 10px;
}

.ai-status-zone:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.credit-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.credit-badge i {
    color: var(--accent-gold);
    font-size: 0.9rem;
}

.credit-badge-val {
    font-size: 0.95rem;
    color: white;
}

.reset-timer-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--accent-gold);
    font-weight: 600;
    margin-left: 5px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.reset-timer-header i {
    font-size: 0.75rem;
    opacity: 0.8;
}


/* Group 4: User Controls */
.user-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 5px;
    border-radius: 8px;
    transition: background 0.2s;
}

.header-offline-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.header-offline-btn:hover {
    background: rgba(251, 191, 36, 0.1);
    color: var(--accent-gold);
    border-color: rgba(251, 191, 36, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.15);
}

.lang-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-pro-slim {
    background: var(--gradient-gold);
    color: #000;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-pro-slim:hover {
    transform: scale(1.05);
}

@media (max-width: 1024px) {
    header {
        padding: 0.6rem 1.2rem !important;
    }

    .header-content {
        flex-direction: row !important;
        /* Volver a row para mejor alineación móvil */
        justify-content: space-between !important;
        padding: 0 !important;
        margin: 0 !important;
        height: 50px;
    }

    .logo-section {
        gap: 0.6rem !important;
    }

    .logo-section img {
        width: 36px !important;
        height: 36px !important;
    }

    .brand-text h1 {
        font-size: 1.1rem !important;
        white-space: nowrap;
    }

    .brand-text p {
        display: none !important;
        /* Ocultar subtítulo en móvil para ganar espacio */
    }

    .mobile-only-notif-zone {
        display: flex !important;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        margin-right: 0.8rem;
        z-index: 1001;
    }

    .mobile-only-notif-zone .notification-badge-container {
        position: relative;
        font-size: 1.3rem;
        cursor: pointer;
        padding: 5px;
        color: var(--accent-primary);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-only-notif-zone .badge {
        position: absolute;
        top: -2px;
        right: -2px;
        background: #ef4444;
        color: white;
        font-size: 0.65rem;
        min-width: 16px;
        height: 16px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1.5px solid var(--secondary-bg);
        font-weight: 800;
        padding: 2px;
    }

    /* Mobile Navigation Button - Professional Positioning */
    .mobile-menu-btn {
        display: flex !important;
        position: relative !important;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 12px !important;
        color: var(--accent-primary) !important;
        font-size: 1.2rem !important;
        cursor: pointer;
        z-index: 1002;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    }

    .mobile-menu-btn:hover {
        background: rgba(99, 102, 241, 0.1) !important;
        border-color: var(--accent-primary) !important;
        transform: scale(1.05);
    }

    .mobile-menu-btn:active {
        transform: scale(0.95);
    }

    nav ul {
        display: none !important;
    }


    nav ul.nav-active {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 1rem;
        background: var(--secondary-bg);
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        animation: slideDown 0.3s ease forwards;
    }

    nav ul li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    nav ul li a {
        display: block;
        padding: 1rem;
        text-align: center;
        width: 100%;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide hamburger on desktop */
.mobile-menu-btn {
    display: none;
}


.auth-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    align-items: center;
}

.btn-login {
    background: var(--gradient-primary);
    color: white;
    padding: 0.4rem 1rem;
    /* Reduced padding */
    border-radius: 8px;
    /* Slightly tighter radius */
    font-weight: 700;
    font-size: 0.8rem;
    /* Reduced font size */
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

.btn-register {
    background: rgba(99, 102, 241, 0.1);
    color: white;
    padding: 0.4rem 1rem;
    /* Reduced padding */
    border: 1.5px solid var(--accent-primary);
    border-radius: 8px;
    /* Slightly tighter radius */
    font-weight: 700;
    font-size: 0.8rem;
    /* Reduced font size */
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-family: 'Outfit', sans-serif;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-register:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: #a78bfa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* User Profile Styles */
.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.user-profile-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-primary);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    padding: 20px;
    display: none;
    animation: dropdownSlide 0.3s ease-out;
}

.profile-dropdown.active {
    display: block;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar-large {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    box-shadow: var(--shadow-glow);
    object-fit: cover;
}

.profile-info h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.profile-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.profile-actions {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
}

.profile-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.profile-btn.logout {
    margin-top: 5px;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.05);
}

.profile-btn.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

.photo-upload-label {
    font-size: 0.75rem;
    color: var(--accent-primary);
    cursor: pointer;
    font-weight: 600;
}

.photo-upload-label:hover {
    text-decoration: underline;
}

/* Utility Buttons */
.btn-danger {
    background: #ef4444;
    color: white !important;
    border: 1px solid #dc2626;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-success {
    background: #10b981;
    color: white !important;
    border: 1px solid #059669;
}

.btn-success:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Reset Counter Styles */
.reset-timer {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.reset-timer span {
    color: var(--accent-gold);
    font-variant-numeric: tabular-nums;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-section img {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

.logo-section img:hover {
    transform: scale(1.05) rotate(5deg);
}

.brand-text {
    flex-shrink: 0;
}

.brand-text h1 {
    font-size: 1.5rem;
    line-height: 1.2;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text p {
    font-size: 0.8rem;
    margin: 0;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Premium Touches */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover::after {
    left: 100%;
}

.widget-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.widget-card:hover {
    transform: translateY(-8px) scale(1.01);
}

.search-hub button {
    animation: buttonPulse 3s infinite;
}

@keyframes buttonPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 99, 235, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.brand-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

nav ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: block;
}

nav ul li a:hover,
nav ul li a.active {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Sidebar Menu Button Icons */
.sidebar-menu button i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: var(--accent-primary);
    transition: color 0.3s;
}

.sidebar-menu button.active i,
.sidebar-menu button:hover i {
    color: white;
}

/* Drawer Menu Icons */
.drawer-list-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: var(--accent-primary);
}

.drawer-list-item:hover i {
    color: white;
}

/* Hero & Search Hub */
.hero-ai {
    text-align: center;
    padding: 5rem 1rem 7rem;
    position: relative;
    overflow: hidden;
}

.hero-ai h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    margin-bottom: 1.5rem;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.04em;
    line-height: 1.1;
    animation: fadeInUp 0.8s ease backwards;
}

.hero-ai p {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 3.5rem;
    line-height: 1.7;
    font-weight: 400;
    animation: fadeInUp 0.8s 0.2s ease backwards;
}

/* SEARCH HUB */
.search-hub-container {
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s 0.4s ease backwards;
}

.search-hub {
    display: flex;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    padding: 10px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 800px;
    margin: 0 auto;
}

.search-hub:focus-within {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg), var(--shadow-glow-strong);
    transform: translateY(-4px) scale(1.01);
}

.search-hub input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 14px 24px;
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
}

.search-hub input::placeholder {
    color: var(--text-muted);
}

.search-hub button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 14px 30px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.search-hub button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

/* PROMPT GRID (Modern Chips) */
.prompt-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 2rem;
}

.prompt-card {
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.15);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.prompt-card:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.2);
}

.prompt-card span {
    font-size: 1.1rem;
}

.prompt-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Group 3: App Layout */
.app-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Premium Text & Content Enhancements */
.premium-reading-area {
    line-height: 1.8;
    font-size: 1.15rem;
    color: var(--text-primary);
    position: relative;
    padding: 1.5rem;
}

.premium-reading-area p {
    margin-bottom: 1.25rem;
}

.bible-verse-highlight {
    background: rgba(251, 191, 36, 0.08);
    border-left: 4px solid var(--accent-gold);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px 12px 12px 4px;
    font-family: 'Inter', serif;
    font-style: italic;
    position: relative;
}

.bible-verse-highlight::before {
    content: '\f10d';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -10px;
    left: 10px;
    background: var(--secondary-bg);
    padding: 0 5px;
    color: var(--accent-gold);
    font-size: 1.2rem;
}

.ai-global-response-styled {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ai-global-response-styled h1,
.ai-global-response-styled h2,
.ai-global-response-styled h3 {
    color: var(--accent-gold);
    font-family: 'Outfit', sans-serif;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.ai-global-response-styled b,
.ai-global-response-styled strong {
    color: var(--accent-cyan);
    font-weight: 700;
}

/* Micro-animations and Global Beautification */
.premium-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(99, 102, 241, 0.1);
}

.serif-quote {
    font-family: 'Merriweather', 'Georgia', serif;
    font-style: italic;
    color: var(--accent-gold);
    border-left: 2px solid var(--accent-gold);
    padding-left: 1rem;
    margin: 1.5rem 0;
}

.illustrated-bg {
    position: relative;
    z-index: 1;
}

.illustrated-bg header::after {
    display: none;
}


/* Sidebar Sticky Column Wrapper */
.sidebar-sticky-column {
    position: sticky;
    top: 120px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* === MODERN PROFESSIONAL SIDEBAR === */
.sidebar {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    padding: 1.8rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    z-index: 0;
}

.sidebar h2 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.sidebar-menu {
    list-style: none;
    position: relative;
    z-index: 1;
}

.sidebar-menu li {
    margin-bottom: 0.75rem;
}

.sidebar-menu button {
    width: 100%;
    text-align: left;
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    color: var(--text-secondary);
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.sidebar-menu button i {
    font-size: 1.2rem;
    color: var(--accent-primary);
    transition: all 0.3s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
}

.sidebar-menu button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateX(8px);
}

.sidebar-menu button:hover i {
    transform: scale(1.2) rotate(10deg);
    background: var(--accent-primary);
    color: white;
}

.sidebar-menu button.active {
    background: var(--gradient-primary);
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4);
}

.sidebar-menu button.active i {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Shine effect on hover */
.sidebar-menu button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: translateY(-50%) skewX(-25deg);
    transition: 0.5s;
}

.sidebar-menu button:hover::before {
    left: 100%;
}

/* Sidebar Tooltip-style sub-text (opcional pero profesional) */
.sidebar-menu button::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--accent-gold);
    border-radius: 0 4px 4px 0;
    transition: height 0.3s ease;
}

.sidebar-menu button.active::after {
    height: 60%;
}

/* Main Content */
.main-content {
    background: var(--gradient-card);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

/* Section Titles */
.section-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.9rem 1.2rem;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    min-height: 400px;
    resize: vertical;
    line-height: 1.8;
    font-family: 'Georgia', serif;
}

/* Buttons */
.btn {
    padding: 0.9rem 1.8rem;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.5);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.6);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.6);
}

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.btn-block {
    width: 100%;
    display: flex;
    margin-bottom: 0.8rem;
}

/* Sermon List */
/* Sermon List - Modern Grid */
.sermon-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    /* Grid Inteligente */
    gap: 1.5rem;
    padding: 0.5rem;
}

.sermon-card {
    background: rgba(30, 41, 59, 0.4);
    /* Glassmorphism base */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.8rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: default;
    /* No pointer to entire card, actions have specific buttons */
    position: relative;
    overflow: hidden;
}

.sermon-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.sermon-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.5);
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(30, 41, 59, 0.6);
}

.sermon-card:hover::before {
    opacity: 1;
}

.sermon-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.sermon-card h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.sermon-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.8rem;
    background: var(--card-bg);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.sermon-preview {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sermon-actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    padding: 0.5rem 0.8rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.icon-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Tags Input */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.tag-remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.tag-remove:hover {
    opacity: 1;
}

/* HERO AI & TYPOGRAPHY */
.hero-ai h1 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 50%, #1e40af 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -3px;
    animation: fadeInTitle 1.5s ease-out;
}

@keyframes fadeInTitle {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
footer {
    margin-top: 5rem;
    padding: 3rem 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
}

.social-media {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.social-media img {
    width: 25px;
    height: 25px;
    transition: transform 0.3s ease;
}

.social-media a:hover img {
    transform: scale(1.2);
}

footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Hidden Class */
.hidden {
    display: none !important;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    nav ul {
        justify-content: center;
    }

    .main-content {
        padding: 1.5rem;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .brand-text h1 {
        font-size: 1.4rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .sermon-card {
        padding: 1rem;
    }
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Daily Widgets */
.daily-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.widget-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.widget-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-primary);
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.widget-icon {
    font-size: 1.8rem;
}

.widget-header h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.widget-content {
    min-height: 120px;
    margin-bottom: 1rem;
}

.verse-text,
.prayer-text,
.quote-text,
.reflection-text {
    color: var(--text-secondary);
    line-height: 1.8;
    font-style: italic;
    margin-bottom: 0.8rem;
}

.verse-ref {
    color: var(--accent-gold);
    font-weight: 600;
    text-align: right;
    margin: 0;
}

.quote-author {
    color: var(--accent-gold);
    font-weight: 600;
    text-align: right;
    font-size: 0.9rem;
    margin: 0;
}

.btn-widget {
    width: 100%;
    padding: 0.6rem;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-widget:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* AdSense Containers */
.ad-container {
    margin: 2rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
}

.ad-container::-webkit-scrollbar {
    height: 4px;
}

.ad-container::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
}

.ad-horizontal {
    min-height: 90px;
}

.ad-vertical {
    min-height: 250px;
}

.ad-square {
    min-height: 250px;
}

.ad-placeholder {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.8rem;
}

/* Platform Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--gradient-card);
    padding: 2.5rem 1.5rem;
    border-radius: 24px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent 70%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.03);
}

.stat-card i {
    font-size: 2.5rem;
    margin-bottom: 1.2rem;
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-val {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -1.5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}



.ad-sidebar {
    position: sticky;
    top: 140px;
    margin-top: 2rem;
}

/* AdSense Responsive */
@media (max-width: 768px) {
    .ad-horizontal {
        min-height: 50px;
    }

    .ad-placeholder {
        padding: 1rem;
        font-size: 0.8rem;
    }
}

/* Modal Overlay Styles */
.modal-overlay {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-overlay>div {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Timeline Event Styles */
.timeline-event {
    transition: all 0.3s ease;
}

.timeline-event:hover {
    transform: translateX(5px);
    border-left-color: var(--accent-gold);
}

/* Library Filter Buttons */
.library-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.filter-btn:not(.active):hover {
    background: var(--secondary-bg);
    border-color: var(--accent-primary);
}

/* Scrollbar Styles */
.modal-overlay>div::-webkit-scrollbar,
#timeline-container::-webkit-scrollbar,
#plans-list::-webkit-scrollbar {
    width: 8px;
}

.modal-overlay>div::-webkit-scrollbar-track,
#timeline-container::-webkit-scrollbar-track,
#plans-list::-webkit-scrollbar-track {
    background: var(--secondary-bg);
    border-radius: 4px;
}

.modal-overlay>div::-webkit-scrollbar-thumb,
#timeline-container::-webkit-scrollbar-thumb,
#plans-list::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-overlay>div {
        width: 95% !important;
        max-height: 95vh !important;
    }

    .library-filters {
        flex-direction: column;
    }

    .filter-btn {
        width: 100%;
    }
}

/* Preaching Mode Styles */
.preaching-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: black;
    color: white;
    z-index: 9999;
    padding: 2rem;
    overflow-y: auto;
    font-size: 1.5rem;
    /* Large readable text */
    line-height: 1.8;
}

.preaching-controls {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #333;
}

.preach-timer {
    position: fixed;
    top: 2rem;
    right: 2rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-gold);
    background: rgba(0, 0, 0, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: monospace;
}

.preaching-content {
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 100px;
}

/* Login Landing Styles - Premium Design */
.login-landing {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 1rem;
    /* Margen de seguridad para móviles */
    background: var(--primary-bg);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 40%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    overflow-y: auto;
    /* Permitir scroll si la pantalla es baja */
}

/* ========================================
   LOGIN LANDING & AUTH UI
   ======================================== */

.login-landing {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.2) 0%, var(--primary-bg) 100%);
    backdrop-filter: blur(20px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    background: var(--gradient-card);
    width: 100%;
    max-width: 450px;
    padding: 3rem 2.5rem;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    text-align: center;
    position: relative;
    /* Asegurar que no se pegue a los bordes en altura */
    margin-top: auto;
    margin-bottom: auto;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-logo {
    width: 70px;
    height: 70px;
    margin: 0 auto 1.5rem;
    display: block;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.login-card h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: white;
    letter-spacing: -0.5px;
}

.login-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Google Button */
.btn-google {
    background: white;
    color: #1f2937;
    width: 100%;
    height: 48px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0;
}

.btn-google:hover {
    background: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-google img {
    width: 20px;
    height: 20px;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    padding: 0 1rem;
}

/* Inputs */
.login-card .form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.login-card input {
    width: 100%;
    height: 46px;
    padding: 0 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: white;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.login-card input:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

/* Actions */
/* Responsive Login Overlay Fixes */
.login-landing {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    /* Ensure it's ALWAYS on top */
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    /* Changed from 'none' to handled by JS */
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    /* Allow scrolling on small screens */
    padding: 20px;
}

.login-card {
    background: var(--gradient-card);
    backdrop-filter: blur(25px);
    border: 1px solid var(--border-color);
    padding: 3rem 2rem;
    border-radius: 24px;
    width: 100%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.login-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    padding-bottom: 4px;
    z-index: 10;
}

.login-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: rotate(90deg);
}

@media (max-width: 480px) {
    .login-card {
        padding: 2.5rem 1.5rem;
        border-radius: 20px;
        height: auto;
        max-height: 90vh;
        width: 95%;
        max-width: 400px;
        margin: auto;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    }

    .login-landing {
        padding: 15px;
        align-items: center;
    }
}

.error-msg {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 15px;
    display: none;
    border: 1px solid rgba(255, 77, 77, 0.2);
    animation: shake 0.4s ease;
}

.error-msg.active {
    display: block;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Success Modal Animation */
@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Actions mobile gap fix */
.login-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.btn-block {
    width: 100%;
    height: 52px;
    /* Increased for better visibility on web */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
    border-radius: 14px;
}

.guest-link {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.guest-link a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.guest-link a:hover {
    color: var(--accent-primary);
}

.error-msg {
    min-height: 20px;
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: #ff4d4d;
    text-align: center;
}

/* AI Assistant Styles */
.ai-actions-bar {
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

.ai-actions-bar button {
    font-size: 0.8rem !important;
    padding: 6px 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.5);
    transition: all 0.2s;
}

.ai-actions-bar button:hover:not(:disabled) {
    background: var(--accent-primary) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* AI PREMIUM ANIMATIONS */
.ai-thinking-aura {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.5rem;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 50px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    overflow: hidden;
}

.ai-thinking-aura::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        left: 100%;
    }
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: pulse-glow 1.5s infinite ease-in-out;
}

@keyframes pulse-glow {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 10px 4px rgba(37, 99, 235, 0.3);
    }
}

/* CREDIT SYSTEM UI */
.credit-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: var(--accent-gold);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}


/* PRO TIER STYLES */
.pro-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
    position: relative;
}

.pro-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--gradient-gold);
    color: #000;
    padding: 2px 10px;
    font-size: 0.7rem;
    font-weight: 900;
    border-radius: 4px;
    transform: rotate(10deg);
}

/* TRANSLATION UTILS */
[data-i18n] {
    transition: opacity 0.3s ease;
}

.lang-switching {
    opacity: 0;
}

/* Light Theme Component Overrides */
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .card,
[data-theme="light"] .ai-search-hub,
[data-theme="light"] .modal-content {
    background: #ffffff !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05) !important;
    border-color: #e2e8f0 !important;
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3 {
    color: #0f172a !important;
}

[data-theme="light"] .ai-thinking-aura {
    background: rgba(37, 99, 235, 0.05);
    border-color: rgba(37, 99, 235, 0.15);
    color: #2563eb;
}

/* AI Engine Utilities */
.hidden {
    display: none !important;
}

.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* NOTIFICATION SYSTEM */
.notif-container {
    position: relative;
    margin-right: 1rem;
}

.notif-trigger {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    font-size: 1.1rem;
}

.notif-trigger i {
    pointer-events: none;
}

.notif-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-primary);
}

@keyframes badge-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
    }

    100% {
        transform: scale(1);
    }
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 800;
    border: 2px solid var(--primary-bg);
    animation: badge-pulse 2s infinite;
}

.notif-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 320px;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.notif-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.notif-header h4 {
    margin: 0;
    font-size: 0.95rem;
}

.notif-header button {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
}

.notif-mark-read-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    transition: all 0.2s;
    border: 1px solid transparent;
}

.notif-mark-read-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border-color: rgba(99, 102, 241, 0.2);
}

.notif-delete-btn {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.05);
    color: #ef4444;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
}

.notif-item:hover .notif-delete-btn {
    opacity: 1;
}

.notif-delete-btn:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.notif-list {
    max-height: 400px;
    overflow-y: auto;
}

.notif-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    transition: background 0.2s;
    cursor: default;
}

.notif-item.unread {
    background: rgba(37, 99, 235, 0.05);
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notif-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notif-content h5 {
    margin: 0 0 4px 0;
    font-size: 0.9rem;
}

.notif-content p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notif-content small {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-top: 5px;
}

.notif-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* NOTIF TOAST */
.notif-toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--gradient-card);
    border: 1px solid var(--accent-primary);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    transform: translateX(-120%);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    max-width: 400px;
}

.notif-toast.visible {
    transform: translateX(0);
}

/* STATISTICS DASHBOARD */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5), rgba(15, 23, 42, 0.5));
    border: 1px solid var(--border-color);
    padding: 2.5rem 1.5rem;
    border-radius: 24px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0.6;
}

.stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.stat-card i {
    font-size: 2.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.stat-val {
    font-size: 2.8rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
    font-family: 'Outfit', sans-serif;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* AI RESULTS PANEL PREMIUM */
#ai-results-panel {
    transition: all 0.5s ease;
    padding: 2rem 0;
}

.widget-card-ai {
    max-width: 900px;
    margin: 0 auto;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem;
    position: relative;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

.widget-card-ai::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
}

.results-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.results-close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
}

.widget-header-ai {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 2rem;
}

/* Sidebar Header Actions & Refined Mobile Layout */
.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-top-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.sidebar-main-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
}

.sidebar-quick-toggles {
    display: flex;
    gap: 0.6rem;
    flex-shrink: 0;
}

.sidebar-quick-toggles .drawer-icon-btn {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-quick-toggles .drawer-icon-btn:active {
    transform: scale(0.9);
    background: rgba(99, 102, 241, 0.1);
}

.sidebar-credit-banner {
    width: 100%;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(20, 27, 58, 0.8));
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.credit-info-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.credit-info-main i {
    font-size: 1.1rem;
    color: var(--accent-gold);
}

.credit-count-text {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.credit-timer-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
}

/* Hide header credit elements on mobile if they duplicate */
@media (max-width: 1024px) {
    .header-content .ai-status-zone {
        display: none !important;
    }
}

.btn-group-ai {
    display: flex;
    gap: 1.5rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Notification Permission Button */
.btn-enable-notif {
    width: 100%;
    padding: 0.8rem;
    background: rgba(34, 197, 94, 0.15);
    border: 1px dashed #22c55e;
    color: #4ade80;
    border-radius: 8px;
    margin-top: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-enable-notif:hover {
    background: rgba(34, 197, 94, 0.25);
    transform: translateY(-2px);
}

/* Ensure widgets have equal height */
.widget-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Stretch to fill grid cell */
}

.widget-content {
    flex-grow: 1;
    /* Push button to bottom */
}

/* ========================================
   BIBLIOTECA DIGITAL - PROFESSIONAL UI
   ======================================== */

.library-stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card-mini {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    transition: all 0.3s ease;
}

.stat-card-mini:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.icon-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.icon-purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.icon-green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.stat-content h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0;
}

.stat-content .stat-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.stat-content .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.library-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.library-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: rgba(30, 41, 59, 0.9);
}

.library-card-header {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.library-card-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.library-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.library-card-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.library-card-author i {
    color: var(--accent-gold);
    margin-right: 4px;
}

.library-card-body {
    margin-bottom: 1.5rem;
}

.library-card-excerpt {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.library-card-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.library-card-actions .btn {
    padding: 0.6rem 0.4rem;
    font-size: 0.75rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.library-announcement-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: 28px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2.5rem;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    min-height: 280px;
    box-shadow: 0 20px 50px rgba(99, 102, 241, 0.4);
    margin-bottom: 2rem;
}

.library-announcement-card::before {
    content: '✍️';
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 12rem;
    opacity: 0.1;
    transform: rotate(15deg);
    pointer-events: none;
}

.library-announcement-icon {
    font-size: 6rem;
    line-height: 1;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
    z-index: 1;
}

.library-announcement-content {
    flex: 1;
    z-index: 2;
}

.library-announcement-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: white;
    display: inline-block;
    margin-bottom: 1rem;
    backdrop-filter: blur(5px);
}

.library-announcement-title {
    color: white;
    margin: 0 0 1rem 0;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 900;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.library-announcement-text {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    max-width: 700px;
    font-size: 1.15rem;
    line-height: 1.6;
}

.library-announcement-actions {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .library-announcement-card {
        flex-direction: column;
        text-align: center;
        padding: 2.5rem 1.5rem;
        gap: 1.5rem;
    }

    .library-announcement-icon {
        font-size: 4rem;
    }

    .library-announcement-actions {
        justify-content: center;
    }
}

.library-card-actions .btn i {
    font-size: 0.8rem;
}

/* Modal for library content (Reader) */
.library-reader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.library-reader-container {
    background: var(--secondary-bg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-glow);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.library-reader-header {
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.library-reader-content {
    padding: 2.5rem;
    overflow-y: auto;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-primary);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
}

.library-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.2rem;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    align-items: center;
}

.search-input-wrapper {
    flex: 2;
    min-width: 250px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.lib-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.8rem !important;
    border-radius: 12px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--border-color) !important;
    color: white !important;
}

.filter-select-wrapper {
    flex: 1;
    min-width: 180px;
}

.lib-select {
    width: 100%;
    padding: 0.8rem !important;
    border-radius: 12px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid var(--border-color) !important;
    color: white !important;
    cursor: pointer;
}

.view-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lib-search-btn {
    padding: 0.8rem 1.5rem !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
}

@media (max-width: 768px) {
    .library-card-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-btn-share {
        grid-column: span 2;
    }

    .library-toolbar {
        flex-direction: column;
        padding: 1rem;
    }

    .search-input-wrapper,
    .filter-select-wrapper,
    .view-controls,
    .lib-search-btn {
        width: 100% !important;
    }
}

/* Shared Spinner Animation */
.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-primary, #8b5cf6);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Header Adjustments for Credits */
@media (max-width: 968px) {
    .header-actions {
        display: flex !important;
        align-items: center;
        gap: 8px;
        margin-right: 5px;
    }

    .ai-status-zone {
        padding: 4px 10px;
        gap: 6px;
    }

    .reset-timer-header {
        margin-left: 2px;
        padding-left: 6px;
        font-size: 0.7rem;
        gap: 3px;
    }

    .credit-badge {
        gap: 4px;
    }

    .credit-badge i {
        font-size: 0.8rem;
    }

    .credit-badge-val {
        font-size: 0.8rem;
    }

    .header-offline-btn {
        display: none;
    }
}

/* === AD REWARD MODAL === */
.ad-reward-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Outfit', sans-serif;
}

.ad-reward-container {
    width: 90%;
    max-width: 800px;
    height: 75vh;
    background: #1e293b;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 50px rgba(251, 191, 36, 0.2);
    display: flex;
    flex-direction: column;
}

.ad-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-content-sim {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.1), transparent);
}

.ad-footer {
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
}

.ad-progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.ad-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 1s linear;
}

.ad-timer-badge {
    background: var(--accent-gold);
    color: #000;
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
}

.ad-status-msg {
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.ad-reward-btn {
    opacity: 0.5;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    padding: 1rem;
    font-size: 1.2rem;
    border-radius: 12px;
}

.ad-reward-btn.ready {
    opacity: 1;
    pointer-events: auto;
    background: var(--success);
    color: white;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(34, 197, 94, 0.3);
}

.ad-reward-btn.ready:hover {
    transform: scale(1.02);
}

.simulated-ad-image {
    width: 100%;
    height: 300px;
    background: #0f172a;
    border-radius: 16px;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background-size: cover;
    background-position: center;
}

/* Shiny/Glowing Button for Ads */
.btn-glow-ad {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
    position: relative;
    overflow: hidden;
    animation: glowPulse 2s infinite;
    font-weight: 800 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.btn-glow-ad::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -100%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: rotate(45deg);
    animation: shineSweep 3s infinite;
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.4);
    }

    50% {
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.8);
    }

    100% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.4);
    }
}

@keyframes shineSweep {
    0% {
        left: -100%;
    }

    20% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

/* Custom Referral UI */
.custom-ref-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    padding: 1.2rem;
    border-radius: 16px;
    margin-top: 1.5rem;
    text-align: left;
}

.custom-ref-box input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: white;
    padding: 0.6rem;
    border-radius: 8px;
    width: 100%;
    margin-bottom: 0.8rem;
}

.rules-list {
    text-align: left;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2);
    padding: 1.2rem;
    border-radius: 12px;
    margin: 1rem 0;
    list-style: none;
}

.rules-list li {
    margin-bottom: 0.6rem;
    display: flex;
    gap: 10px;
    line-height: 1.4;
}

.rules-list li i {
    color: var(--accent-gold);
    margin-top: 3px;
}