/* ============================================================
   Qfunny global layout styles
   Extracted from index.php inline <style> blocks
   ============================================================ */

        :root {
            --primary-color: #4F46E5;
            --secondary-color: #10B981;
            --dark-color: #1F2937;
            --light-color: #F9FAFB;
        }
        
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: var(--light-color);
        }
        
        .navbar {
            z-index: 1030; /* Ensure navbar is above other content */
        }
        /* Navbar Styling */
        .navbar-custom {
            background: linear-gradient(135deg, var(--primary-color) 0%, #6366F1 100%);
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            padding: 0.15rem 0;  /* ULTRA SLIM */
        }
        
        .navbar-brand {
            font-size: 1.3rem;  /* ULTRA SLIM */
            font-weight: bold;
            color: white !important;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .navbar-brand:hover {
            transform: scale(1.05);
            transition: transform 0.3s ease;
        }
        
        .logo-icon {
            width: 26px;  /* ULTRA SLIM */
            height: 26px;  /* ULTRA SLIM */
            background: white;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.3rem;  /* ULTRA SLIM */
            font-weight: bold;
            color: var(--primary-color);
        }
        
        .nav-link {
            color: rgba(255,255,255,0.9) !important;
            font-weight: 500;
            padding: 0.25rem 1rem !important;  /* ULTRA SLIM */
            border-radius: 6px;
            transition: all 0.3s ease;
        }
        
        .nav-link:hover {
            background-color: rgba(255,255,255,0.1);
            color: white !important;
            transform: translateY(-2px);
        }
        
        .nav-link.active {
            background-color: rgba(255,255,255,0.2);
            color: white !important;
        }
        
        /* ── Navbar buttons — scoped so page CSS can never override them ── */
        .navbar-custom .btn-create,
        .navbar-custom .btn-login {
            display: inline-flex !important;
            align-items: center !important;
            gap: 6px !important;
            font-size: 13px !important;
            font-weight: 600 !important;
            padding: 6px 14px !important;
            border-radius: 8px !important;
            line-height: 1.4 !important;
            min-height: auto !important;
            height: auto !important;
            white-space: nowrap !important;
            text-decoration: none !important;
            transition: all 0.18s ease !important;
            cursor: pointer !important;
        }

        .navbar-custom .btn-create {
            background-color: var(--secondary-color) !important;
            color: white !important;
            border: 1.5px solid var(--secondary-color) !important;
        }

        .navbar-custom .btn-create:hover {
            background-color: white !important;
            color: #059669 !important;
            border-color: white !important;
            transform: translateY(-1px) !important;
        }

        .navbar-custom .btn-login {
            background-color: transparent !important;
            color: white !important;
            border: 1.5px solid rgba(255,255,255,0.6) !important;
            font-weight: 500 !important;
        }

        .navbar-custom .btn-login:hover {
            background-color: rgba(255,255,255,0.12) !important;
            color: white !important;
            border-color: white !important;
            transform: translateY(-1px) !important;
        }
        
        .user-avatar {
            width: 30px;  /* ULTRA SLIM */
            height: 30px;  /* ULTRA SLIM */
            border-radius: 50%;
            background: white;
            color: var(--primary-color);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            font-size: 0.9rem;  /* Smaller text */
            margin-right: 0.5rem;
        }
        
        .dropdown-menu {
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            border: none;
            margin-top: 0.5rem;
        }
        
        /* Mobile Menu Customization */
        @media (max-width: 991px) {
            .navbar-collapse {
                background: rgba(255,255,255,0.1);
                border-radius: 8px;
                padding: 1rem;
                margin-top: 1rem;
            }
        }
        
        /* Main Content Area */
        .main-content {
            min-height: calc(100vh - 80px);
            padding: 0.5rem 0 2rem 0;  /* Minimal top padding, normal bottom */
        }
        
        /* ── Welcome section buttons — green Create Quiz ── */
        .welcome-section .btn-create,
        .welcome-section .btn-create.btn-lg {
            background-color: #1D9E75 !important;
            color: #fff !important;
            border: 1.5px solid #1D9E75 !important;
            border-radius: 8px !important;
            font-weight: 600 !important;
            transition: all 0.18s !important;
        }

        .welcome-section .btn-create:hover,
        .welcome-section .btn-create.btn-lg:hover {
            background-color: #fff !important;
            color: #1D9E75 !important;
            border-color: #1D9E75 !important;
        }

        /* Welcome Section */
        .welcome-section {
            text-align: center;
            padding: 4rem 2rem;
            background: white;
            border-radius: 16px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            margin: 2rem 0;
        }
        
        .welcome-section h1 {
            color: var(--dark-color);
            font-size: 3rem;
            font-weight: bold;
            margin-bottom: 1rem;
        }
        
        .welcome-section p {
            color: #6B7280;
            font-size: 1.25rem;
        }
        .dropdown-menu {
            z-index: 1050; /* Ensure dropdown is above navbar and content */
        }

/* ── Banner ── */
#qf-cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #1a1a2e; color: #e5e7eb;
    padding: 16px 24px;
    display: none; z-index: 99999;
    font-family: 'Segoe UI', system-ui, sans-serif;
    border-top: 3px solid #7F77DD;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
}
#qf-cookie-banner .qfcb-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center;
    justify-content: space-between; gap: 24px;
    flex-wrap: wrap;
}
#qf-cookie-banner .qfcb-text { font-size: 13px; line-height: 1.6; flex: 1; min-width: 220px; }
#qf-cookie-banner .qfcb-text a { color: #AFA9EC; text-decoration: underline; }
#qf-cookie-banner .qfcb-btns { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.qfcb-btn {
    font-size: 12px; font-weight: 600; padding: 8px 16px;
    border: none; border-radius: 7px; cursor: pointer;
    transition: all .15s; white-space: nowrap;
}
.qfcb-btn-accept  { background: #1D9E75; color: #fff; }
.qfcb-btn-accept:hover  { background: #17876A; }
.qfcb-btn-reject  { background: #374151; color: #e5e7eb; }
.qfcb-btn-reject:hover  { background: #4B5563; }
.qfcb-btn-custom  { background: transparent; color: #AFA9EC; border: 1px solid #534AB7; }
.qfcb-btn-custom:hover  { background: #534AB7; color: #fff; }

/* ── Preferences Modal ── */
#qf-cookie-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    display: none; align-items: center; justify-content: center;
    z-index: 100000; padding: 16px;
    font-family: 'Segoe UI', system-ui, sans-serif;
}
#qf-cookie-modal.active { display: flex; }
.qfcm-box {
    background: #fff; border-radius: 14px;
    max-width: 500px; width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    overflow: hidden;
}
.qfcm-header {
    background: #1a1a2e; color: #fff;
    padding: 18px 22px;
    display: flex; align-items: center; justify-content: space-between;
}
.qfcm-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.qfcm-close {
    background: none; border: none; color: #9ca3af;
    font-size: 20px; cursor: pointer; line-height: 1;
}
.qfcm-close:hover { color: #fff; }
.qfcm-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.qfcm-row {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 12px;
    padding-bottom: 14px; border-bottom: 0.5px solid #f3f4f6;
}
.qfcm-row:last-child { border-bottom: none; padding-bottom: 0; }
.qfcm-info { flex: 1; }
.qfcm-info strong { font-size: 13px; font-weight: 600; color: #1a1a2e; display: block; margin-bottom: 3px; }
.qfcm-info span { font-size: 12px; color: #6b7280; line-height: 1.5; }
/* Toggle switch */
.qfcm-toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; margin-top: 2px; }
.qfcm-toggle input { opacity: 0; width: 0; height: 0; }
.qfcm-slider {
    position: absolute; inset: 0;
    background: #d1d5db; border-radius: 99px;
    cursor: pointer; transition: background .2s;
}
.qfcm-slider::before {
    content: ''; position: absolute;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff; left: 3px; top: 3px;
    transition: transform .2s;
}
.qfcm-toggle input:checked + .qfcm-slider { background: #1D9E75; }
.qfcm-toggle input:checked + .qfcm-slider::before { transform: translateX(18px); }
.qfcm-toggle input:disabled + .qfcm-slider { opacity: 0.55; cursor: not-allowed; }
.qfcm-footer {
    padding: 14px 22px; border-top: 0.5px solid #f3f4f6;
    display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
}
/* Manage link in footer */
.qf-manage-cookies {
    font-size: 12px; color: #9ca3af; cursor: pointer;
    text-decoration: underline; background: none; border: none;
}
.qf-manage-cookies:hover { color: #6b7280; }

@media (max-width: 600px) {
    #qf-cookie-banner .qfcb-inner { flex-direction: column; }
    .qfcb-btns { width: 100%; }
    .qfcb-btn { flex: 1; text-align: center; }
}

/* ── Language selector (navbar) ── */
.qf-lang-toggle {
    gap: 6px;
    text-decoration: none;
}
.qf-lang-flag {
    font-size: 15px;
    line-height: 1;
}
.qf-lang-name {
    font-size: 14px;
}
.qf-lang-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.qf-lang-item.active {
    font-weight: 600;
}
.qf-lang-item .bi-check2 {
    color: var(--secondary-color, #10B981);
}
