/* ==========================================================================
   МОСАКТИВ (MOSACTIVE) · DESIGN SYSTEM & STYLESHEET
   Refined Modern Glassmorphism, Micro-Animations & Dynamic Customization
   ========================================================================== */

:root {
    /* Dynamic Theme CSS Variables (Default: Cosmic Neon) */
    --brand-purple: #a855f7;
    --brand-purple-rgb: 168, 85, 247;
    --brand-purple-glow: rgba(168, 85, 247, 0.45);

    --brand-cyan: #06b6d4;
    --brand-cyan-rgb: 6, 182, 212;
    --brand-cyan-glow: rgba(6, 182, 212, 0.45);

    --brand-indigo: #6366f1;
    --brand-indigo-rgb: 99, 102, 241;

    --brand-rose: #f43f5e;
    --brand-emerald: #10b981;
    --brand-pink: #ec4899;

    --void-bg: #070412;
    --void-bg-rgb: 7, 4, 18;

    --card-bg: rgba(15, 11, 30, 0.65);
    --card-bg-hover: rgba(22, 16, 44, 0.85);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(255, 255, 255, 0.22);
    --glass-blur: blur(18px);

    --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
    width: 100%;
}

/* ==========================================================================
   ACCESSIBILITY & SKIP LINK (WCAG AA Compliance)
   ========================================================================== */

.skip-link {
    position: absolute;
    top: -120px;
    left: 1.5rem;
    z-index: 9999;
    padding: 0.75rem 1.25rem;
    background: var(--brand-purple);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 0.75rem;
    box-shadow: 0 0 25px var(--brand-purple-glow);
    text-decoration: none;
    transition: top 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 1.5rem;
    outline: 3px solid var(--brand-cyan);
    outline-offset: 3px;
}

:focus-visible {
    outline: 2px solid var(--brand-cyan);
    outline-offset: 2px;
}

/* ==========================================================================
   AMBIENT LIGHTING ORBS & BACKGROUND
   ========================================================================== */

body {
    background-color: var(--void-bg);
    color: #f1f5f9;
    transition: background-color 0.4s ease;
}

.site-header {
    background-color: rgba(var(--void-bg-rgb, 7, 4, 18), 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.site-footer {
    background-color: rgba(var(--void-bg-rgb, 7, 4, 18), 0.78);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.ambient-orb {
    position: absolute;
    border-radius: 9999px;
    filter: blur(140px);
    pointer-events: none;
    will-change: transform, opacity;
    transition: background 0.6s ease;
}

.ambient-orb-1 {
    width: 620px;
    height: 620px;
    top: -8rem;
    left: -8rem;
    background: radial-gradient(circle, rgba(var(--brand-purple-rgb), 0.32) 0%, rgba(var(--brand-cyan-rgb), 0.12) 60%, transparent 100%);
}

.ambient-orb-2 {
    width: 720px;
    height: 720px;
    top: 25%;
    right: -10rem;
    background: radial-gradient(circle, rgba(var(--brand-cyan-rgb), 0.26) 0%, rgba(var(--brand-purple-rgb), 0.14) 60%, transparent 100%);
}

.ambient-orb-3 {
    width: 580px;
    height: 580px;
    bottom: -10rem;
    left: 30%;
    background: radial-gradient(circle, rgba(var(--brand-indigo-rgb), 0.28) 0%, rgba(var(--brand-purple-rgb), 0.16) 60%, transparent 100%);
}

.ambient-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.45;
}

/* ==========================================================================
   GLASSMORPHISM CORE COMPONENTS
   ========================================================================== */

.glass-card,
.stat-metric-card,
.preset-theme-card,
[class*="glass-card"] {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%), var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4), inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
    transition: var(--transition-smooth);
    position: relative;
    perspective: none !important;
    -webkit-perspective: none !important;
    transform-style: flat !important;
}

.glass-card:hover,
.stat-metric-card:hover,
.preset-theme-card:hover,
[class*="glass-card"]:hover {
    border-color: var(--card-border-hover);
    box-shadow: 0 18px 50px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.14);
    perspective: none !important;
    -webkit-perspective: none !important;
    transform-style: flat !important;
}

/* Dynamic stroke following cursor around card perimeter */
.glass-card::before,
.stat-metric-card::before,
.preset-theme-card::before,
[class*="glass-card"]::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1.5px;
    background: radial-gradient(
        320px circle at var(--mouse-x, -999px) var(--mouse-y, -999px),
        rgba(var(--brand-purple-rgb, 168, 85, 247), 0.85) 0%,
        rgba(var(--brand-cyan-rgb, 6, 182, 212), 0.6) 45%,
        transparent 75%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: var(--card-glow-opacity, 0);
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.glass-card > *,
.stat-metric-card > * {
    position: relative;
    z-index: 3;
}

.glass-panel {
    background: rgba(18, 14, 34, 0.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    transition: var(--transition-smooth);
}

.glass-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transition: var(--transition-smooth);
}

.glass-input:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.glass-input:focus {
    outline: none;
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(var(--brand-purple-rgb), 0.25);
    background: rgba(255, 255, 255, 0.07);
}

/* ==========================================================================
   BUTTONS & TACTILE CONTROLS
   ========================================================================== */

.glass-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    transition: var(--transition-smooth);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transform: translateY(-1px);
}

.glass-btn:active {
    transform: scale(0.97);
}

.primary-glass-btn {
    background: linear-gradient(135deg, var(--brand-purple) 0%, var(--brand-indigo) 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    box-shadow: 0 4px 20px var(--brand-purple-glow);
}

.primary-glass-btn:hover {
    background: linear-gradient(135deg, var(--brand-purple) 0%, var(--brand-indigo) 100%);
    box-shadow: 0 6px 28px var(--brand-purple-glow), 0 0 15px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    color: #ffffff;
}

.cyan-glass-btn {
    background: linear-gradient(135deg, var(--brand-cyan) 0%, #0284c7 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    box-shadow: 0 4px 18px var(--brand-cyan-glow);
}

.cyan-glass-btn:hover {
    box-shadow: 0 6px 25px var(--brand-cyan-glow);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    color: #ffffff;
}

.danger-glass-btn {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #fda4af;
}

.danger-glass-btn:hover {
    background: rgba(244, 63, 94, 0.28);
    border-color: rgba(244, 63, 94, 0.5);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.35);
}

/* ==========================================================================
   BADGES, PILLS, MEDALS & AVATARS
   ========================================================================== */

.glow-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: "JetBrains Mono", monospace;
    background: linear-gradient(135deg, rgba(var(--brand-purple-rgb), 0.2), rgba(var(--brand-cyan-rgb), 0.12));
    border: 1px solid rgba(var(--brand-purple-rgb), 0.45);
    color: #ffffff;
    box-shadow: 0 0 16px rgba(var(--brand-purple-rgb), 0.25);
    white-space: nowrap;
}

.glow-pill-cyan {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: "JetBrains Mono", monospace;
    background: rgba(var(--brand-cyan-rgb), 0.14);
    border: 1px solid rgba(var(--brand-cyan-rgb), 0.45);
    color: #cffafe;
    box-shadow: 0 0 16px rgba(var(--brand-cyan-rgb), 0.25);
    white-space: nowrap;
}

.glow-pill-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: "JetBrains Mono", monospace;
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.2), rgba(225, 29, 72, 0.12));
    border: 1px solid rgba(244, 63, 94, 0.45);
    color: #fda4af;
    box-shadow: 0 0 16px rgba(244, 63, 94, 0.25);
    white-space: nowrap;
}

/* 3D Rank Badges with Shimmer & Glow */
.rank-badge {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    font-weight: 800;
    font-size: 0.875rem;
    user-select: none;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rank-badge:hover {
    transform: scale(1.15) rotate(4deg);
}

.rank-badge-1 {
    background: linear-gradient(135deg, #fef08a 0%, #eab308 50%, #ca8a04 100%);
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: gold-pulse 3s infinite ease-in-out;
}

@keyframes gold-pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(234, 179, 8, 0.45);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(234, 179, 8, 0.8), 0 0 45px rgba(234, 179, 8, 0.4);
        transform: scale(1.05);
    }
}

.rank-badge-2 {
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 50%, #94a3b8 100%);
    box-shadow: 0 0 16px rgba(203, 213, 225, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.rank-badge-3 {
    background: linear-gradient(135deg, #fed7aa 0%, #f97316 50%, #c2410c 100%);
    box-shadow: 0 0 16px rgba(249, 115, 22, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.rank-badge-other {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.75rem;
}

.user-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    font-family: "JetBrains Mono", monospace;
    background: linear-gradient(135deg, rgba(var(--brand-purple-rgb), 0.25), rgba(var(--brand-cyan-rgb), 0.25));
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

/* ==========================================================================
   METRIC STAT CARDS
   ========================================================================== */

.stat-metric-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%), rgba(18, 14, 34, 0.6);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 1.5rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.stat-metric-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--brand-purple), var(--brand-cyan), transparent);
    opacity: 0.4;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 4;
}

.stat-metric-card:hover {
    border-color: var(--card-border-hover);
    transform: none !important;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.45);
}

.stat-metric-card:hover::after {
    opacity: 1;
}

/* ==========================================================================
   MOBILE DOCK NAVIGATION & NAV LINKS
   ========================================================================== */

.glass-dock {
    background: rgba(14, 10, 28, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 25px rgba(var(--brand-purple-rgb), 0.2);
}

.dock-item {
    transition: var(--transition-smooth);
    border-radius: 1rem;
    position: relative;
}

.dock-item.active {
    color: #ffffff !important;
}

.dock-item.active i {
    color: var(--brand-cyan) !important;
    filter: drop-shadow(0 0 8px var(--brand-cyan));
}

.dock-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    width: 14px;
    height: 3px;
    background: var(--brand-cyan);
    border-radius: 9999px;
    box-shadow: 0 0 8px var(--brand-cyan);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Control Panel Tab Buttons */
.cp-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition-smooth);
    white-space: nowrap;
    border: 1px solid transparent;
}

.cp-tab-btn.active-tab {
    background: linear-gradient(135deg, rgba(var(--brand-purple-rgb), 0.25), rgba(var(--brand-indigo-rgb), 0.25));
    border-color: rgba(var(--brand-purple-rgb), 0.5);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(var(--brand-purple-rgb), 0.3);
}

.cp-tab-btn.inactive-tab {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

.cp-tab-btn.inactive-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.16);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

#toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 24rem;
    width: 100%;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1.125rem;
    border-radius: 1.25rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    animation: toast-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-12px) scale(0.94);
    }
}

/* ==========================================================================
   MODAL WINDOW & POPUPS
   ========================================================================== */

#modal-backdrop {
    background-color: rgba(4, 2, 10, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fade-in 0.25s ease-out;
}

#modal-box {
    animation: modal-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
   THEME PRESET CARDS & LIVE PREVIEW STYLES
   ========================================================================== */

.preset-theme-card {
    cursor: pointer;
    border-radius: 1.25rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
    position: relative;
    user-select: none;
}

.preset-theme-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.preset-theme-card.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--brand-purple);
    box-shadow: 0 0 25px rgba(var(--brand-purple-rgb), 0.35);
}

.live-preview-box {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.preview-orb {
    position: absolute;
    border-radius: 9999px;
    filter: blur(40px);
    pointer-events: none;
}

.preview-orb-1 {
    width: 180px;
    height: 180px;
    top: -30px;
    left: -30px;
}

.preview-orb-2 {
    width: 200px;
    height: 200px;
    bottom: -40px;
    right: -40px;
}

/* ==========================================================================
   GROUP EMOJI CASCADE & ACCENTS
   ========================================================================== */

.group-emoji-cascade-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.emoji-particle {
    position: absolute;
    top: -50px;
    opacity: 0.65;
    animation: emoji-fall linear infinite;
    user-select: none;
}

@keyframes emoji-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(800px) rotate(360deg);
        opacity: 0;
    }
}

.group-accent-red {
    --group-color: #ef4444;
    --group-color-rgb: 239, 68, 68;
    --brand-purple: #ef4444;
    --brand-purple-rgb: 239, 68, 68;
    --brand-purple-glow: rgba(239, 68, 68, 0.45);
}
.group-accent-orange {
    --group-color: #f97316;
    --group-color-rgb: 249, 115, 22;
    --brand-purple: #f97316;
    --brand-purple-rgb: 249, 115, 22;
    --brand-purple-glow: rgba(249, 115, 22, 0.45);
}
.group-accent-yellow {
    --group-color: #eab308;
    --group-color-rgb: 234, 179, 8;
    --brand-purple: #eab308;
    --brand-purple-rgb: 234, 179, 8;
    --brand-purple-glow: rgba(234, 179, 8, 0.45);
}
.group-accent-green {
    --group-color: #10b981;
    --group-color-rgb: 16, 185, 129;
    --brand-purple: #10b981;
    --brand-purple-rgb: 16, 185, 129;
    --brand-purple-glow: rgba(16, 185, 129, 0.45);
}
.group-accent-cyan {
    --group-color: #06b6d4;
    --group-color-rgb: 6, 182, 212;
    --brand-purple: #06b6d4;
    --brand-purple-rgb: 6, 182, 212;
    --brand-purple-glow: rgba(6, 182, 212, 0.45);
}
.group-accent-blue {
    --group-color: #3b82f6;
    --group-color-rgb: 59, 130, 246;
    --brand-purple: #3b82f6;
    --brand-purple-rgb: 59, 130, 246;
    --brand-purple-glow: rgba(59, 130, 246, 0.45);
}
.group-accent-purple {
    --group-color: #a855f7;
    --group-color-rgb: 168, 85, 247;
    --brand-purple: #a855f7;
    --brand-purple-rgb: 168, 85, 247;
    --brand-purple-glow: rgba(168, 85, 247, 0.45);
}

[class*="group-accent-"] .glass-card {
    border-color: rgba(var(--group-color-rgb, 168, 85, 247), 0.2);
}

[class*="group-accent-"] .glass-card:hover {
    border-color: rgba(var(--group-color-rgb, 168, 85, 247), 0.45);
    box-shadow: 0 18px 50px 0 rgba(0, 0, 0, 0.5), 0 0 25px rgba(var(--group-color-rgb, 168, 85, 247), 0.2);
}

[class*="group-accent-"] .group-title-accent {
    color: var(--group-color);
    text-shadow: 0 0 20px rgba(var(--group-color-rgb, 168, 85, 247), 0.4);
}

/* ==========================================================================
   SKELETON SHIMMER & LOADERS
   ========================================================================== */

.skeleton-shimmer {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite ease-in-out;
    border-radius: 0.75rem;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   CUSTOM SCROLLBARS
   ========================================================================== */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-purple);
}

/* ==========================================================================
   MODAL WINDOWS & ALERTS (SYSTEM-WIDE DIALOGS)
   ========================================================================== */

#modal-container:not(.hidden) {
    display: flex !important;
    animation: modal-fade-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

#modal-backdrop {
    background: rgba(4, 2, 14, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

#modal-box {
    animation: modal-scale-up 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center center;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modal-scale-up {
    from { opacity: 0; transform: scale(0.95) translateY(6px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ==========================================================================
   FLOWBITE-STYLE CUSTOM DARK DROPDOWNS
   Using div, ul, li, button with full Tailwind theme integration
   ========================================================================== */

.custom-flowbite-dropdown {
    position: relative;
    width: 100%;
}

.custom-flowbite-dropdown-btn {
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.875rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(15, 11, 30, 0.88);
    color: #f1f5f9;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-smooth);
    cursor: pointer;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

.custom-flowbite-dropdown-btn:hover:not(:disabled) {
    background: rgba(25, 18, 50, 0.95);
    border-color: rgba(168, 85, 247, 0.45);
    box-shadow: 0 0 16px rgba(168, 85, 247, 0.15);
}

.custom-flowbite-dropdown-btn:focus-visible {
    outline: none;
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.35);
}

.custom-flowbite-dropdown-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-flowbite-dropdown-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 60;
    background: rgba(12, 8, 25, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 30px rgba(168, 85, 247, 0.12);
    overflow: hidden;
    animation: dropdown-pop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdown-pop {
    from { opacity: 0; transform: translateY(-5px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.custom-flowbite-dropdown-item {
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.75rem;
    border-radius: 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
    cursor: pointer;
}

.custom-flowbite-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.custom-flowbite-dropdown-item.is-selected {
    background: rgba(168, 85, 247, 0.22);
    color: #ffffff;
    font-weight: 700;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

/* Fallback for any native selects or options (prevent white backgrounds in all browsers) */
select, select option, select optgroup {
    background-color: #0d0b1a !important;
    color: #f1f5f9 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* ==========================================================================
   MOBILE INTERFACE & DOCK NAVIGATION OPTIMIZATIONS
   ========================================================================== */

@media (max-width: 767px) {
    #advisor-badge,
    #guest-login-btn {
        display: none !important;
    }
}

.glass-dock {
    position: fixed;
    background: rgba(12, 8, 26, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(168, 85, 247, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    left: 0.75rem;
    right: 0.75rem;
    max-width: 480px;
    width: calc(100% - 1.5rem);
    margin: 0 auto;
    box-sizing: border-box;
    overflow: hidden;
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    padding-bottom: calc(0.375rem + env(safe-area-inset-bottom, 0px));
    z-index: 50;
}

.dock-item {
    position: relative;
    flex: 1 1 0%;
    min-width: 0;
    max-width: none;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.dock-item:active {
    transform: scale(0.92);
}

.dock-item.active {
    color: #ffffff !important;
    background: rgba(168, 85, 247, 0.18);
}

.dock-item.active i,
.dock-item.active svg {
    color: var(--brand-cyan) !important;
    filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.6));
    transform: translateY(-1px);
}

.dock-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-size: 9px;
    line-height: 1.2;
}

.dock-item.active span {
    color: #ffffff !important;
    font-weight: 700;
}

/* Interactive table rows (groups list) */
.group-row {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.group-row:hover td {
    background: rgba(255, 255, 255, 0.05);
}

.group-row:active td {
    background: rgba(168, 85, 247, 0.12);
}

/* iOS Safari auto-zoom prevention on form inputs */
@media (max-width: 640px) {
    input[type="text"],
    input[type="password"],
    input[type="date"],
    input[type="email"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Mobile ambient lighting optimization */
@media (max-width: 768px) {
    .ambient-orb {
        filter: blur(60px) !important;
        opacity: 0.55 !important;
        transform: translate3d(0, 0, 0) !important;
    }

    .ambient-orb-1 {
        width: 320px !important;
        height: 320px !important;
    }

    .ambient-orb-2 {
        width: 360px !important;
        height: 360px !important;
    }

    .ambient-orb-3 {
        width: 280px !important;
        height: 280px !important;
    }

    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
}

/* ==========================================================================
   REDUCED MOTION (WCAG AAA Compliance)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .ambient-orb {
        display: none !important;
    }

    .emoji-particle {
        display: none !important;
    }
}

