:root {
    --bg-dark: #131a2b;
    --card-bg: rgba(30, 38, 58, 0.75);
    --card-border: rgba(139, 92, 246, 0.18);
    --primary: #7c3aed;
    --primary-glow: #8b5cf6;
    --primary-light: #a78bfa;
    --accent: #06b6d4;
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Ambient Glow Background */
.bg-glow {
    position: fixed;
    top: -15%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1000px;
    height: 700px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, rgba(6, 182, 212, 0.08) 45%, rgba(19, 26, 43, 0) 100%);
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
}

/* Header Navigation */
header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(19, 26, 43, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}
.logo-img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(139, 92, 246, 0.45);
    object-fit: cover;
}

/* Desktop Nav */
/* The full link list only ever renders inside the dropdown menu now (see
   .mobile-menu-overlay below) - .nav-links itself is unused markup-wise
   but kept defined in case it's ever reintroduced for a wide viewport. */
.nav-links {
    display: none;
    gap: 28px;
    align-items: center;
}
.nav-links a {
    color: var(--text-sub);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}
.nav-links a:hover, .nav-links a.active { color: #fff; }

/* Menu Trigger Button - opens the dropdown on every viewport size, not
   just mobile, so the header stays a compact logo + language switcher +
   one button regardless of how many nav items there are. */
.mobile-toggle-btn {
    display: inline-flex;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #fff;
    padding: 8px 14px;
    border-radius: 12px;
    cursor: pointer;
    outline: none;
    font-weight: 600;
    font-size: 0.9rem;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.mobile-toggle-btn:active {
    transform: scale(0.95);
}
.mobile-toggle-btn svg { width: 22px; height: 22px; fill: currentColor; }

/* Fullscreen Mobile Navigation Modal Overlay */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(19, 26, 43, 0.96);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Modal Header */
.mobile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 24px;
}

.mobile-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}
.mobile-close-btn svg { width: 24px; height: 24px; fill: currentColor; }
.mobile-close-btn:hover { background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.4); }

/* Mobile Navigation Links Cards */
.mobile-menu-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 16px;
    padding: 14px 18px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    transition: all 0.25s ease;
}

.mobile-menu-item:hover, .mobile-menu-item:active {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary-glow);
    transform: translateX(4px);
    color: #fff;
}

.mobile-menu-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-light);
}

.mobile-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary-glow), #6d28d9);
    color: #fff;
    box-shadow: 0 4px 22px rgba(139, 92, 246, 0.4);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.6);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.4);
}

/* Main Content Wrapper */
main {
    flex: 1;
    width: 100%;
}

/* Footer */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 36px 20px;
    text-align: center;
    color: var(--text-sub);
    font-size: 0.9rem;
    background: rgba(19, 26, 43, 0.95);
    margin-top: auto;
}
footer a { color: var(--primary-light); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Dashing.io Dashboard Widget Grid & Animations */
.dashing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.dashing-widget {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 26px;
    padding: 32px 24px;
    text-align: center;
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 220px;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.dashing-widget:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.dashing-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashing-val {
    font-family: 'Outfit', sans-serif;
    font-size: 3.4rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--accent);
    margin: 12px 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}

.dashing-meta {
    font-size: 0.85rem;
    color: var(--text-sub);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 14px;
    border-radius: 12px;
}

/* Dashing Flash & Pulse Animations */
@keyframes dashing-flash {
    0% {
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.8), inset 0 0 20px rgba(6, 182, 212, 0.35);
        border-color: rgba(6, 182, 212, 0.9);
        background: rgba(6, 182, 212, 0.16);
    }
    35% {
        box-shadow: 0 0 35px 8px rgba(139, 92, 246, 0.65), inset 0 0 25px rgba(139, 92, 246, 0.4);
        border-color: rgba(139, 92, 246, 0.85);
        background: rgba(139, 92, 246, 0.22);
    }
    100% {
        box-shadow: none;
        border-color: var(--card-border);
        background: var(--card-bg);
    }
}

@keyframes value-pop {
    0% { transform: scale(1); }
    30% { transform: scale(1.18); color: #38bdf8; text-shadow: 0 0 20px rgba(56, 189, 248, 0.9); }
    100% { transform: scale(1); }
}

.dashing-widget.dashing-update {
    animation: dashing-flash 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dashing-widget.dashing-update .dashing-val {
    animation: value-pop 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Dashing Widget Grid Responsiveness - matches the 900px/600px
   breakpoints home_content.tmpl.html's own inline <style> uses for every
   other homepage section grid (.grid-3, .partners-grid, ...); .dashing-
   grid lives here instead since its base rules do too, but it needs the
   same treatment or it's the one 3-up grid on the page that never
   collapses, squeezing "22.5°C"-sized text into ~100px-wide cards on a
   phone. */
@media (max-width: 900px) {
    .dashing-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 600px) {
    .dashing-widget {
        min-height: 0;
        padding: 24px 20px;
    }
    .dashing-val {
        font-size: 2.6rem;
        margin: 8px 0;
    }
}

/* Mobile Header & Navigation Responsiveness */
@media (max-width: 600px) {
    .header-container {
        padding: 10px 14px;
        gap: 8px;
    }
    .logo {
        font-size: 1.15rem;
        gap: 8px;
    }
    .logo-img {
        width: 30px;
        height: 30px;
    }
    .header-actions {
        gap: 8px;
    }
    .lang-switcher select {
        padding: 6px 8px;
        font-size: 0.8rem;
        max-width: 110px;
        border-radius: 8px;
    }
    .mobile-toggle-btn {
        padding: 6px 10px;
        font-size: 0.82rem;
        gap: 6px;
        border-radius: 10px;
    }
    .mobile-menu-overlay {
        padding: 16px;
    }
    .mobile-modal-header {
        margin-bottom: 14px;
        padding-bottom: 12px;
    }
    .mobile-menu-list {
        gap: 8px;
        margin-bottom: 16px;
    }
    .mobile-menu-item {
        padding: 10px 14px;
        font-size: 0.95rem;
        gap: 12px;
        border-radius: 12px;
    }
    .mobile-menu-icon {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
    .mobile-actions {
        gap: 8px;
        margin-top: 10px;
    }
    .mobile-actions .btn {
        padding: 10px 16px;
        font-size: 0.88rem;
    }
}

@media (max-width: 420px) {
    .header-container {
        padding: 8px 10px;
    }
    .logo {
        font-size: 1.02rem;
        gap: 6px;
    }
    .logo-img {
        width: 26px;
        height: 26px;
    }
    .mobile-toggle-btn span {
        display: none;
    }
    .mobile-toggle-btn {
        padding: 6px 8px;
    }
    .lang-switcher select {
        max-width: 82px;
        padding: 5px 6px;
        font-size: 0.76rem;
    }
}
