/* Background — soft neutral base */
.bg-gradient {
    background: #eef1f8;
    min-height: 100vh;
    position: relative;
}

/* Tricolor orbs — three big diagonal bands: white top-left, blue center, red bottom-right */
.bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    animation: floatOrb 25s ease-in-out infinite;
}

/* === WHITE — top === */
.bg-orb--1 {
    background: rgba(255, 255, 255, 0.9);
    width: 110vw;
    height: 45vh;
    top: -10vh;
    left: -5vw;
    filter: blur(60px);
    border-radius: 0 0 50% 50%;
}

/* === BLUE — center, large soft band === */
.bg-orb--2 {
    background: rgba(0, 57, 166, 0.13);
    width: 120vw;
    height: 35vh;
    top: 28vh;
    left: -10vw;
    filter: blur(80px);
    border-radius: 50%;
    animation-delay: -7s;
    animation-duration: 30s;
}

/* Blue accent orb floating */
.bg-orb--3 {
    background: rgba(59, 130, 246, 0.12);
    width: 350px;
    height: 350px;
    top: 25vh;
    right: 5vw;
    filter: blur(70px);
    animation-delay: -13s;
    animation-duration: 28s;
}

/* === RED — bottom, large soft band === */
.bg-orb--4 {
    background: rgba(213, 43, 30, 0.1);
    width: 120vw;
    height: 35vh;
    bottom: -5vh;
    left: -10vw;
    filter: blur(80px);
    border-radius: 50%;
    animation-delay: -4s;
    animation-duration: 32s;
}

/* Red accent orb floating */
.bg-orb--5 {
    background: rgba(239, 68, 68, 0.08);
    width: 300px;
    height: 300px;
    bottom: 10vh;
    left: 10vw;
    filter: blur(60px);
    animation-delay: -11s;
    animation-duration: 26s;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    20% { transform: translate(50px, -40px) scale(1.1); }
    40% { transform: translate(-30px, 50px) scale(0.92); }
    60% { transform: translate(40px, 20px) scale(1.06); }
    80% { transform: translate(-40px, -30px) scale(0.96); }
}

/* ==========================================
   Glass card — true frosted glass
   ========================================== */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
    position: relative;
}

/* Top highlight — simulates light refraction on glass edge */
.glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.8) 20%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(255, 255, 255, 0.8) 80%,
        transparent 100%
    );
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    pointer-events: none;
}

.glass--light {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.45);
}

.glass--solid {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.glass--hover {
    cursor: pointer;
}

.glass--hover:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.7);
}

.glass--hover:hover::before {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 1) 30%,
        rgba(255, 255, 255, 1) 70%,
        transparent 100%
    );
}

.glass--hover:active {
    transform: translateY(-2px);
}

/* ==========================================
   Glass navigation — frosted bar
   ========================================== */
.glass-nav {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 12px rgba(99, 102, 241, 0.06), inset 0 -1px 0 rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.875rem 0;
    animation: fadeIn 0.4s ease;
}

.glass-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.glass-nav__logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.15em;
}

.glass-nav__logo span {
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-nav__links {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    align-items: center;
}

.glass-nav__links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.glass-nav__links a:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.glass-nav__links a.btn--primary {
    color: var(--white);
}

.glass-nav__links a.btn--primary:hover {
    color: var(--white);
    background: linear-gradient(135deg, var(--accent-dark) 0%, #9333ea 100%);
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-3px);
}

/* ==========================================
   Glass input fields
   ========================================== */
.form-input,
.form-select {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ==========================================
   Sidebar toggle button
   ========================================== */
.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent);
}

/* ==========================================
   Sidebar overlay
   ========================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 35, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 149;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-overlay.is-open {
    display: block;
    opacity: 1;
}

/* ==========================================
   Sidebar
   ========================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 272px;
    height: 100dvh;
    z-index: 150;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border-right: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 4px 0 32px rgba(99, 102, 241, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
}

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

.sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.08);
    flex-shrink: 0;
}

.sidebar__logo {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.1em;
}

.sidebar__logo span {
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.sidebar__close:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent);
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0.75rem 2rem;
    gap: 0.15rem;
    flex: 1;
}

.sidebar__section {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 1rem 0.6rem 0.35rem;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
}

.sidebar__link:hover {
    background: rgba(99, 102, 241, 0.07);
    color: var(--accent);
}

.sidebar__link--accent {
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    color: #fff !important;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.sidebar__link--accent:hover {
    background: linear-gradient(135deg, var(--accent-dark) 0%, #9333ea 100%);
    color: #fff;
    transform: translateX(2px);
}

.sidebar__link--sm {
    font-size: 0.84rem;
    padding: 0.42rem 0.75rem;
}

.sidebar__link--more {
    color: var(--accent);
    font-weight: 600;
}

.sidebar__icon {
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}

/* ==========================================
   Fallback for no backdrop-filter
   ========================================== */
@supports not (backdrop-filter: blur(1px)) {
    .glass {
        background: rgba(255, 255, 255, 0.88);
    }
    .glass-nav {
        background: rgba(255, 255, 255, 0.92);
    }
    .glass::before {
        display: none;
    }
}

@media (max-width: 640px) {
    .glass {
        backdrop-filter: blur(24px) saturate(180%);
        -webkit-backdrop-filter: blur(24px) saturate(180%);
    }
    .bg-orb {
        filter: blur(60px);
    }
}
