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

:root {
    /* Premium Dark Theme - Professional & Elegant */
    --primary-color: #0f0f23;
    --secondary-color: #16213e;
    --accent-gold: #c9b037;
    --accent-silver: #8b949e;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --dark-bg: #0a0a15;
    --light-bg: #1a1a2e;
    --card-bg: #1f1f2e;
    --text-dark: #ecf0f1;
    --text-light: #95a5a6;
    --border-subtle: rgba(201, 176, 55, 0.15);
    --shadow-premium: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0a0a15 0%, #16213e 100%);
    min-height: 100vh;
    color: var(--text-dark);
    letter-spacing: 0.01em;
}

/* Page Management */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Auth Page */
.auth-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(10px);
}

.auth-container h1 {
    text-align: center;
    color: var(--accent-gold);
    font-size: 2.2em;
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 30px;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: var(--accent-gold);
    color: var(--dark-bg);
    border-color: var(--accent-gold);
    font-weight: 600;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 20px;
    color: var(--text-dark);
}

.auth-form input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 15px;
    background: var(--light-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    font-size: 0.95em;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(201, 176, 55, 0.1);
}

.auth-form button {
    width: 100%;
    padding: 14px;
    background: var(--accent-gold);
    color: var(--dark-bg);
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.auth-form button:hover {
    background: #d4af37;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 176, 55, 0.3);
}

/* ── Google Sign-In divider & button ───────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--text-light);
    font-size: 0.9em;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.15);
}
/* Centre the rendered Google button */
.g_id_signin {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.info-text {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9em;
    margin-top: 15px;
}

.message {
    margin-top: 20px;
    padding: 14px;
    border-radius: 6px;
    border: 1px solid transparent;
    text-align: center;
    font-weight: 500;
    font-size: 0.9em;
    display: none;
}

.message.success {
    background: rgba(46, 204, 113, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
    display: block;
}

.message.error {
    background: rgba(231, 76, 60, 0.1);
    border-color: var(--danger-color);
    color: var(--danger-color);
    display: block;
}

.message.info {
    background: rgba(201, 176, 55, 0.1);
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    display: block;
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    padding: 18px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid var(--border-subtle);
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: left 0.3s ease;
}

.place-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.place-selector label {
    font-size: 0.95em;
    font-weight: 600;
    color: var(--accent-gold);
    white-space: nowrap;
}

.place-selector select {
    background: var(--light-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 8px 14px;
    color: var(--text-dark);
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    min-width: 200px;
    transition: all 0.2s ease;
}

.place-selector select:hover {
    border-color: var(--accent-gold);
    background: var(--dark-bg);
}

.place-selector select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(201, 176, 55, 0.1);
}

.place-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.place-btn {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.8em;
    cursor: pointer;
}

.place-btn:hover {
    border-color: var(--accent-gold);
    background: rgba(201, 176, 55, 0.08);
}

.place-btn.danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.place-btn.danger:hover {
    background: rgba(233, 69, 96, 0.15);
}

body.sidebar-condensed .navbar {
    left: 70px;
}

.menu-toggle {
    background: transparent;
    color: var(--accent-gold);
    border: 1px solid var(--border-subtle);
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 1.3em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-toggle:hover {
    background: var(--light-bg);
    border-color: var(--accent-gold);
}

.nav-brand {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--accent-gold);
    letter-spacing: -0.01em;
}

.nav-menu {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-left: auto;
}

.nav-btn {
    padding: 10px 18px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--light-bg);
    border-color: var(--border-subtle);
}

.nav-btn.active {
    background: var(--accent-gold);
    color: var(--dark-bg);
    font-weight: 600;
}

.nav-btn.logout {
    background: transparent;
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.nav-btn.logout:hover {
    background: var(--danger-color);
    color: var(--text-dark);
}

.nav-btn.clear-cache {
    background: transparent;
    color: var(--accent-silver);
    border: 1px solid var(--accent-silver);
    font-size: 0.85em;
}

.nav-btn.clear-cache:hover {
    background: var(--accent-silver);
    color: var(--dark-bg);
}

.user-info {
    color: var(--text-dark);
    font-weight: 600;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--card-bg);
    border-right: 1px solid var(--border-subtle);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.4);
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}

.sidebar.collapsed {
    transform: translateX(-280px);
}

/* Condensed Sidebar (Icons Only) */
.sidebar.condensed {
    width: 70px;
}

.sidebar.condensed .menu-text,
.sidebar.condensed .menu-arrow,
.sidebar.condensed .brand-text {
    display: none;
}

.sidebar.condensed .menu-btn {
    justify-content: center;
    padding: 15px 10px;
}

.sidebar.condensed .menu-icon {
    margin: 0;
}

.sidebar.condensed .submenu {
    display: none !important;
}

.sidebar.condensed .sidebar-brand-btn {
    justify-content: center;
}

.sidebar-header {
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--dark-bg);
}

.sidebar-brand-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    padding: 12px 18px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: flex-start;
}

.sidebar-brand-btn:hover {
    background: rgba(201, 176, 55, 0.08);
    border-color: var(--accent-gold);
}

.sidebar-brand-btn .menu-icon {
    font-size: 1.3em;
    color: var(--accent-gold);
    min-width: 20px;
}

.sidebar-brand-btn .brand-text {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--accent-gold);
    letter-spacing: -0.01em;
}

.sidebar-nav {
    padding: 10px 0;
}

.menu-item {
    border-bottom: 1px solid rgba(201, 176, 55, 0.08);
}

.menu-btn {
    width: 100%;
    padding: 15px 20px;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 1em;
    color: var(--text-dark);
    transition: all 0.2s;
    text-align: left;
}

.menu-btn:hover {
    background: rgba(201, 176, 55, 0.08);
    border-left: 3px solid var(--accent-gold);
    padding-left: 17px;
}

.menu-btn.active {
    background: rgba(201, 176, 55, 0.12);
    color: var(--accent-gold);
    border-left: 3px solid var(--accent-gold);
    padding-left: 17px;
    font-weight: 600;
}

.menu-icon {
    font-size: 1.3em;
    width: 25px;
    text-align: center;
}

.menu-text {
    flex: 1;
    font-weight: 600;
}

.menu-arrow {
    font-size: 1.2em;
    transition: transform 0.3s;
}

.menu-btn.expanded .menu-arrow {
    transform: rotate(90deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    background: rgba(15, 15, 35, 0.5);
    transition: max-height 0.3s ease;
}

.submenu.active {
    max-height: 500px;
}

.submenu a {
    display: block;
    padding: 12px 20px 12px 60px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95em;
    transition: all 0.2s;
    border-left: 2px solid transparent;
}

.submenu a:hover {
    background: rgba(201, 176, 55, 0.08);
    color: var(--accent-gold);
    padding-left: 65px;
    border-left-color: var(--accent-gold);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    margin-top: 70px;
    padding: 30px;
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - 70px);
}

.main-content.expanded {
    margin-left: 0;
}

/* Adjust main content when sidebar is condensed */
body.sidebar-condensed .main-content {
    margin-left: 70px;
}

/* ── Sidebar overlay backdrop (hidden by default) ── */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1005;
}

.sidebar-backdrop.active {
    display: block;
}

/* ── Mobile hamburger button (hidden on desktop) ── */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-dark);
    font-size: 1.3em;
    cursor: pointer;
    padding: 6px 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* ── Responsive Sidebar (mobile / tablet) ── */
@media (max-width: 768px) {
    /* Sidebar slides in as overlay — hidden off-screen by default */
    .sidebar {
        transform: translateX(-280px);
        z-index: 1010;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    /* Navbar: full width on mobile */
    .navbar {
        left: 0 !important;
        padding: 10px 14px;
    }

    body.sidebar-condensed .navbar {
        left: 0 !important;
    }

    /* Main content: full width, no left margin */
    .main-content {
        margin-left: 0 !important;
        padding: 16px;
    }

    body.sidebar-condensed .main-content {
        margin-left: 0 !important;
    }

    /* Show hamburger button on mobile */
    .mobile-menu-btn {
        display: flex;
    }

    /* Compact place selector: hide label + action buttons */
    .place-selector label {
        display: none;
    }

    .place-selector select {
        min-width: 110px;
        max-width: 160px;
        font-size: 0.85em;
    }

    .place-actions {
        display: none;
    }

    /* Compact right-side of navbar */
    .user-info {
        display: none;
    }

    .nav-menu {
        gap: 6px;
    }

    .nav-btn {
        padding: 6px 10px;
        font-size: 0.82em;
    }
}

.user-info {
    padding: 10px 15px;
    background: rgba(201, 176, 55, 0.08);
    border-radius: 4px;
    font-weight: 500;
    color: var(--accent-gold);
    border: 1px solid var(--border-subtle);
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: 15px auto;
    padding: 0 15px;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

h2 {
    color: var(--accent-gold);
    margin-bottom: 12px;
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.config-panel {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-subtle);
}

/* Configuration Header - Name at Top */
.config-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-subtle);
}

.config-header .form-group {
    margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NEW LAYOUT: Full-width Preview + Collapsible Settings Panels
═══════════════════════════════════════════════════════════════════════════ */

/* Preview Section (Full Width) */
.config-preview-section {
    margin-bottom: 15px;
}

/* Controls Row: Toggle buttons + Action buttons */
.config-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 15px;
}

.settings-toggle-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.settings-toggle-btn {
    padding: 10px 18px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.settings-toggle-btn:hover {
    background: rgba(201, 176, 55, 0.08);
    border-color: var(--accent-gold);
}

.settings-toggle-btn.active {
    background: var(--accent-gold);
    color: var(--dark-bg);
    border-color: var(--accent-gold);
    font-weight: 600;
}

/* Settings Panels Container */
.config-settings-panels {
    margin-top: 12px;
}

.settings-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
}

.settings-panel h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--accent-gold);
    font-size: 1em;
    font-weight: 600;
}

/* Saved Configs Toggle Buttons */
.saved-configs-toggle-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.configs-toggle-btn {
    padding: 10px 18px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.configs-toggle-btn:hover {
    background: rgba(201, 176, 55, 0.08);
    border-color: var(--accent-gold);
}

.configs-toggle-btn.active {
    background: var(--accent-gold);
    color: var(--dark-bg);
    border-color: var(--accent-gold);
    font-weight: 600;
}

.configs-panel {
    margin-bottom: 15px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   OLD LAYOUT: Kept for backward compatibility and responsive
═══════════════════════════════════════════════════════════════════════════ */

/* Main Layout: Preview Left, Settings Right */
.config-main-layout {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr; /* Preview, Text Settings, Visual Effects */
    gap: 20px;
    margin-bottom: 15px;
}

.preview-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.preview-section {
    flex: 1;
}

.preview-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.preview-buttons button {
    padding: 10px 16px;
    font-size: 0.9em;
}

/* Responsive adjustments for new layout */
@media (max-width: 768px) {
    .config-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .settings-toggle-buttons,
    .saved-configs-toggle-buttons {
        width: 100%;
    }
    
    .settings-toggle-btn,
    .configs-toggle-btn {
        flex: 1;
        min-width: 0;
    }
    
    .preview-buttons {
        width: 100%;
    }
    
    .preview-buttons button {
        flex: 1;
        min-width: 0;
    }
}

.settings-column {
    min-width: 0;
}

.settings-column h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--accent-gold);
    font-size: 1em;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
}

.settings-column .form-group {
    margin-bottom: 8px;
}

.settings-column label {
    font-size: 0.85em;
    margin-bottom: 4px;
}

.settings-column input,
.settings-column select,
.settings-column textarea {
    font-size: 0.85em;
    padding: 6px;
}

/* Background Section Below */
.config-background-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-subtle);
}

.config-background-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--accent-gold);
    font-size: 1.1em;
    font-weight: 600;
}

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

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    font-size: 1em;
    transition: all 0.2s;
    background: var(--dark-bg);
    color: var(--text-dark);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(201, 176, 55, 0.15);
}

.form-group input[type="color"] {
    width: 80px;
    height: 50px;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    cursor: pointer;
    background: var(--dark-bg);
}

.form-group input[type="range"] {
    width: calc(100% - 60px);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Font dropdown preview */
#config-font {
    font-size: 1.1em;
}

#config-font option {
    padding: 8px;
    font-size: 1em;
}

/* Individual font styles for dropdown options */
#config-font option[value*="Arial"] { font-family: Arial, sans-serif; }
#config-font option[value*="Times New Roman"] { font-family: 'Times New Roman', Times, serif; }
#config-font option[value*="Georgia"] { font-family: Georgia, serif; }
#config-font option[value*="Verdana"] { font-family: Verdana, sans-serif; }
#config-font option[value*="Tahoma"] { font-family: Tahoma, sans-serif; }
#config-font option[value*="Trebuchet"] { font-family: 'Trebuchet MS', sans-serif; }
#config-font option[value*="Comic Sans"] { font-family: 'Comic Sans MS', cursive; }
#config-font option[value*="Impact"] { font-family: Impact, sans-serif; }
#config-font option[value*="Courier"] { font-family: 'Courier New', monospace; }
#config-font option[value*="Roboto"] { font-family: 'Roboto', sans-serif; }
#config-font option[value*="Open Sans"] { font-family: 'Open Sans', sans-serif; }
#config-font option[value*="Lato"] { font-family: 'Lato', sans-serif; }
#config-font option[value*="Montserrat"] { font-family: 'Montserrat', sans-serif; }
#config-font option[value*="Poppins"] { font-family: 'Poppins', sans-serif; }
#config-font option[value*="Raleway"] { font-family: 'Raleway', sans-serif; }
#config-font option[value*="Ubuntu"] { font-family: 'Ubuntu', sans-serif; }
#config-font option[value*="PT Sans"] { font-family: 'PT Sans', sans-serif; }
#config-font option[value*="Nunito"] { font-family: 'Nunito', sans-serif; }
#config-font option[value*="Playfair"] { font-family: 'Playfair Display', serif; }
#config-font option[value*="Merriweather"] { font-family: 'Merriweather', serif; }
#config-font option[value*="Cinzel"] { font-family: 'Cinzel', serif; }
#config-font option[value*="Abril"] { font-family: 'Abril Fatface', serif; }
#config-font option[value*="Bebas"] { font-family: 'Bebas Neue', sans-serif; }
#config-font option[value*="Oswald"] { font-family: 'Oswald', sans-serif; }
#config-font option[value*="Anton"] { font-family: 'Anton', sans-serif; }
#config-font option[value*="Righteous"] { font-family: 'Righteous', sans-serif; }
#config-font option[value*="Lobster"] { font-family: 'Lobster', cursive; }
#config-font option[value*="Pacifico"] { font-family: 'Pacifico', cursive; }
#config-font option[value*="Dancing"] { font-family: 'Dancing Script', cursive; }
#config-font option[value*="Great Vibes"] { font-family: 'Great Vibes', cursive; }
#config-font option[value*="Satisfy"] { font-family: 'Satisfy', cursive; }
#config-font option[value*="Indie"] { font-family: 'Indie Flower', cursive; }
#config-font option[value*="Shadows"] { font-family: 'Shadows Into Light', cursive; }
#config-font option[value*="Permanent"] { font-family: 'Permanent Marker', cursive; }

/* Custom Dropdown for Text Effects */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    background: var(--dark-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    color: var(--text-dark);
}

.custom-select::after {
    content: '▼';
    font-size: 0.7em;
    opacity: 0.6;
    margin-left: 10px;
}

.custom-select:hover {
    border-color: var(--accent-gold);
}

.custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    color: var(--text-dark);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    margin-top: 4px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-premium);
}

.custom-select-dropdown.active {
    display: block;
}

.custom-option {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.85em;
    transition: background 0.2s;
    color: var(--text-dark);
}

.custom-option:hover {
    background: rgba(201, 176, 55, 0.12);
}

.custom-option.selected {
    background: rgba(201, 176, 55, 0.2);
    color: var(--accent-gold);
    font-weight: 600;
}

/* Effect Preview Styles */
.effect-preview {
    display: inline-block;
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
}

.effect-preview[data-effect="none"] {
    font-weight: normal;
    color: #333;
}

.effect-preview[data-effect="shadow"] {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8),
                 3px 3px 6px rgba(0, 0, 0, 0.6);
    color: #333;
}

.effect-preview[data-effect="outline"] {
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000,
                 -1px 1px 0 #000, 1px 1px 0 #000,
                 -2px 0 0 #000, 2px 0 0 #000,
                 0 -2px 0 #000, 0 2px 0 #000;
    color: #ffcc00;
}

.effect-preview[data-effect="reflection"] {
    color: #667eea;
    text-shadow: 0 0 10px #667eea,
                 0 0 20px #667eea,
                 0 0 30px #667eea;
}

.effect-preview[data-effect="emboss"] {
    color: #888;
    text-shadow: -1px -1px 1px rgba(255, 255, 255, 0.8),
                 1px 1px 2px rgba(0, 0, 0, 0.9);
}

.effect-preview[data-effect="engrave"] {
    color: #666;
    text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.8),
                 -1px -1px 2px rgba(0, 0, 0, 0.9);
}

.effect-preview[data-effect="gradient"] {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.effect-preview[data-effect="glow"] {
    text-shadow: 0 0 5px #667eea, 
                 0 0 10px #667eea, 
                 0 0 15px #667eea,
                 0 0 20px #667eea;
    color: #667eea;
}

.effect-preview[data-effect="neon"] {
    color: #ff00de;
    text-shadow: 0 0 5px #ff00de,
                 0 0 10px #ff00de,
                 0 0 20px #ff00de,
                 0 0 30px #ff00de;
}

.effect-preview[data-effect="rainbow"] {
    background: linear-gradient(90deg, 
        #ff0000, #ff7f00, #ffff00, #00ff00, 
        #0000ff, #9400d3);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-shift 3s linear infinite;
}

.effect-preview[data-effect="fire"] {
    background: linear-gradient(180deg, #ff0000, #ff7f00, #ffff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.effect-preview[data-effect="glitter"] {
    color: #d4af37;
    text-shadow: 0 0 5px #ffd700, 
                 2px 2px 10px #ffd700, 
                 -2px -2px 10px #ffd700,
                 2px -2px 10px #ffd700,
                 -2px 2px 10px #ffd700;
    animation: glitter-sparkle 1s infinite;
}

.effect-preview[data-effect="pulse"] {
    color: #764ba2;
    text-shadow: 0 0 10px #764ba2, 
                 0 0 15px #764ba2,
                 0 0 20px #764ba2;
    animation: pulse-scale 1s ease-in-out infinite;
}

.effect-preview[data-effect="wave"] {
    color: #2196F3;
    display: inline-block;
    animation: wave-text 2s ease-in-out infinite;
}

.effect-preview[data-effect="arc"] {
    color: #FF5722;
    display: inline-block;
    transform: perspective(100px) rotateX(-5deg);
}

.effect-preview[data-effect="3d-extrude"] {
    color: #4CAF50;
    text-shadow: 1px 1px 0 #3d8b40,
                 2px 2px 0 #2e7030,
                 3px 3px 0 #1f5420,
                 4px 4px 5px rgba(0, 0, 0, 0.5);
}

.effect-preview[data-effect="chrome"] {
    background: linear-gradient(180deg, #e8e8e8 0%, #666 40%, #e8e8e8 50%, #666 60%, #e8e8e8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.effect-preview[data-effect="bounce"] {
    color: #E91E63;
    display: inline-block;
    animation: bounce-text 1s ease-in-out infinite;
}

.effect-preview[data-effect="rotate"] {
    color: #9C27B0;
    display: inline-block;
    animation: rotate-text 3s linear infinite;
}

.effect-preview[data-effect="zoom"] {
    color: #FF9800;
    display: inline-block;
    animation: zoom-text 1.5s ease-in-out infinite;
}

.effect-preview[data-effect="float"] {
    color: #00BCD4;
    display: inline-block;
    animation: float-text 3s ease-in-out infinite;
}

.effect-preview[data-effect="spiral"] {
    color: #673AB7;
    display: inline-block;
    animation: spiral-text 4s ease-in-out infinite;
}

/* Animation keyframes for preview effects */
@keyframes wave-text {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-3px); }
    75% { transform: translateY(3px); }
}

@keyframes bounce-text {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes rotate-text {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes zoom-text {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes float-text {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes spiral-text {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.1); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(0.9); }
    100% { transform: rotate(360deg) scale(1); }
}

.effect-preview[data-effect="fade-in-out"] {
    color: #9C27B0;
    display: inline-block;
    animation: fade-preview 2s ease-in-out infinite;
}

.effect-preview[data-effect="fly-in"] {
    color: #3F51B5;
    display: inline-block;
    animation: fly-in-preview 2s ease-out infinite;
}

.effect-preview[data-effect="scroll"] {
    color: #FF5722;
    display: inline-block;
    animation: scroll-preview 3s linear infinite;
}

.effect-preview[data-effect="slide-left"] {
    color: #4CAF50;
    display: inline-block;
    animation: slide-left-preview 2s ease-in-out infinite;
}

.effect-preview[data-effect="slide-right"] {
    color: #00BCD4;
    display: inline-block;
    animation: slide-right-preview 2s ease-in-out infinite;
}

.effect-preview[data-effect="bounce-in"] {
    color: #F44336;
    display: inline-block;
    animation: bounce-in-preview 1.5s ease-out infinite;
}

.effect-preview[data-effect="elastic"] {
    color: #FF9800;
    display: inline-block;
    animation: elastic-preview 2s ease-in-out infinite;
}

.effect-preview[data-effect="swing"] {
    color: #795548;
    display: inline-block;
    animation: swing-preview 1.5s ease-in-out infinite;
}

/* Preview animation keyframes */
@keyframes fade-preview {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes fly-in-preview {
    0% { transform: translateY(-6px) scale(0.8); opacity: 0.5; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes scroll-preview {
    0% { transform: translateX(10px); }
    100% { transform: translateX(-10px); }
}

@keyframes slide-left-preview {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-10px); }
}

@keyframes slide-right-preview {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(10px); }
}

@keyframes bounce-in-preview {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes elastic-preview {
    0%, 100% { transform: scaleX(1); }
    25% { transform: scaleX(1.15); }
    50% { transform: scaleX(0.9); }
    75% { transform: scaleX(1.05); }
}

@keyframes swing-preview {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

.background-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.bg-tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    color: var(--text-dark);
}

.bg-tab-btn.active {
    background: var(--accent-gold);
    color: var(--dark-bg);
    border-color: var(--accent-gold);
    font-weight: 600;
}

.bg-tab-content {
    display: none;
}

.bg-tab-content.active {
    display: block;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: var(--dark-bg);
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.media-grid .empty-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 1.1em;
}

.media-item {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid var(--border-subtle);
}

.media-item:hover {
    transform: scale(1.05);
    border-color: var(--accent-gold);
    box-shadow: 0 4px 12px rgba(201, 176, 55, 0.3);
}

.media-item.selected {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(201, 176, 55, 0.2);
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 1em;
    display: none;
}

.media-item:hover .delete-btn {
    display: block;
}

.upload-area {
    text-align: center;
    padding: 20px;
    margin-bottom: 20px;
}

.upload-area button {
    padding: 15px 30px;
    background: var(--accent-gold);
    color: var(--dark-bg);
    border: none;
    border-radius: 4px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area button:hover {
    background: #d4af37;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(201, 176, 55, 0.4);
}

.color-picker-section {
    text-align: center;
    padding: 40px;
}

.color-picker-section label {
    display: block;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.color-picker-section input[type="color"] {
    width: 200px;
    height: 100px;
    border: 2px solid var(--accent-gold);
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 20px;
    background: var(--dark-bg);
}

.color-picker-section button {
    padding: 12px 30px;
    background: var(--accent-gold);
    color: var(--dark-bg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s;
}

.color-picker-section button:hover {
    background: #d4af37;
    transform: translateY(-1px);
}

.preview-section {
    margin: 0;
    padding: 15px;
    background: var(--dark-bg);
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
}

.preview-section h3 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--accent-gold);
    font-size: 1.1em;
    font-weight: 600;
}

.preview-container {
    position: relative;
    width: 100%;
    height: 450px; /* Reduced for better fit on 1920x1080 */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.preview-container video,
.preview-container img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.preview-message {
    position: relative;
    z-index: 10;
    color: white;
    font-size: 48px;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    white-space: pre-wrap;
}

.preview-message.text-justify {
    text-align: justify;
    text-justify: inter-word;
    max-width: 85%;
    line-height: 1.6;
    margin: 0 auto;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent-gold);
    color: var(--dark-bg);
}

.btn-primary:hover {
    background: #d4af37;
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: rgba(201, 176, 55, 0.08);
    border-color: var(--accent-gold);
}

.saved-configs {
    margin-top: 30px;
}

/* ── Configure section layout: saved list first, form below ── */
#configure-section > .container {
    display: flex;
    flex-direction: column;
}
#configure-section > .container > h2 {
    order: 0;
}
#configure-section .saved-configs {
    order: 1;
    margin-top: 0;
}
#configure-section .config-panel {
    order: 2;
    margin-top: 20px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 20px;
}
#new-config-form-panel.form-hidden {
    display: none;
}

/* Saved configs section header */
.saved-configs-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.saved-configs-section-header h3 {
    margin: 0;
    color: var(--accent-gold);
    font-weight: 600;
}
.saved-configs-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.config-place-filter {
    background: var(--light-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 6px 10px;
    color: var(--text-dark);
    font-size: 0.85em;
    cursor: pointer;
    min-width: 130px;
}
.config-place-filter:focus {
    outline: none;
    border-color: var(--accent-gold);
}
.btn-new-config {
    background: var(--accent-gold);
    color: var(--dark-bg);
    border: none;
    border-radius: 4px;
    padding: 7px 14px;
    font-size: 0.85em;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.btn-new-config:hover {
    opacity: 0.85;
}

/* Per-card place assign row */
.card-place-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.card-place-row label {
    font-size: 0.78em;
    color: #888;
    white-space: nowrap;
}
.card-place-select {
    flex: 1;
    background: var(--light-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 4px 8px;
    color: var(--text-dark);
    font-size: 0.8em;
    cursor: pointer;
}
.btn-assign-place {
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-dark);
    padding: 4px 10px;
    font-size: 0.78em;
    cursor: pointer;
    white-space: nowrap;
}
.btn-assign-place:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

/* Place badge on config cards */
.config-place-badge {
    display: inline-block;
    font-size: 0.72em;
    color: #80c8ff;
    background: rgba(128, 200, 255, 0.10);
    border: 1px solid rgba(128, 200, 255, 0.25);
    border-radius: 4px;
    padding: 2px 7px;
    margin-left: 4px;
    vertical-align: middle;
}

/* Own config vs shared visual grouping */
.config-group-label {
    grid-column: 1 / -1;
    font-size: 0.8em;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4px;
}

/* Playlist Builder Panel - Collapsible */
.playlist-builder-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.playlist-builder-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.playlist-name-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    background: var(--dark-bg);
    color: var(--text-dark);
    font-size: 0.95em;
}

/* Filter Buttons */
.configs-filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.filter-btn {
    padding: 10px 18px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-dark);
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn:hover {
    background: rgba(201, 176, 55, 0.08);
    border-color: var(--accent-gold);
}

.filter-btn.active {
    background: var(--accent-gold);
    color: var(--dark-bg);
    border-color: var(--accent-gold);
    font-weight: 600;
}

.playlist-controls {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid var(--border-subtle);
}

.playlist-controls h3 {
    color: var(--accent-gold);
    margin-bottom: 8px;
    font-weight: 600;
}

.playlist-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.playlist-actions label {
    color: var(--text-dark);
    font-weight: 600;
}

.playlist-actions input {
    width: 90px;
    padding: 8px;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    background: var(--dark-bg);
    color: var(--text-dark);
}

.playlist-order {
    margin-top: 12px;
    color: var(--text-light);
    font-size: 0.95em;
}

.playlist-select-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.playlist-select-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
    font-weight: 600;
}

.playlist-select-row .info-text {
    margin: 0;
}

.playlist-order-badge {
    background: var(--accent-gold);
    color: var(--dark-bg);
    font-size: 0.8em;
    font-weight: 700;
    border-radius: 999px;
    padding: 4px 10px;
}

.saved-configs h3 {
    color: var(--accent-gold);
    margin-bottom: 15px;
    font-weight: 600;
}

.configs-list,
.display-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-subtle);
}

.config-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s;
}

.config-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
    border-color: var(--accent-gold);
}

.config-card h4 {
    margin-bottom: 10px;
    color: var(--accent-gold);
    font-weight: 600;
}

.config-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.config-card-header h4 {
    margin-bottom: 0;
}

.config-type-badge {
    background: rgba(201, 176, 55, 0.12);
    color: var(--accent-gold);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8em;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid var(--border-subtle);
}

.card-duration-badge {
    background: rgba(0, 0, 0, 0.12);
    color: var(--text-light);
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 0.75em;
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.detected-duration-hint {
    font-size: 0.85em;
    color: #64b5f6;
    margin-bottom: 6px;
    min-height: 1.2em;
}

.playlist-item-duration-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.dur-toggle-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.88em;
    color: var(--text-light);
    cursor: pointer;
    white-space: nowrap;
}

.playlist-item-duration-row input[type="number"] {
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-subtle);
    background: var(--dark-bg);
    color: var(--text-dark);
    font-size: 0.88em;
}

.config-card p {
    color: var(--text-light);
    margin-bottom: 15px;
    white-space: pre-wrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.config-card .card-actions {
    display: flex;
    gap: 10px;
}

.config-card button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-edit {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-subtle);
}

.btn-edit:hover {
    background: rgba(201, 176, 55, 0.08);
    border-color: var(--accent-gold);
}

.btn-display {
    background: var(--accent-gold);
    color: var(--dark-bg);
}

.btn-display:hover {
    background: #d4af37;
}

.btn-delete {
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.btn-delete:hover {
    background: var(--danger-color);
    color: var(--text-dark);
}

/* Users List (Admin) */
.users-list {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.user-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.user-item:last-child {
    border-bottom: none;
}

.user-info-item {
    flex: 1;
}

.user-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.user-status.active {
    background: #d5f4e6;
    color: var(--success-color);
}

.user-status.pending {
    background: #ffeaa7;
    color: #b8860b;
}

.user-status.inactive {
    background: #ffeaa7;
    color: var(--danger-color);
}

.user-status.disabled {
    background: #ffd0d0;
    color: #c0392b;
}

.status-select {
    background: var(--dark-bg);
    color: var(--text-dark);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.85em;
    cursor: pointer;
}

.user-actions {
    display: flex;
    gap: 8px;
}

.user-actions button,
.user-actions select {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
}

.user-actions select {
    background: var(--dark-bg);
    border: 1px solid var(--accent-gold);
    color: var(--text-dark);
}

/* Profile Section */
.profile-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.profile-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-subtle);
}

.profile-card h3 {
    margin-bottom: 20px;
    color: var(--accent-gold);
    font-weight: 600;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-weight: 600;
    color: var(--text-light);
}

.info-item span {
    color: var(--text-dark);
    font-weight: 600;
}

.badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    background: var(--light-bg);
    color: var(--text-dark);
}

.badge-premium {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.admin-tab-btn {
    padding: 12px 25px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-dark);
    transition: all 0.2s;
}

.admin-tab-btn:hover {
    border-color: var(--accent-gold);
    background: rgba(201, 176, 55, 0.08);
}

.admin-tab-btn.active {
    background: var(--accent-gold);
    color: var(--dark-bg);
    border-color: var(--accent-gold);
}

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

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

.admin-panel {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-subtle);
}

.admin-panel h3 {
    margin-bottom: 15px;
    color: var(--accent-gold);
    font-weight: 600;
}

.admin-media-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.admin-media-item {
    background: var(--dark-bg);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-subtle);
    transition: all 0.2s;
}

.admin-media-item:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 4px 12px rgba(201, 176, 55, 0.2);
}

.admin-media-item .media-preview {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.admin-media-item img,
.admin-media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-media-item .media-info {
    padding: 12px;
}

.admin-media-item .media-title {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-media-item .media-meta {
    font-size: 0.8em;
    color: var(--text-light);
    margin-bottom: 10px;
}

.admin-media-item .media-actions {
    display: flex;
    gap: 8px;
}

.media-filter-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-subtle);
}

.filter-tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-dark);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s;
}

.filter-tab-btn:hover {
    background: rgba(201, 176, 55, 0.08);
    border-color: var(--accent-gold);
}

.filter-tab-btn.active {
    background: var(--accent-gold);
    color: var(--dark-bg);
    border-color: var(--accent-gold);
}

.admin-media-item button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-share {
    background: var(--accent-gold);
    color: var(--dark-bg);
}

.btn-share:hover {
    background: #d4af37;
}

.btn-unshare {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border-subtle);
}

.btn-unshare:hover {
    background: rgba(201, 176, 55, 0.08);
    border-color: var(--accent-gold);
}

.btn-admin-delete {
    background: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.btn-admin-delete:hover {
    background: var(--danger-color);
    color: var(--text-dark);
}

/* Fullscreen Display */
.fullscreen-display {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 1000;
}

.fullscreen-display.active {
    display: block;
}

.fullscreen-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-content video,
.fullscreen-content img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.fullscreen-content .display-message {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9);
    white-space: pre-wrap;
}

.fullscreen-content .display-message.text-justify {
    text-align: justify;
    text-justify: inter-word;
    max-width: 85%;
    line-height: 1.6;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background: transparent;
    color: rgba(255, 255, 255, 0.3);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5em;
    font-weight: 200;
    cursor: pointer;
    transition: all 0.3s, opacity 0.5s;
    opacity: 0.3;
    animation: fadeOutButton 5s ease-in-out 3s forwards;
}

.close-btn:hover,
.close-btn:active {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
    opacity: 1;
    animation: none;
}

@keyframes fadeOutButton {
    0%, 70% {
        opacity: 0.3;
    }
    100% {
        opacity: 0.05;
    }
}

/* Swipe indicators on edges */
.fullscreen-display::before,
.fullscreen-display::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 80px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.fullscreen-display::before {
    left: 0;
    border-radius: 0 20px 20px 0;
}

.fullscreen-display::after {
    right: 0;
    background: linear-gradient(-90deg, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 20px 0 0 20px;
}

.fullscreen-display.swiping::before,
.fullscreen-display.swiping::after {
    opacity: 1;
}

/* Visual feedback during swipe */
.fullscreen-display.swiping #fullscreen-content {
    transition: transform 0.1s ease-out;
}

/* Swipe hint */
.swipe-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2em;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 24px;
    border-radius: 25px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
}

.fullscreen-display.active .swipe-hint {
    animation: showSwipeHint 4s ease-in-out;
}

@keyframes showSwipeHint {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    10%, 60% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* Emoji Picker */
.emoji-toggle-btn {
    width: 100%;
    padding: 8px;
    background: var(--accent-gold);
    color: var(--dark-bg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s;
    margin-bottom: 6px;
}

.emoji-toggle-btn:hover {
    background: #d4af37;
    transform: translateY(-1px);
}

.emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px;
    background: var(--dark-bg);
    border-radius: 4px;
    max-height: 120px;
    overflow-y: auto;
    margin-top: 6px;
    border: 1px solid var(--border-subtle);
}

.emoji-btn {
    width: 32px;
    height: 32px;
    font-size: 18px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emoji-btn:hover {
    background: rgba(201, 176, 55, 0.12);
    border-color: var(--accent-gold);
    transform: scale(1.15);
}

/* Text Effects */
.text-effect-shadow {
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7),
                 6px 6px 12px rgba(0, 0, 0, 0.5);
}

.text-effect-outline {
    text-shadow: -2px -2px 0 #000, 2px -2px 0 #000,
                 -2px 2px 0 #000, 2px 2px 0 #000,
                 -3px 0 0 #000, 3px 0 0 #000,
                 0 -3px 0 #000, 0 3px 0 #000;
}

.text-effect-reflection {
    position: relative;
    text-shadow: 0 0 20px currentColor,
                 0 0 40px currentColor,
                 0 0 60px currentColor;
}

.text-effect-emboss {
    color: #888;
    text-shadow: -2px -2px 2px rgba(255, 255, 255, 0.8),
                 2px 2px 3px rgba(0, 0, 0, 0.9),
                 -3px -3px 5px rgba(255, 255, 255, 0.5),
                 3px 3px 6px rgba(0, 0, 0, 0.7);
}

.text-effect-engrave {
    color: #666;
    text-shadow: 2px 2px 2px rgba(255, 255, 255, 0.8),
                 -2px -2px 3px rgba(0, 0, 0, 0.9),
                 3px 3px 5px rgba(255, 255, 255, 0.5),
                 -3px -3px 6px rgba(0, 0, 0, 0.7);
}

.text-effect-gradient {
    background: linear-gradient(180deg, 
        #667eea 0%, 
        #764ba2 50%, 
        #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-effect-glow {
    text-shadow: 0 0 10px currentColor,
                 0 0 20px currentColor,
                 0 0 30px currentColor,
                 0 0 40px currentColor;
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { text-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor; }
    50% { text-shadow: 0 0 20px currentColor, 0 0 30px currentColor, 0 0 40px currentColor, 0 0 50px currentColor; }
}

.text-effect-rainbow {
    background: linear-gradient(90deg, 
        #ff0000, #ff7f00, #ffff00, #00ff00, 
        #0000ff, #4b0082, #9400d3);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-shift 3s linear infinite;
}

@keyframes rainbow-shift {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.text-effect-neon {
    color: #fff;
    text-shadow: 0 0 5px #fff,
                 0 0 10px #fff,
                 0 0 20px #ff00de,
                 0 0 30px #ff00de,
                 0 0 40px #ff00de,
                 0 0 55px #ff00de,
                 0 0 75px #ff00de;
    animation: neon-flicker 1.5s infinite alternate;
}

@keyframes neon-flicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 20px #ff00de,
                     0 0 30px #ff00de, 0 0 40px #ff00de, 0 0 55px #ff00de, 0 0 75px #ff00de;
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

.text-effect-fire {
    background: linear-gradient(180deg, #ff0000, #ff7f00, #ffff00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(255, 100, 0, 0.5);
    animation: fire-flicker 0.5s ease-in-out infinite alternate;
}

@keyframes fire-flicker {
    0% { filter: brightness(1) blur(0px); }
    100% { filter: brightness(1.2) blur(0.5px); }
}

.text-effect-glitter {
    position: relative;
    animation: glitter-sparkle 1s infinite;
}

@keyframes glitter-sparkle {
    0%, 100% { 
        text-shadow: 0 0 5px #fff, 2px 2px 10px #ffd700,
                     -2px -2px 10px #ffd700, 2px -2px 10px #ffd700, -2px 2px 10px #ffd700;
    }
    25% {
        text-shadow: 0 0 10px #fff, 3px 3px 15px #ff69b4,
                     -3px -3px 15px #ff69b4, 3px -3px 15px #ff69b4, -3px 3px 15px #ff69b4;
    }
    50% {
        text-shadow: 0 0 8px #fff, 2px 2px 12px #00ffff,
                     -2px -2px 12px #00ffff, 2px -2px 12px #00ffff, -2px 2px 12px #00ffff;
    }
    75% {
        text-shadow: 0 0 12px #fff, 4px 4px 18px #9370db,
                     -4px -4px 18px #9370db, 4px -4px 18px #9370db, -4px 4px 18px #9370db;
    }
}

.text-effect-pulse {
    animation: pulse-scale 1s ease-in-out infinite;
}

@keyframes pulse-scale {
    0%, 100% { 
        transform: scale(1);
        text-shadow: 0 0 10px currentColor;
    }
    50% { 
        transform: scale(1.05);
        text-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
    }
}

/* PowerPoint-style WordArt and Animation Effects */
.text-effect-wave {
    display: inline-block;
    animation: wave-effect 2s ease-in-out infinite;
}

@keyframes wave-effect {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
    }
    25% { 
        transform: translateY(-15px) rotate(-2deg);
    }
    50% { 
        transform: translateY(0) rotate(0deg);
    }
    75% { 
        transform: translateY(15px) rotate(2deg);
    }
}

.text-effect-arc {
    display: inline-block;
    transform: perspective(500px) rotateX(-15deg);
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.text-effect-3d-extrude {
    color: currentColor;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2),
                 2px 2px 0 rgba(0, 0, 0, 0.2),
                 3px 3px 0 rgba(0, 0, 0, 0.2),
                 4px 4px 0 rgba(0, 0, 0, 0.2),
                 5px 5px 0 rgba(0, 0, 0, 0.2),
                 6px 6px 0 rgba(0, 0, 0, 0.2),
                 7px 7px 0 rgba(0, 0, 0, 0.2),
                 8px 8px 10px rgba(0, 0, 0, 0.5);
}

.text-effect-chrome {
    background: linear-gradient(180deg, 
        #f0f0f0 0%, 
        #666 20%, 
        #ccc 40%, 
        #333 50%, 
        #ccc 60%, 
        #666 80%, 
        #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    animation: chrome-shine 3s ease-in-out infinite;
}

@keyframes chrome-shine {
    0%, 100% { 
        filter: brightness(1) contrast(1.2);
    }
    50% { 
        filter: brightness(1.3) contrast(1.4);
    }
}

.text-effect-bounce {
    display: inline-block;
    animation: bounce-effect 1s ease-in-out infinite;
}

@keyframes bounce-effect {
    0%, 100% { 
        transform: translateY(0) scale(1);
    }
    25% { 
        transform: translateY(-30px) scale(1.05, 0.95);
    }
    50% { 
        transform: translateY(0) scale(1);
    }
    75% { 
        transform: translateY(-15px) scale(1.02, 0.98);
    }
}

.text-effect-rotate {
    display: inline-block;
    animation: rotate-effect 3s linear infinite;
}

@keyframes rotate-effect {
    0% { 
        transform: rotate(0deg);
    }
    100% { 
        transform: rotate(360deg);
    }
}

.text-effect-zoom {
    display: inline-block;
    animation: zoom-effect 1.5s ease-in-out infinite;
}

@keyframes zoom-effect {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.3);
        opacity: 0.8;
    }
}

.text-effect-float {
    display: inline-block;
    animation: float-effect 3s ease-in-out infinite;
}

@keyframes float-effect {
    0%, 100% { 
        transform: translateY(0) translateX(0);
    }
    25% { 
        transform: translateY(-20px) translateX(10px);
    }
    50% { 
        transform: translateY(-10px) translateX(-10px);
    }
    75% { 
        transform: translateY(-20px) translateX(5px);
    }
}

.text-effect-spiral {
    display: inline-block;
    animation: spiral-effect 4s ease-in-out infinite;
}

@keyframes spiral-effect {
    0% { 
        transform: rotate(0deg) scale(1) translateY(0);
    }
    25% { 
        transform: rotate(90deg) scale(1.2) translateY(-10px);
    }
    50% { 
        transform: rotate(180deg) scale(1) translateY(0);
    }
    75% { 
        transform: rotate(270deg) scale(0.8) translateY(10px);
    }
    100% { 
        transform: rotate(360deg) scale(1) translateY(0);
    }
}

/* PowerPoint Entrance/Exit Effects */
.text-effect-fade-in-out {
    animation: fade-in-out-effect 3s ease-in-out infinite;
}

@keyframes fade-in-out-effect {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

.text-effect-fly-in {
    display: inline-block;
    animation: fly-in-effect 2s ease-out infinite;
}

@keyframes fly-in-effect {
    0% { 
        transform: translateY(-200px) translateX(-100px) scale(0.3);
        opacity: 0;
    }
    60% { 
        transform: translateY(0) translateX(0) scale(1.1);
        opacity: 1;
    }
    80% { 
        transform: scale(0.95);
    }
    100% { 
        transform: scale(1);
    }
}

.text-effect-scroll {
    display: inline-block;
    animation: scroll-effect 5s linear infinite;
}

@keyframes scroll-effect {
    0% { 
        transform: translateX(100vw);
    }
    100% { 
        transform: translateX(-100%);
    }
}

.text-effect-slide-left {
    display: inline-block;
    animation: slide-left-effect 2s ease-in-out infinite;
}

@keyframes slide-left-effect {
    0% { 
        transform: translateX(100px);
        opacity: 0;
    }
    50% { 
        transform: translateX(0);
        opacity: 1;
    }
    100% { 
        transform: translateX(-100px);
        opacity: 0;
    }
}

.text-effect-slide-right {
    display: inline-block;
    animation: slide-right-effect 2s ease-in-out infinite;
}

@keyframes slide-right-effect {
    0% { 
        transform: translateX(-100px);
        opacity: 0;
    }
    50% { 
        transform: translateX(0);
        opacity: 1;
    }
    100% { 
        transform: translateX(100px);
        opacity: 0;
    }
}

.text-effect-bounce-in {
    display: inline-block;
    animation: bounce-in-effect 2s ease-out infinite;
}

@keyframes bounce-in-effect {
    0% { 
        transform: scale(0);
        opacity: 0;
    }
    50% { 
        transform: scale(1.2);
        opacity: 1;
    }
    65% { 
        transform: scale(0.9);
    }
    80% { 
        transform: scale(1.05);
    }
    100% { 
        transform: scale(1);
    }
}

.text-effect-elastic {
    display: inline-block;
    animation: elastic-effect 2s ease-in-out infinite;
}

@keyframes elastic-effect {
    0%, 100% { 
        transform: scaleX(1) scaleY(1);
    }
    20% { 
        transform: scaleX(1.3) scaleY(0.8);
    }
    40% { 
        transform: scaleX(0.8) scaleY(1.2);
    }
    60% { 
        transform: scaleX(1.1) scaleY(0.9);
    }
    80% { 
        transform: scaleX(0.95) scaleY(1.05);
    }
}

.text-effect-swing {
    display: inline-block;
    transform-origin: top center;
    animation: swing-effect 2s ease-in-out infinite;
}

@keyframes swing-effect {
    0%, 100% { 
        transform: rotate(0deg);
    }
    20% { 
        transform: rotate(15deg);
    }
    40% { 
        transform: rotate(-10deg);
    }
    60% { 
        transform: rotate(5deg);
    }
    80% { 
        transform: rotate(-5deg);
    }
}

/* Tablet Layout (769px - 1200px) - Settings side by side below preview */
@media (max-width: 1200px) and (min-width: 769px) {
    .config-main-layout {
        grid-template-columns: 1fr 1fr; /* Two columns for settings */
        grid-template-rows: auto auto;
        gap: 20px;
    }
    
    /* Preview spans both columns */
    .preview-column {
        grid-column: 1 / -1;
    }
    
    /* Text settings in left column */
    .text-settings-column {
        grid-column: 1;
    }
    
    /* Visual effects in right column */
    .visual-effects-column {
        grid-column: 2;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .nav-btn.clear-cache {
        font-size: 0.8em;
        padding: 8px 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Stack config layout on mobile */
    .config-main-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* On mobile: Preview first, then buttons, then settings side by side */
    .preview-column {
        order: 1;
    }
    
    .text-settings-column {
        order: 2;
    }
    
    .visual-effects-column {
        order: 3;
    }
    
    .preview-buttons {
        margin-top: 10px;
    }
    
    .preview-buttons button {
        font-size: 0.85em;
        padding: 10px 15px;
    }
    
    .preview-container {
        height: 300px;
    }
    
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .configs-list,
    .display-list {
        grid-template-columns: 1fr;
    }
    
    .profile-container {
        grid-template-columns: 1fr;
    }
    
    .admin-media-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    /* Admin panel — reduce padding so content fits narrow screens */
    .admin-panel {
        padding: 15px;
    }

    .users-list {
        padding: 10px;
    }

    .user-item {
        display: block;
        padding: 12px;
    }

    /* Make info block fill the full card width when stacked */
    .user-info-item {
        width: 100%;
        margin-bottom: 8px;
    }

    .user-status {
        display: inline-block;
        margin-bottom: 8px;
    }

    /* Override the inline width:180px on the display-name input */
    .user-info-item input[type="text"] {
        width: 100% !important;
        max-width: 100%;
        box-sizing: border-box;
    }

    .user-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
        box-sizing: border-box;
    }

    .user-actions button,
    .user-actions select {
        width: 100%;
        font-size: 0.85em;
        padding: 8px 6px;
        box-sizing: border-box;
    }

    .admin-tabs {
        flex-wrap: wrap;
    }

    .admin-tab-btn {
        flex: 1;
        min-width: 120px;
    }
}
/* Subscription Section */
.subscription-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-subtle);
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-subtle);
}

.subscription-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.subscription-features {
    margin: 30px 0;
}

.subscription-features h4 {
    color: var(--accent-gold);
    margin-bottom: 15px;
    font-weight: 600;
}

.subscription-features ul {
    list-style: none;
    padding: 0;
}

.subscription-features li {
    padding: 10px 0;
    font-size: 1.05em;
    color: var(--text-dark);
}

/* Shop Section */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.shop-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s;
}

.shop-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    border-color: var(--accent-gold);
}

.shop-card-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.shop-card-header h3 {
    color: var(--accent-gold);
    margin-bottom: 15px;
    font-weight: 600;
}

.shop-price {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--accent-gold);
}

.shop-price span {
    font-size: 0.4em;
    color: var(--text-light);
}

.shop-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.shop-features li {
    padding: 12px 0;
    font-size: 1.05em;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-subtle);
}

.shop-features li:last-child {
    border-bottom: none;
}

/* News Section */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.news-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    border-color: var(--accent-gold);
}

.news-date {
    color: var(--accent-gold);
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 10px;
}

.news-card h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
}

.news-card p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 15px;
}

.news-link {
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.news-link:hover {
    color: #d4af37;
    text-decoration: underline;
}

/* FAQ Section */
.faq-list {
    max-width: 800px;
    margin: 30px auto;
}

.faq-item {
    background: var(--card-bg);
    border-radius: 4px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 20px;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-dark);
    text-align: left;
    transition: background 0.3s;
}

.faq-question:hover {
    background: rgba(201, 176, 55, 0.08);
}

.faq-icon {
    font-size: 1.5em;
    color: var(--accent-gold);
    transition: transform 0.3s;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 20px;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 20px 20px;
}

.faq-answer p {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    margin-top: 30px;
}

.contact-info {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-subtle);
}

.contact-info h3 {
    color: var(--accent-gold);
    margin-bottom: 15px;
    font-weight: 600;
}

.contact-info p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 30px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.contact-icon {
    font-size: 1.8em;
}

.contact-item strong {
    display: block;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.contact-item p {
    color: var(--text-light);
    margin: 0;
}

.contact-form-container {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 30px;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-subtle);
}

.contact-form-container textarea {
    resize: vertical;
}

/* Library Tabs */
.library-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.library-tabs .tab-btn {
    flex: 1;
    padding: 15px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s;
    color: var(--text-dark);
}

.library-tabs .tab-btn.active {
    background: var(--accent-gold);
    color: var(--dark-bg);
    border-color: var(--accent-gold);
}

.tab-content {
    display: none;
}

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

.media-upload {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-subtle);
}

.media-upload h3 {
    margin-bottom: 15px;
    color: var(--accent-gold);
    font-weight: 600;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* Responsive Design for New Sections */
@media (max-width: 768px) {
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .shop-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .subscription-info {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   VISUAL EFFECTS SYSTEM
   ======================================== */

/* Effect overlay container */
.visual-effect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* Particle base */
.particle {
    position: absolute;
    pointer-events: none;
    animation-timing-function: linear;
}

/* FIREWORKS EFFECT */
.firework-particle {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

@keyframes firework-burst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* CONFETTI EFFECT */
.confetti-particle {
    width: 10px;
    height: 10px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotateZ(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotateZ(720deg);
        opacity: 0;
    }
}

/* HEARTS EFFECT */
.heart-particle {
    font-size: 24px;
    animation: heart-float linear forwards;
}

@keyframes heart-float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* STARS EFFECT */
.star-particle {
    width: 3px;
    height: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 6px white, 0 0 12px white;
    animation: shooting-star linear forwards;
}

@keyframes shooting-star {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0);
        opacity: 0;
    }
}

/* BUBBLES EFFECT */
.bubble-particle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.1));
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: bubble-float linear forwards;
}

@keyframes bubble-float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100vh) translateX(var(--wobble));
        opacity: 0;
    }
}

/* SNOW EFFECT */
.snow-particle {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    animation: snow-fall linear forwards;
}

@keyframes snow-fall {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(var(--drift));
        opacity: 0;
    }
}

/* SPARKLES EFFECT */
.sparkle-particle {
    width: 6px;
    height: 6px;
    background: white;
    animation: sparkle-twinkle 1s ease-in-out infinite;
}

@keyframes sparkle-twinkle {
    0%, 100% { 
        opacity: 0; 
        transform: scale(0.5) rotate(0deg);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.5) rotate(180deg);
    }
}

/* BALLOONS EFFECT */
.balloon-particle {
    font-size: 32px;
    animation: balloon-float linear forwards;
}

@keyframes balloon-float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-120vh) rotate(var(--rotation));
        opacity: 0;
    }
}

/* COINS EFFECT */
.coin-particle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffd700 0%, #ffed4e 50%, #b8860b 100%);
    border: 2px solid #daa520;
    animation: coin-fall linear forwards;
}

@keyframes coin-fall {
    0% {
        transform: translateY(0) rotateY(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotateY(720deg);
        opacity: 1;
    }
}

/* Intensity variations */
.intensity-low { animation-duration: 5s; }
.intensity-medium { animation-duration: 3s; }
.intensity-high { animation-duration: 2s; }
.intensity-extreme { animation-duration: 1s; }

/* ─── Content Manager ──────────────────────────────────────────────────────── */
.cm-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    background: var(--dark-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 12px;
}
.cm-toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cm-label {
    color: #aaa;
    font-size: 0.85em;
    white-space: nowrap;
}
.cm-select {
    background: var(--dark-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-dark);
    padding: 8px 12px;
    font-size: 0.9em;
    min-width: 200px;
}
.cm-select:focus { outline: none; border-color: var(--accent-gold); box-shadow: 0 0 0 2px rgba(201, 176, 55, 0.15); }
.cm-btn {
    padding: 8px 18px;
    font-size: 0.9em;
    white-space: nowrap;
}
.cm-bulk-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px;
    margin-bottom: 8px;
    color: var(--text-light);
    font-size: 0.9em;
    border-bottom: 1px solid var(--border-subtle);
}
.cm-configs-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cm-card {
    background: var(--dark-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}
.cm-card:hover { 
    background: rgba(201, 176, 55, 0.05);
    border-color: var(--accent-gold);
}
.cm-card-body { flex: 1; min-width: 0; }
.cm-card-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.cm-card-meta {
    color: var(--text-light);
    font-size: 0.78em;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.cm-card-badge {
    background: rgba(201, 176, 55, 0.12);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75em;
    color: var(--accent-gold);
    border: 1px solid var(--border-subtle);
}
.cm-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.cm-copy-select {
    background: var(--dark-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-dark);
    padding: 5px 8px;
    font-size: 0.8em;
    max-width: 160px;
}
.cm-copy-select:focus { outline: none; border-color: var(--accent-gold); box-shadow: 0 0 0 2px rgba(201, 176, 55, 0.15); }
.cm-copy-btn {
    background: var(--accent-gold);
    color: var(--dark-bg);
    border: none;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    white-space: nowrap;
    transition: all 0.2s;
    font-weight: 600;
}
.cm-copy-btn:hover { background: #d4af37; }
.cm-share-toggle-btn {
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78em;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.cm-share-btn   { background: rgba(100,200,100,0.2); color: #7dce7d; border: 1px solid rgba(100,200,100,0.35); }
.cm-unshare-btn { background: rgba(240,192,64,0.2);  color: #f0c040; border: 1px solid rgba(240,192,64,0.35); }
.cm-share-toggle-btn:hover { opacity: 0.8; }
.cm-owner-tag {
    font-size: 0.72em;
    color: #888;
    font-style: italic;
}
@media (max-width: 768px) {
    .cm-toolbar { flex-direction: column; align-items: stretch; }
    .cm-toolbar-group { flex-direction: column; align-items: stretch; }
    .cm-select { min-width: unset; }
    .cm-card { flex-direction: column; align-items: stretch; }
    .cm-card-actions { flex-wrap: wrap; justify-content: flex-end; }
}

/* ─── Content Manager Tabs ─────────────────────────────────────────────────── */
.cm-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0;
}
.cm-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-light);
    padding: 10px 20px;
    font-size: 0.9em;
    cursor: pointer;
    margin-bottom: -1px;
    transition: all 0.2s;
    white-space: nowrap;
}
.cm-tab-btn:hover { color: var(--text-dark); }
.cm-tab-btn.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
    font-weight: 600;
}
.cm-tab-content { display: none; }
.cm-tab-content.active { display: block; }

/* ─── Content Manager - Media Cards ────────────────────────────────────────── */
.cm-media-card {
    background: var(--dark-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    transition: all 0.15s;
}
.cm-media-card:hover { 
    background: rgba(201, 176, 55, 0.05);
    border-color: var(--accent-gold);
}
.cm-media-preview { flex-shrink: 0; }
.cm-media-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    border: 1px solid var(--border-subtle);
}
.media-shared-flag {
    position: absolute;
    top: 4px;
    left: 4px;
    font-size: 1em;
    color: #f0c040;
    pointer-events: none;
    text-shadow: 0 0 4px rgba(0,0,0,0.6);
}
.media-owner-tag {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.65);
    color: #bbb;
    font-size: 0.65em;
    padding: 1px 5px;
    border-radius: 8px;
    pointer-events: none;
    white-space: nowrap;
    max-width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Offer Tier badges & controls ─────────────────────────────────────────── */
/* In Content Manager cards */
.cm-tier-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.cm-tier-chk {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78em;
    color: var(--text-light);
    cursor: pointer;
    background: rgba(201, 176, 55, 0.08);
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    transition: all 0.15s;
}
.cm-tier-chk:hover { 
    background: rgba(201, 176, 55, 0.15);
    border-color: var(--accent-gold);
}
.cm-tier-chk input { accent-color: var(--accent-gold); cursor: pointer; }
.cm-tier-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0.03em;
    vertical-align: middle;
    margin-left: 4px;
}
.cm-tier-basic  { background: rgba(100,200,100,0.18); color: #7dce7d; border: 1px solid rgba(100,200,100,0.3); }
.cm-tier-premium { background: rgba(240,192,64,0.18);  color: #f0c040; border: 1px solid rgba(240,192,64,0.3); }
/* In Library shared cards */
.media-tier-pills {
    position: absolute;
    bottom: 4px;
    left: 4px;
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    pointer-events: none;
}
.media-tier-pill {
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.65em;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.media-tier-basic   { background: rgba(100,200,100,0.85); color: #0a2d0a; }
.media-tier-premium { background: rgba(240,192,64,0.90);  color: #3d2600; }


/* ── Admin Content Editor ───────────────────────────────────────────────── */
.content-editor-form {
    background: var(--dark-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 16px 20px;
}
.content-editor-form h4 {
    margin: 0 0 14px;
    color: var(--accent-gold);
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Admin FAQ / News entry cards */
.admin-content-item {
    background: var(--dark-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.admin-content-item.editing {
    border-color: var(--accent-gold);
    background: rgba(201, 176, 55, 0.08);
}
.admin-content-item-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.admin-content-item-title {
    flex: 1;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9em;
    line-height: 1.4;
}
.admin-content-item-meta {
    font-size: 0.75em;
    color: #999;
    margin-top: 2px;
}
.admin-content-item-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.admin-content-item-body {
    margin-top: 10px;
}
.admin-content-item textarea,
.admin-content-item input[type="text"],
.admin-content-item input[type="url"],
.admin-content-item input[type="number"] {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 8px 10px;
    color: #e0e0e0;
    font-size: 0.88em;
    margin-top: 4px;
    resize: vertical;
}
.admin-content-item .inline-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 0.85em;
    color: #ccc;
}
.btn-xs {
    padding: 4px 10px;
    font-size: 0.78em;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}
.btn-edit  { background: rgba(80,140,255,0.25); color: #8ab4ff; }
.btn-save  { background: rgba(60,190,100,0.25); color: #6edfa0; }
.btn-cancel{ background: rgba(200,200,200,0.1); color: #aaa; }
.btn-del   { background: rgba(220,60,60,0.22);  color: #ff8080; }
.btn-edit:hover   { background: rgba(80,140,255,0.4); }
.btn-save:hover   { background: rgba(60,190,100,0.4); }
.btn-cancel:hover { background: rgba(200,200,200,0.2); }
.btn-del:hover    { background: rgba(220,60,60,0.4); }
.published-badge {
    display:inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.72em;
    font-weight: 700;
}
.published-badge.yes { background: rgba(60,190,100,0.2); color: #6edfa0; }
.published-badge.no  { background: rgba(200,80,80,0.2);  color: #ff9999; }

/* ═══════════════════════════════════════════════════════════════════════════
   STATISTICS TAB
═══════════════════════════════════════════════════════════════════════════ */

.stats-panel { padding: 0 !important; background: transparent !important; box-shadow: none !important; }

/* KPI cards */
.stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.kpi-card {
    background: linear-gradient(135deg, rgba(124,58,237,0.18) 0%, rgba(30,27,75,0.6) 100%);
    border: 1px solid rgba(167,139,250,0.3);
    border-radius: 12px;
    padding: 18px 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: background 0.2s, border-color 0.2s;
}
.kpi-card:hover {
    background: linear-gradient(135deg, rgba(124,58,237,0.28) 0%, rgba(30,27,75,0.7) 100%);
    border-color: rgba(167,139,250,0.55);
}
.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #c4b5fd;
    line-height: 1;
}
.kpi-label { font-size: 0.78rem; color: rgba(255,255,255,0.65); }

/* Sections */
.stats-section {
    background: rgba(15,12,40,0.7);
    border: 1px solid rgba(167,139,250,0.2);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
}
.stats-section h4 {
    margin: 0 0 16px 0;
    font-size: 0.9rem;
    color: #c4b5fd;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid rgba(167,139,250,0.15);
    padding-bottom: 10px;
}
.stats-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(167,139,250,0.15);
    padding-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}
.stats-section-header h4 { margin: 0; border: none; padding: 0; }

/* Period toggle */
.stats-period-tabs { display: flex; gap: 6px; }
.stats-period-btn {
    padding: 4px 12px;
    border: 1px solid rgba(167,139,250,0.4);
    border-radius: 20px;
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}
.stats-period-btn:hover { background: rgba(167,139,250,0.15); }
.stats-period-btn.active { background: rgba(167,139,250,0.3); color: #e9d5ff; border-color: #a78bfa; }

/* Charts row */
.stats-charts-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
.stats-chart-box {
    flex: 1 1 200px;
    min-width: 160px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 14px;
}
.stats-chart-wide { flex: 2 1 400px; }
.stats-chart-title {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.stats-chart-title::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 12px;
    background: #a78bfa;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Bar chart (pure CSS) */
.bar-chart { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; }
.bar-row {
    display: grid;
    grid-template-columns: 80px 1fr 36px;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
}
.bar-label { color: rgba(255,255,255,0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.bar-track { background: rgba(255,255,255,0.08); border-radius: 4px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.bar-count { color: rgba(255,255,255,0.8); text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Pie chart list */
.pie-chart-list { display: flex; flex-direction: column; gap: 8px; }
.pie-row {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}
.pie-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pie-label { color: rgba(255,255,255,0.85); }
.pie-pct { color: rgba(255,255,255,0.55); font-size: 0.74rem; font-weight: 600; }
.pie-bar-wrap { grid-column: 1 / -1; background: rgba(255,255,255,0.08); border-radius: 3px; height: 5px; margin-top: -4px; overflow: hidden; }
.pie-bar-fill { height: 100%; border-radius: 3px; }

/* Stats table */
.stats-table-wrapper { overflow-x: auto; border-radius: 8px; border: 1px solid rgba(167,139,250,0.15); }
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.stats-table th {
    background: rgba(124,58,237,0.2);
    color: #d8b4fe;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 0.72rem;
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid rgba(167,139,250,0.2);
}
.stats-table td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
    vertical-align: middle;
}
.stats-table tbody tr:hover td { background: rgba(167,139,250,0.07); }
.stats-table .badge-num {
    display: inline-block;
    background: rgba(167,139,250,0.25);
    color: #e9d5ff;
    border-radius: 10px;
    padding: 2px 10px;
    font-weight: 700;
    font-size: 0.78rem;
    min-width: 30px;
    text-align: center;
}
.stats-detail-btn {
    padding: 4px 12px;
    font-size: 0.75rem;
    background: rgba(167,139,250,0.18);
    border: 1px solid rgba(167,139,250,0.4);
    border-radius: 6px;
    color: #c4b5fd;
    cursor: pointer;
    transition: all 0.2s;
}
.stats-detail-btn:hover { background: rgba(167,139,250,0.35); border-color: #a78bfa; }

/* User detail modal */
.stats-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.82);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.stats-modal-inner {
    background: #12102a;
    border: 1px solid rgba(167,139,250,0.4);
    border-radius: 16px;
    box-shadow: 0 0 60px rgba(124,58,237,0.25);
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
}
.stats-modal-close {
    position: absolute;
    top: 14px; right: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}
.stats-modal-close:hover { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.3); }
.stats-modal-inner h3 { margin: 0 0 20px; font-size: 1.1rem; color: #e9d5ff; border-bottom: 1px solid rgba(167,139,250,0.2); padding-bottom: 12px; }
.stats-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stats-modal-kpi {
    background: rgba(124,58,237,0.15);
    border: 1px solid rgba(167,139,250,0.25);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}
.stats-modal-kpi .kpi-value { font-size: 1.5rem; }

/* Modal chart sub-sections */
.stats-modal-inner .stats-chart-title { color: rgba(255,255,255,0.8); }
.stats-modal-inner > div[style*="grid"] > div {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 12px;
}

/* sessions list in modal */
.sessions-list { display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow-y: auto; }
.session-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.75);
    flex-wrap: wrap;
}
.session-row .tag {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
}
.tag-mobile   { background: rgba(251,191,36,0.2);  color: #fcd34d; }
.tag-tablet   { background: rgba(59,130,246,0.2);  color: #93c5fd; }
.tag-desktop  { background: rgba(52,211,153,0.2);  color: #6ee7b7; }
.tag-chrome   { background: rgba(234,88,12,0.15);  color: #fdba74; }
.tag-firefox  { background: rgba(124,58,237,0.2);  color: #c4b5fd; }
.tag-safari   { background: rgba(14,165,233,0.2);  color: #7dd3fc; }
.tag-edge     { background: rgba(99,102,241,0.2);  color: #a5b4fc; }
.tag-other    { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }

/* "no data" placeholder */
.stats-nodata {
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: 0.82rem;
    padding: 16px 8px;
    font-style: italic;
}

@media (max-width: 640px) {
    .stats-kpi-grid { grid-template-columns: repeat(2,1fr); }
    .bar-row { grid-template-columns: 60px 1fr 30px; }
}

/* KPI cards */
.stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.kpi-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 18px 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: background 0.2s;
}
.kpi-card:hover { background: rgba(255,255,255,0.09); }
.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: #a78bfa;
    line-height: 1;
}
.kpi-label { font-size: 0.78rem; color: rgba(255,255,255,0.6); }

/* Sections */
.stats-section {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
}
.stats-section h4 {
    margin: 0 0 16px 0;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.75);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stats-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}
.stats-section-header h4 { margin: 0; }

/* Period toggle */
.stats-period-tabs { display: flex; gap: 6px; }
.stats-period-btn {
    padding: 4px 12px;
    border: 1px solid rgba(167,139,250,0.4);
    border-radius: 20px;
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}
.stats-period-btn:hover { background: rgba(167,139,250,0.15); }
.stats-period-btn.active { background: rgba(167,139,250,0.25); color: #c4b5fd; border-color: #a78bfa; }

/* Charts row */
.stats-charts-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.stats-chart-box {
    flex: 1 1 200px;
    min-width: 160px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 14px;
}
.stats-chart-wide { flex: 2 1 400px; }
.stats-chart-title {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Bar chart (pure CSS) */
.bar-chart { display: flex; flex-direction: column; gap: 5px; max-height: 280px; overflow-y: auto; }
.bar-row {
    display: grid;
    grid-template-columns: 80px 1fr 36px;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
}
.bar-label { color: rgba(255,255,255,0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
.bar-track { background: rgba(255,255,255,0.06); border-radius: 4px; height: 12px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg,#7c3aed,#a78bfa); transition: width 0.4s ease; }
.bar-count { color: rgba(255,255,255,0.7); text-align: right; font-variant-numeric: tabular-nums; }

/* Pie chart list */
.pie-chart-list { display: flex; flex-direction: column; gap: 8px; }
.pie-row {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}
.pie-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pie-label { color: rgba(255,255,255,0.8); }
.pie-pct { color: rgba(255,255,255,0.45); font-size: 0.74rem; }
.pie-bar-wrap { grid-column: 1 / -1; background: rgba(255,255,255,0.06); border-radius: 3px; height: 5px; margin-top: -4px; overflow: hidden; }
.pie-bar-fill { height: 100%; border-radius: 3px; }

/* Stats table */
.stats-table-wrapper { overflow-x: auto; border-radius: 8px; }
.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.stats-table th {
    background: rgba(167,139,250,0.12);
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 0.72rem;
    padding: 8px 10px;
    text-align: left;
    white-space: nowrap;
}
.stats-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.8);
    vertical-align: middle;
}
.stats-table tr:hover td { background: rgba(255,255,255,0.04); }
.stats-table .badge-num {
    display: inline-block;
    background: rgba(167,139,250,0.2);
    color: #c4b5fd;
    border-radius: 10px;
    padding: 1px 8px;
    font-weight: 700;
    font-size: 0.78rem;
}
.stats-detail-btn {
    padding: 3px 10px;
    font-size: 0.75rem;
    background: rgba(167,139,250,0.15);
    border: 1px solid rgba(167,139,250,0.3);
    border-radius: 6px;
    color: #c4b5fd;
    cursor: pointer;
    transition: background 0.2s;
}
.stats-detail-btn:hover { background: rgba(167,139,250,0.3); }

/* User detail modal */
.stats-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.stats-modal-inner {
    background: #1a1a2e;
    border: 1px solid rgba(167,139,250,0.3);
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
}
.stats-modal-close {
    position: absolute;
    top: 14px; right: 14px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}
.stats-modal-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.stats-modal-inner h3 { margin: 0 0 20px; font-size: 1.1rem; color: #c4b5fd; }
.stats-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stats-modal-kpi {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}
.stats-modal-kpi .kpi-value { font-size: 1.5rem; }

/* sessions list in modal */
.sessions-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.session-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.75);
    flex-wrap: wrap;
}
.session-row .tag {
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}
.tag-mobile   { background: rgba(251,191,36,0.2);  color: #fcd34d; }
.tag-tablet   { background: rgba(59,130,246,0.2);  color: #93c5fd; }
.tag-desktop  { background: rgba(52,211,153,0.2);  color: #6ee7b7; }
.tag-chrome   { background: rgba(234,88,12,0.2);   color: #fdba74; }
.tag-firefox  { background: rgba(124,58,237,0.2);  color: #c4b5fd; }
.tag-safari   { background: rgba(14,165,233,0.2);  color: #7dd3fc; }
.tag-other    { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }

@media (max-width: 640px) {
    .stats-kpi-grid { grid-template-columns: repeat(2,1fr); }
    .bar-row { grid-template-columns: 60px 1fr 30px; }
}



