/* ============================================================
   QUESTO – Premium Header & Navigation System
   Glassmorphism · Micro-Animations · Full Responsiveness
   ============================================================ */

:root {
    /* ===== BASE (Quiz Style) - Dark (default) ===== */
    --primary-dark: #0f172a;
    --primary: #111c33;
    --secondary: #1f3b5c;
    --accent: #0d9488;

    /* ===== TEXT ===== */
    --text-primary: #e5e7eb;
    --text-secondary: #dbeafe;
    --text-muted: #94a3b8;

    /* ===== UI ===== */
    --border: rgba(255, 255, 255, 0.12);
    --hover-bg: rgba(255, 255, 255, 0.08);
    --card-bg: rgba(17, 28, 51, 0.95);
    --search-bg: rgba(255, 255, 255, 0.08);

    /* ===== STATUS ===== */
    --success: #0d9488;
    --warning: #f9df7b;
    --danger: #ef4444;

    /* ===== GRADIENT ===== */
    --gradient-primary: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    --header-bg: rgba(15, 23, 42, 0.82);

    /* ===== HEADER SPECIFIC ===== */
    --header-height: 64px;
    --header-border: rgba(13, 148, 136, 0.15);
    --dropdown-bg: rgba(15, 23, 42, 0.97);
    --glow-accent: rgba(13, 148, 136, 0.25);
}

body {
    font-family: "Inter", sans-serif;
    background: var(--gradient-primary);
    color: var(--text-primary);
}

/* ===== PROFESSIONAL HEADER – Glassmorphism ===== */
.professional-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--header-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--header-border);
    z-index: 1000;
    padding: 0 24px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.35s ease, box-shadow 0.35s ease;
    box-shadow: 0 1px 30px rgba(0, 0, 0, 0.25);
}

.professional-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
    opacity: 0.35;
}

/* ===== LOGO ===== */
.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-symbol {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.15), rgba(13, 148, 136, 0.05));
    border: 1px solid var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--accent);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.logo-symbol::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.header-logo:hover .logo-symbol {
    transform: scale(1.08);
    box-shadow: 0 0 20px var(--glow-accent);
}

.header-logo:hover .logo-symbol::before {
    opacity: 1;
}

.header-logo:hover .logo-symbol i {
    color: #fff;
    position: relative;
    z-index: 1;
}

.logo-text {
    font-size: 19px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--accent);
    font-weight: 700;
}

/* ===== DESKTOP NAVIGATION ===== */
.desktop-nav {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 2px;
    margin: 0 30px;
    flex-grow: 1;
    justify-content: center;
}

.nav-item-dropdown {
    position: relative;
    display: inline-block;
    height: 100%;
}

.nav-dropdown-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 16px;
    height: var(--header-height);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.25s ease;
    box-sizing: border-box;
    border-bottom: 2px solid transparent;
    position: relative;
}

.nav-dropdown-toggle i:last-child {
    font-size: 0.6rem;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    opacity: 0.45;
    margin-left: 2px;
}

.nav-dropdown-toggle:hover,
.nav-item-dropdown:hover .nav-dropdown-toggle {
    color: #fff;
    border-bottom-color: var(--accent);
}

.nav-dropdown-toggle.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.nav-item-dropdown:hover .nav-dropdown-toggle i:last-child {
    transform: rotate(180deg);
}

/* ===== DESKTOP DROPDOWN MENU – Glassmorphism ===== */
.nav-dropdown-menu {
    position: absolute;
    top: calc(var(--header-height) + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: 295px;
    background: var(--dropdown-bg);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 8px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(13, 148, 136, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.25s ease,
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        visibility 0.25s ease;
}

.nav-item-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* Menu Items */
.dropdown-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.dropdown-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    transform: translateX(3px);
}

.dropdown-menu-item i {
    font-size: 1.05rem;
    color: var(--text-muted);
    width: 24px;
    text-align: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.dropdown-menu-item:hover i {
    color: var(--accent);
    transform: scale(1.1);
}

.dropdown-menu-item .item-info {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.dropdown-menu-item .item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}

.dropdown-menu-item .item-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.dropdown-menu-item:hover .item-desc {
    color: rgba(255, 255, 255, 0.55);
}

/* ===== USER AREA ===== */
.user-area {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* XP Indicator */
.xp-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.25s ease;
}

.xp-indicator:hover {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.35);
}

.xp-indicator i {
    color: #10b981;
    font-size: 11px;
}

.xp-value {
    color: #10b981;
    font-weight: 700;
}

/* ===== NOTIFICATION BUTTON ===== */
.notification-wrapper {
    position: relative;
}

.notification-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.notification-btn.has-unread::after {
    content: "";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--primary-dark);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--primary-dark);
    animation: badgePop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* ===== NOTIFICATION DROPDOWN ===== */
.notification-dropdown {
    position: absolute;
    top: 55px;
    right: -40px;
    background-color: var(--dropdown-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    width: 360px;
    height: 420px;
    z-index: 10;
    cursor: default;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(13, 148, 136, 0.06);
}

.notification-wrapper.active .notification-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Arrow on top */
.notification-dropdown::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    background-color: var(--dropdown-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-top-right-radius: 4px;
    top: 0;
    right: 42px;
    transform: translateY(-55%) rotateZ(-45deg);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.notification-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.notification-header button {
    font-size: 13px;
    color: var(--accent);
    outline: none;
    border: none;
    background-color: transparent;
    cursor: pointer;
}

.notification-content-wrapper {
    height: 310px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
    position: relative;
}

.notification-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.btn-mark-read {
    font-size: 11px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 0;
}

.btn-mark-read:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.btn-view-all {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    background: rgba(13, 148, 136, 0.1);
    padding: 5px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.btn-view-all:hover {
    background: rgba(13, 148, 136, 0.22);
    transform: translateY(-1px);
}

.btn-push-enable {
    font-size: 11px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
}

.btn-push-enable:hover {
    color: var(--accent);
}

/* Custom Scrollbar */
.notification-content-wrapper::-webkit-scrollbar {
    width: 4px;
}
.notification-content-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.notification-content-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
.notification-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Notification Items */
.notification-empty {
    color: var(--text-muted);
    font-size: 13px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    text-align: center;
}

.notification-item {
    color: var(--text-primary);
    padding: 14px 16px;
    position: relative;
    transition: all 0.25s ease;
    display: flex;
    gap: 12px;
    cursor: pointer;
    border-radius: 10px;
    margin: 0 8px 6px 8px;
}

.notification-item:hover {
    background: var(--hover-bg);
    transform: translateX(2px);
}

.notification-item.unread {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.06));
    border-left: 3px solid #3b82f6;
}

.notification-item:not(:last-of-type) {
    border-bottom: none;
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--secondary);
    position: relative;
    overflow: hidden;
}

.notification-icon::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); opacity: 0; }
    50% { transform: translate(-50%, -50%) rotate(180deg); opacity: 1; }
}

.notification-icon.welcome { background: linear-gradient(135deg, #3b82f6, #8b5cf6); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }
.notification-icon.system { background: linear-gradient(135deg, #06b6d4, #0891b2); box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3); }
.notification-icon.achievement { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); }
.notification-icon.security { background: linear-gradient(135deg, #ef4444, #b91c1c); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }

.notification-icon i {
    font-size: 16px;
    color: #fff;
    position: relative;
}

.notification-text { flex: 1; min-width: 0; }

.notification-item-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.notification-sender {
    font-size: 9px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.85;
    flex-shrink: 0;
}

.notification-separator {
    color: var(--text-muted);
    opacity: 0.5;
    font-size: 10px;
    flex-shrink: 0;
}

.notification-text h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    flex: 1;
    min-width: 0;
}

.notification-text p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.notification-time {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.7;
    font-weight: 500;
}

.unread-dot {
    position: absolute;
    top: 18px;
    right: 12px;
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* ===== PROFILE ===== */
.profile-wrapper {
    position: relative;
}

.profile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 5px 12px 5px 5px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.profile-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.profile-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.profile-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== PROFILE DROPDOWN ===== */
.profile-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    width: 350px;
    background: var(--dropdown-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(13, 148, 136, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-wrapper.active .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Arrow on top */
.profile-dropdown::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--dropdown-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-top-right-radius: 4px;
    top: 0;
    right: 5%;
    transform: rotateZ(-45deg) translate(-20%, -100%);
}

/* Profile Header */
.profile-header {
    border-bottom: 1px solid var(--border);
    padding: 10px 20px;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 120px;
}

.profile-header-content {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.profile-header-avatar {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 24px;
    color: #fff;
    overflow: hidden;
    border: 2px solid rgba(13, 148, 136, 0.3);
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.2);
}

.profile-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-header-info {
    flex: 1;
}

.profile-header-info h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
    letter-spacing: -0.2px;
}

.profile-header-info p {
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0.8;
    margin-bottom: 15px;
}

/* Level Container */
.level-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.level-container .level {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    opacity: 0.8;
}

.level-container .level strong {
    color: var(--accent);
}

.progress-bar {
    height: 8px;
    width: 70%;
    background-color: rgba(255, 255, 255, 0.06);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: visible;
}

.progress-fill {
    background: linear-gradient(90deg, var(--accent), #06b6d4);
    box-shadow: 0 0 10px rgba(13, 148, 136, 0.35);
    height: 100%;
    border-radius: 50px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.current-xp {
    position: absolute;
    color: var(--text-primary);
    left: 0;
    bottom: -100%;
    transform: translate(-50%, 200%);
    font-size: 11px;
    white-space: nowrap;
}

.level-xp {
    position: absolute;
    color: var(--text-primary);
    right: 0;
    bottom: -100%;
    transform: translateY(200%);
    font-size: 11px;
    white-space: nowrap;
}

/* Menu Items - Grouped Design */
.profile-menu {
    padding: 6px 0;
}

.menu-group {
    padding: 4px 10px;
}

.menu-group + .menu-group {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-group-admin {
    background: rgba(240, 151, 85, 0.03);
}

.menu-group-logout {
    background: rgba(239, 68, 68, 0.03);
}

.menu-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.25s ease;
    flex-shrink: 0;
    position: relative;
}

.menu-icon-wrap i {
    font-size: 12px;
    color: #94a3b8;
    transition: color 0.25s ease;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.25s ease;
    width: 100%;
    border-radius: 10px;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    transform: translateX(3px);
}

.menu-item:hover .menu-icon-wrap {
    background: rgba(13, 148, 136, 0.12);
}

.menu-item:hover .menu-icon-wrap i {
    color: var(--accent);
}

/* Admin item */
.admin-item { color: #cbd5e1; }
.admin-icon { background: rgba(240, 151, 85, 0.1) !important; }
.admin-icon i { color: #f09755 !important; }
.admin-item:hover { background: rgba(240, 151, 85, 0.08); color: #f09755; }

.menu-arrow {
    margin-left: auto;
    font-size: 9px;
    color: #475569;
    transition: all 0.25s;
}

.admin-item:hover .menu-arrow {
    color: #f09755;
    transform: translate(2px, -2px);
}

/* Logout item */
.logout-item { color: #cbd5e1; font-family: inherit; }
.logout-icon { background: rgba(239, 68, 68, 0.1) !important; }
.logout-icon i { color: #ef4444 !important; }
.logout-item:hover { background: rgba(239, 68, 68, 0.08); color: #ef4444; }

/* Admin notification badge */
.admin-badge-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--primary, #0f172a);
    animation: adminPulse 2s ease-in-out infinite;
}

.admin-badge {
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    margin-left: auto;
    line-height: 1;
}

@keyframes adminPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.3); }
}

/* ===== AUTH BUTTONS ===== */
.auth-buttons {
    display: flex;
    gap: 8px;
}

.btn-signin {
    padding: 8px 18px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn-signin:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.btn-signup {
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--accent), #06b6d4);
    border: none;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
    box-shadow: 0 2px 12px rgba(13, 148, 136, 0.3);
}

.btn-signup:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(13, 148, 136, 0.4);
}

/* ===== ANIMATED HAMBURGER BUTTON ===== */
.mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
    margin-left: 12px;
    padding: 0;
}

.mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.hamburger-lines {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 18px;
    height: 18px;
    position: relative;
}

.hamburger-lines .line {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
}

/* Animated X state */
.mobile-toggle.active .line-1 {
    transform: translateY(7px) rotate(45deg);
    background: var(--accent);
}

.mobile-toggle.active .line-2 {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-toggle.active .line-3 {
    transform: translateY(-7px) rotate(-45deg);
    background: var(--accent);
}

/* ===== MOBILE NAVIGATION OVERLAY ===== */
.mobile-nav-overlay {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 17, 32, 0.97);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    z-index: 999;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.mobile-nav-overlay.active {
    transform: translateX(0);
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 30px;
}

/* ===== MOBILE NAV LINK ===== */
.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.mobile-nav-link i {
    width: 22px;
    font-size: 15px;
    color: var(--text-muted);
    text-align: center;
    transition: color 0.25s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    color: #fff;
    background: rgba(13, 148, 136, 0.08);
    border-color: rgba(13, 148, 136, 0.15);
}

.mobile-nav-link.active i,
.mobile-nav-link:hover i {
    color: var(--accent);
}

/* ===== MOBILE ACCORDION ===== */
.mobile-accordion {
    display: flex;
    flex-direction: column;
    margin-bottom: 2px;
}

.mobile-accordion-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    width: 100%;
}

.mobile-accordion-trigger:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.mobile-accordion-trigger-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mobile-accordion-trigger-left i {
    width: 22px;
    font-size: 15px;
    color: var(--accent);
    text-align: center;
}

.mobile-accordion-chevron {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mobile-accordion.open .mobile-accordion-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

.mobile-accordion.open .mobile-accordion-trigger {
    background: rgba(13, 148, 136, 0.06);
    border-color: rgba(13, 148, 136, 0.15);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Accordion Panel */
.mobile-accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: rgba(255, 255, 255, 0.015);
    border-left: 2px solid rgba(13, 148, 136, 0.2);
    margin-left: 20px;
    border-radius: 0 0 12px 12px;
}

.mobile-accordion-panel .mobile-nav-link {
    padding: 11px 16px;
    font-size: 13px;
    border-radius: 8px;
    margin: 2px 6px;
}

.mobile-accordion-panel .mobile-nav-link i {
    font-size: 13px;
    width: 20px;
}

/* ===== MOBILE USER INFO ===== */
.mobile-user-info {
    margin-top: auto;
    padding: 20px 0;
    border-top: 1px solid var(--border);
}

.mobile-xp-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 12px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.mobile-xp-indicator i {
    color: #10b981;
}

.mobile-xp-value {
    color: #10b981;
    font-weight: 700;
}

/* Mobile Auth Buttons */
.mobile-auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.mobile-btn-signin,
.mobile-btn-signup {
    display: block;
    text-align: center;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
}

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

.mobile-btn-signin:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.mobile-btn-signup {
    background: linear-gradient(135deg, var(--accent), #06b6d4);
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.mobile-btn-signup:hover {
    box-shadow: 0 6px 22px rgba(13, 148, 136, 0.45);
    transform: translateY(-1px);
}

/* Mobile Logout */
.mobile-btn-logout {
    display: block;
    text-align: center;
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #ef4444;
    cursor: pointer;
    transition: all 0.25s ease;
}

.mobile-btn-logout:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ================================================================
   RESPONSIVE BREAKPOINTS
   ================================================================ */

/* Large Desktops (1400px+) */
@media (min-width: 1400px) {
    .professional-header {
        padding: 0 48px;
    }
    .desktop-nav {
        margin: 0 50px;
        gap: 4px;
    }
}

/* Medium Desktops (1200px - 1399px) */
@media (max-width: 1399px) {
    .professional-header {
        padding: 0 28px;
    }
    .desktop-nav {
        margin: 0 20px;
    }
    .nav-dropdown-toggle {
        padding: 0 12px;
        font-size: 0.82rem;
    }
    .user-area {
        gap: 10px;
    }
}

/* Small Desktops / Large Tablets (1024px - 1199px) */
@media (max-width: 1199px) {
    .professional-header {
        padding: 0 20px;
    }
    .desktop-nav {
        margin: 0 12px;
        gap: 0;
    }
    .nav-dropdown-toggle {
        padding: 0 10px;
        font-size: 0.8rem;
    }
    .logo-text {
        font-size: 17px;
    }
    .xp-indicator span:not(.xp-value) {
        display: none;
    }
    .xp-indicator {
        padding: 6px 10px;
    }
    .profile-dropdown {
        width: 320px;
    }
    .notification-dropdown {
        width: 330px;
        right: -30px;
    }
}

/* Tablets Landscape (below 1024px) – Switch to mobile nav */
@media (max-width: 1023px) {
    :root {
        --header-height: 60px;
    }

    .desktop-nav {
        display: none;
    }
    .mobile-toggle {
        display: flex;
    }
    .xp-indicator {
        display: none;
    }
    .profile-btn .profile-info {
        display: none;
    }
    .profile-btn {
        padding: 5px;
        border-radius: 10px;
    }
    .notification-btn,
    .profile-btn {
        width: 40px;
        height: 40px;
    }
    .profile-avatar {
        width: 30px;
        height: 30px;
    }
    .profile-dropdown {
        right: -60px;
        width: 320px;
    }
    .profile-dropdown::before {
        right: 18%;
    }
    .notification-dropdown {
        right: -100px;
        width: 320px;
    }
    .notification-dropdown::before {
        right: 30%;
    }
    .auth-buttons {
        display: none;
    }
}

/* Tablets Portrait (768px - 991px) */
@media (max-width: 991px) {
    .professional-header {
        padding: 0 16px;
    }
    .logo-symbol {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
    .logo-text {
        font-size: 16px;
    }
    .mobile-toggle {
        width: 38px;
        height: 38px;
        margin-left: 10px;
    }
    .notification-btn,
    .profile-btn {
        width: 38px;
        height: 38px;
    }
    .profile-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    .profile-dropdown,
    .notification-dropdown {
        width: 310px;
    }
}

/* Mobile Landscape (576px - 767px) */
@media (max-width: 767px) {
    .professional-header {
        padding: 0 12px;
    }
    .logo-text {
        font-size: 15px;
    }
    .logo-symbol {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    .mobile-toggle {
        width: 36px;
        height: 36px;
    }
    .notification-btn,
    .profile-btn {
        width: 36px;
        height: 36px;
    }
    .profile-avatar {
        width: 28px;
        height: 28px;
    }
    .user-area {
        gap: 8px;
    }
    .mobile-nav-overlay {
        padding: 16px;
    }
    .mobile-nav-link {
        padding: 12px 14px;
        font-size: 13.5px;
    }
    .mobile-accordion-trigger {
        padding: 12px 14px;
        font-size: 13.5px;
    }
    .profile-dropdown,
    .notification-dropdown {
        position: fixed;
        left: 10px;
        right: 10px;
        width: auto;
        top: calc(var(--header-height) + 8px);
    }
    .profile-dropdown::before,
    .notification-dropdown::before {
        display: none;
    }
}

/* Mobile Portrait (below 576px) */
@media (max-width: 575px) {
    .professional-header {
        padding: 0 10px;
    }
    .logo-text {
        display: none;
    }
    .mobile-toggle {
        margin-left: 8px;
    }
    .user-area {
        gap: 6px;
    }
    .notification-btn,
    .profile-btn {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }
    .profile-avatar {
        width: 26px;
        height: 26px;
        font-size: 11px;
        border-radius: 6px;
    }
    .mobile-nav-overlay {
        padding: 12px;
    }
    .mobile-nav-link {
        padding: 11px 12px;
        font-size: 13px;
    }
    .mobile-accordion-trigger {
        padding: 11px 12px;
        font-size: 13px;
    }
    .mobile-accordion-panel .mobile-nav-link {
        padding: 10px 12px;
        font-size: 12.5px;
    }
}

/* Ultra-small phones (below 380px) */
@media (max-width: 379px) {
    .professional-header {
        padding: 0 8px;
    }
    .mobile-toggle {
        width: 34px;
        height: 34px;
        margin-left: 6px;
    }
    .notification-btn,
    .profile-btn {
        width: 32px;
        height: 32px;
    }
    .logo-symbol {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    .mobile-nav-overlay {
        padding: 10px;
    }
}

/* Desktop-only hover effects */
@media (min-width: 1024px) {
    .nav-dropdown-toggle::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 50%;
        width: 0;
        height: 2px;
        background: linear-gradient(90deg, var(--accent), #06b6d4);
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        transform: translateX(-50%);
        border-radius: 2px;
    }

    .nav-dropdown-toggle:hover::after,
    .nav-dropdown-toggle.active::after {
        width: 70%;
    }
}

/* Improve touch targets on mobile */
@media (max-width: 1023px) {
    .notification-btn,
    .profile-btn,
    .mobile-toggle,
    .mobile-nav-link,
    .mobile-accordion-trigger {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Mobile overlay scrollbar */
.mobile-nav-overlay::-webkit-scrollbar {
    width: 3px;
}
.mobile-nav-overlay::-webkit-scrollbar-track {
    background: transparent;
}
.mobile-nav-overlay::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

/* Message Badge */
.message-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-dark);
    line-height: 1;
    z-index: 5;
}

/* Notification Username Tag */
.notification-username {
    font-weight: 600;
    color: var(--accent);
    background: rgba(13, 148, 136, 0.1);
    padding: 1px 5px;
    border-radius: 4px;
}

/* ===== GLOBAL FLASH TOASTS ===== */
.global-flash-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 14px;
    font-weight: 650;
    color: var(--text-primary);
    animation: globalFlashIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.global-flash-toast--hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
    pointer-events: none;
}

@keyframes globalFlashIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.global-flash-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.global-flash-success {
    background: rgba(13, 148, 136, 0.1);
    border: 1px solid rgba(13, 148, 136, 0.3);
}

/* ===== SEARCH STYLES (used from home page) ===== */
.search-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.search-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.search-section-title {
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-section-title i {
    font-size: 11px;
}

.search-section {
    padding: 0 6px;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.search-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.search-item-thumb {
    width: 48px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.search-item-thumb-placeholder {
    width: 48px;
    height: 36px;
    border-radius: 6px;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.search-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.search-item-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.search-item-body {
    flex: 1;
    min-width: 0;
}

.search-item-body h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item-body p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.search-item-stats {
    font-size: 11px;
    color: var(--text-muted);
}

.search-item-stats i {
    font-size: 10px;
    margin-right: 2px;
}

/* ==========================================================================
   ===== RESPONSIVE SYSTEM ALERTS & TOASTS (GLOBAL & LOCAL) =====
   ========================================================================== */

/* 1. Prevent icons from squeezing inside any alert or toast */
.global-flash-toast i,
.toast-success i,
.toast-error i,
.toast-info i,
.toast i,
.alert i,
.citation-toast i,
.careers-toast i,
.invalid-feedback i {
    flex-shrink: 0 !important;
}

/* 2. Text wrapping and alignment safety for block/fixed toasts */
.global-flash-toast,
.toast-success,
.toast-error,
.toast-info,
.toast,
.alert,
.citation-toast,
.careers-toast {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

/* 3. Global Flash Toast Responsive Overrides */
@media (max-width: 768px) {
    .global-flash-toast {
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
        max-width: none !important;
        transform: translateY(0) !important;
        font-size: 0.85rem !important;
        padding: 10px 16px !important;
        justify-content: center !important;
        top: 75px !important;
        animation: globalFlashInMobile 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    }

    .global-flash-toast--hide {
        opacity: 0 !important;
        transform: translateY(-10px) !important;
        pointer-events: none !important;
    }
}

@keyframes globalFlashInMobile {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 4. Desktop vs Mobile Fixed Toast Overlays (.toast-container / .toast) */
@media (max-width: 576px) {
    /* Mobile-App styled bottom sheets for toast overlay containers */
    .toast-container {
        position: fixed !important;
        top: auto !important;
        bottom: 24px !important;
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
        height: auto !important;
        pointer-events: none !important;
    }

    .toast {
        width: 100% !important;
        min-width: 0 !important;
        transform: translateY(120%) !important; /* Slide up from bottom */
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
        pointer-events: auto !important;
    }

    .toast.show {
        transform: translateY(0) !important;
    }
}

/* Specific Community success toast mobile overrides */
@media (max-width: 768px) {
    body .toast-success[style*="position"], 
    body .toast-success {
        /* If it's fixed (usually has top/right in style or community rules) */
    }
    
    /* Cover community.css fixed toast success */
    .toast-success:not([style*="margin-bottom"]) {
        /* When fixed, override location to bottom */
    }
}

/* 5. General Block-Level Alerts Responsive Tuning */
@media (max-width: 576px) {
    .toast-success,
    .toast-error,
    .toast-info,
    .alert,
    .invalid-feedback {
        font-size: 0.8rem !important;
        line-height: 1.45 !important;
        padding: 10px 14px !important;
    }
    
    .invalid-feedback {
        padding: 2px 0 0 !important;
        margin-top: 4px !important;
        font-size: 0.78rem !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   GLOBAL POPUPS & CONFIRMATION MODALS RESPONSIVENESS OVERRIDES
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    /* 1. Backdrop Overlays (Do NOT force display: flex unless active/show) */
    .modal-overlay,
    .premium-modal-backdrop,
    .modal-backdrop,
    [class*="modal-overlay"],
    [class*="modal-backdrop"] {
        padding: 12px !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        position: fixed !important;
        inset: 0 !important;
        z-index: 99999 !important;
    }

    /* Force flex-center ONLY when show/active class is present to keep hidden modals hidden */
    .modal-overlay.show,
    .premium-modal-backdrop.show,
    .modal-backdrop.show,
    .modal-overlay.active,
    .premium-modal-backdrop.active,
    .modal-backdrop.active,
    [class*="modal-overlay"].show,
    [class*="modal-backdrop"].show,
    [class*="modal-overlay"].active,
    [class*="modal-backdrop"].active,
    .modal-overlay[style*="display: block"],
    .modal-overlay[style*="display: flex"],
    .premium-modal-backdrop[style*="display: block"],
    .premium-modal-backdrop[style*="display: flex"] {
        display: flex !important;
    }

    /* 2. Modal Cards / Content Boxes */
    .modal-card,
    .premium-modal,
    .modal-content,
    .confirm-card,
    .confirm-modal,
    .modal-box,
    .library-modal-box,
    .apply-modal,
    [class*="modal-card"],
    [class*="modal-box"],
    [class*="confirm-card"] {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        border-radius: 20px !important;
        padding: 20px !important;
        max-height: 85vh !important;
        box-sizing: border-box !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6) !important;
        position: relative !important;
        background: #0f172a !important; /* Premium dark background */
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    /* 3. Modal Headers */
    .modal-header,
    [class*="modal-header"] {
        padding: 4px 0 12px !important;
        margin-bottom: 12px !important;
        gap: 12px !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        background: transparent !important;
    }

    .modal-header h2,
    .modal-header h3,
    [class*="modal-header"] h2,
    [class*="modal-header"] h3 {
        font-size: 1.15rem !important;
        line-height: 1.3 !important;
        margin: 0 !important;
        font-weight: 700 !important;
        color: #fff !important;
    }

    /* 4. Modal Bodies */
    .modal-body,
    [class*="modal-body"] {
        padding: 8px 0 !important;
        font-size: 0.88rem !important;
        line-height: 1.5 !important;
        color: #cbd5e1 !important;
    }

    /* 5. Modal Footers & Action Containers (Buttons side-by-side) */
    .modal-footer,
    .modal-actions,
    .confirm-actions,
    .report-modal-actions,
    [class*="modal-actions"],
    [class*="modal-footer"],
    [class*="confirm-actions"] {
        margin-top: 18px !important;
        padding: 12px 0 0 !important;
        display: flex !important;
        flex-direction: row !important; /* Keep side-by-side! */
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    /* Make action buttons share space side-by-side */
    .modal-footer button,
    .modal-actions button,
    .confirm-actions button,
    .report-modal-actions button,
    .modal-actions a,
    [class*="modal-actions"] button,
    [class*="modal-footer"] button,
    [class*="confirm-actions"] button,
    .modal-btn,
    [class*="modal-btn"] {
        flex: 1 !important; /* Share space equally */
        width: auto !important;
        margin: 0 !important;
        padding: 10px 14px !important;
        font-size: 0.82rem !important;
        font-weight: 600 !important;
        justify-content: center !important;
        display: inline-flex !important;
        align-items: center !important;
        min-height: 40px !important;
        box-sizing: border-box !important;
        border-radius: 10px !important;
    }

    /* Exception for close icon button */
    button.btn-close-modal,
    .modal-close,
    .premium-close-btn,
    [class*="close-btn"] {
        width: 32px !important;
        height: 32px !important;
        min-height: 32px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: none !important; /* Do not stretch close icon */
    }

    /* ── Custom Global Alert & Confirm Modals ── */
    #questo-custom-alert-modal,
    #questo-custom-confirm-modal {
        padding: 12px !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .questo-alert-box,
    .questo-confirm-box {
        max-width: 400px !important;
        width: 100% !important;
        padding: 24px 20px !important;
        border-radius: 16px !important;
        background: #0f172a !important;
        border: 1px solid rgba(0, 194, 168, 0.25) !important;
        box-sizing: border-box !important;
    }

    .questo-confirm-box div[style*="display: flex"] {
        display: flex !important;
        flex-direction: row !important; /* Keep buttons side-by-side */
        justify-content: center !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .questo-confirm-box button,
    #questo-custom-alert-modal button {
        flex: 1 !important; /* Equal widths */
        padding: 10px 16px !important;
        font-size: 0.88rem !important;
        border-radius: 8px !important;
        min-height: 40px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* ══════════════════════════════════════════════════════════════
   COOKIE CONSENT BANNER STYLING
   ══════════════════════════════════════════════════════════════ */
.cookie-banner {
    position: fixed;
    bottom: -180px; /* Hidden initially for animation */
    left: 24px;
    max-width: 480px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    padding: 20px;
    z-index: 999999;
    box-sizing: border-box;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    opacity: 0;
    transform: translateY(20px);
}

.cookie-banner.show {
    bottom: 24px;
    opacity: 1;
    transform: translateY(0);
}

.cookie-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.cookie-icon {
    width: 44px;
    height: 44px;
    background: rgba(0, 194, 168, 0.1);
    border: 1px solid rgba(0, 194, 168, 0.25);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00c2a8;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(0, 194, 168, 0.15);
}

.cookie-text {
    flex: 1;
}

.cookie-text h4 {
    margin: 0 0 6px 0;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.cookie-text p {
    margin: 0;
    color: #94a3b8;
    font-size: 0.8rem;
    line-height: 1.5;
}

.cookie-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    width: 120px;
}

.btn-cookie-accept {
    background: #00c2a8;
    color: #020617;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 194, 168, 0.2);
}

.btn-cookie-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(0, 194, 168, 0.35);
}

.btn-cookie-decline {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-cookie-decline:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* Responsive Cookie Banner */
@media (max-width: 600px) {
    .cookie-banner {
        left: 12px;
        right: 12px;
        bottom: -200px;
        max-width: calc(100% - 24px);
        padding: 16px;
        border-radius: 14px;
        z-index: 999999 !important;
    }

    .cookie-banner.show {
        bottom: 74px; /* Stay nicely above mobile bottom navigation bar */
    }

    .cookie-content {
        flex-direction: column;
        gap: 12px;
    }

    .cookie-icon {
        display: none; /* Hide icon on mobile to save space */
    }

    .cookie-actions {
        flex-direction: row;
        width: 100%;
        gap: 10px;
    }

    .btn-cookie-accept,
    .btn-cookie-decline {
        flex: 1;
        padding: 10px 14px;
        font-size: 0.85rem;
    }
}



