:root {
    --bg-main: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-card: #FFFFFF;
    --accent-primary: #111116;
    --accent-light: #7B6EF6;
    --text-primary: #111116;
    --text-secondary: #33333F;
    --text-muted: #666677;
    --border: rgba(0, 0, 0, 0.08);
    --border-accent: rgba(123, 110, 246, 0.3);
    --success: #1EAF80;
    --font-family: 'Sora', sans-serif;
    --transition: 180ms ease;
    --container-max: 1280px;
    --radius-sm: 4px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --radius-full: 100px;
    --bg-code: #1E1E2E;
    --text-code: #D1D1E0;

    /* Responsive Font Sizes */
    --fs-h1: 64px;
    --fs-h2: 40px;
    --fs-h3: 24px;
    --fs-p: 20px;
}

@media (max-width: 1024px) {
    :root {
        --fs-h1: 48px;
        --fs-h2: 32px;
        --fs-h3: 20px;
        --fs-p: 18px;
    }
}

@media (max-width: 768px) {
    :root {
        --fs-h1: 36px;
        --fs-h2: 28px;
        --fs-h3: 18px;
        --fs-p: 16px;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global selection colors — subtle purple instead of browser blue */
::selection {
    background: rgba(123, 110, 246, 0.15);
    color: inherit;
}

/* Stronger override for dark code blocks so highlight is visible but not jarring */
pre::selection, pre *::selection,
code::selection, code *::selection {
    background: rgba(123, 110, 246, 0.35);
    color: inherit;
}

body {
    background-color: var(--bg-main);
    color: var(--text-secondary);
    font-family: var(--font-family);
    line-height: 1.75;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: -0.03em;
}

a, a:hover, a:focus, a:active, a:visited {
    color: inherit;
    text-decoration: none !important;
    transition: var(--transition);
}

button {
    font-family: inherit;
}

/* Base Layout */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
}

/* Premium Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-light) 100%);
    color: white;
}

/* Lock gradient on <a> buttons across all link states.
   Without this, browsers apply :visited / :active overrides that
   replace the gradient with a flat dark or purple background. */
a.btn-primary,
a.btn-primary:link,
a.btn-primary:visited,
a.btn-primary:hover,
a.btn-primary:focus,
a.btn-primary:active {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-light) 100%);
    color: white !important;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(123, 110, 246, 0.5);
}

a.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(123, 110, 246, 0.5);
}

.btn-primary.pulse {
    animation: btn-pulse 3s infinite;
}

@keyframes btn-pulse {
    0% { box-shadow: 0 0 0 0 rgba(123, 110, 246, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(123, 110, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(123, 110, 246, 0); }
}

/* Shimmer Text */
.shimmer-text {
    background: linear-gradient(90deg, #7B6EF6 0%, #32BEFF 50%, #7B6EF6 100%);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shimmer 4s linear infinite;
}
@keyframes shimmer {
    to { background-position: 200% center; }
}

.btn-secondary {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-secondary);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 12px;
}

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-light);
    margin-bottom: 8px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 32px;
    transition: all 400ms cubic-bezier(0.23, 1, 0.32, 1);
    border: 1px solid var(--border);
}

.card:hover {
    border-color: var(--accent-light);
}

/* Premium Breathing Backgrounds */
.hero-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.hero-glow::before, .hero-glow::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    filter: blur(60px);
}

.hero-glow::before {
    top: 45%; left: 40%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(123, 110, 246, 0.45) 0%, transparent 70%);
    animation: blob-breathe 1.2s infinite ease-in-out, blob-float 20s infinite ease-in-out;
}

.hero-glow::after {
    top: 55%; left: 60%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(50, 190, 255, 0.35) 0%, transparent 70%);
    animation: blob-breathe 1.5s infinite ease-in-out reverse, blob-float 25s infinite ease-in-out reverse;
    animation-delay: -0.6s;
}

@keyframes blob-breathe {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
}

@keyframes blob-float {
    0%, 100% { margin-top: 0; margin-left: 0; }
    33% { margin-top: -50px; margin-left: 30px; }
    66% { margin-top: 40px; margin-left: -40px; }
}

/* Scroll Animations */
[data-scroll] {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.23, 1, 0.32, 1), 
                transform 1s cubic-bezier(0.23, 1, 0.32, 1);
}

[data-scroll].in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Forms */
input, select, textarea {
    width: 100%;
    max-width: 100%;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition);
}

textarea {
    resize: vertical;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-card);
}

input[readonly] {
    opacity: 0.7;
    cursor: default;
}

label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Code Styles */
pre {
    background: #1E1E2E;
    color: #D1D1E0;
    padding: 24px;
    border-radius: var(--radius-md);
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.05);
    line-height: 1.6;
}

code {
    background: var(--bg-secondary);
    color: var(--accent-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

/* When code is inside a pre block, reset background so no per-line highlights appear */
pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

/* Responsive Helpers */
.mobile-only { display: none !important; }
.show-on-mobile { display: none !important; }
.hide-on-mobile { display: block !important; }

@media (max-width: 768px) {
    .mobile-only { display: block !important; }
    .desktop-only { display: none !important; }
    .show-on-mobile { display: block !important; }
    .hide-on-mobile { display: none !important; }
}

/* Hamburger Menu Icon */
.menu-icon {
    display: none;
    cursor: pointer;
    padding: 8px;
}
@media (max-width: 768px) {
    .menu-icon { display: block; }
}

/* Layout Utilities */
.stack-on-mobile {
    display: flex;
    flex-direction: row;
}
@media (max-width: 768px) {
    .stack-on-mobile { flex-direction: column !important; }
}

.grid-stack-on-mobile {
    display: grid;
}
@media (max-width: 768px) {
    .grid-stack-on-mobile { grid-template-columns: 1fr !important; }
}

/* Shared Sidebar & Navigation */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
}

.sidebar-logo, .logo {
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
}

.nav-group { margin-bottom: 32px; }
.nav-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
    cursor: pointer;
    text-decoration: none !important;
    transition: var(--transition);
}

.nav-item:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(123, 110, 246, 0.1);
    color: var(--accent-light);
}

.nav-item svg { width: 18px; height: 18px; opacity: 0.7; transition: var(--transition); }
.nav-item.active svg { opacity: 1; }

.dashboard-header { margin-bottom: 48px; }
.dashboard-header h1 { font-size: 32px; margin-bottom: 8px; }
.dashboard-header p { font-size: 14px; color: var(--text-muted); margin: 0; }

@media (max-width: 1024px) {
    .sidebar { 
        width: 100%; 
        height: 64px;
        flex-direction: row; 
        padding: 0 16px; 
        border-right: none; 
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        z-index: 2000;
        background: var(--bg-secondary);
        justify-content: flex-start;
        align-items: center;
        gap: 20px;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    }
    .sidebar-logo, .logo { margin-bottom: 0; font-size: 16px; min-width: auto; padding: 0; flex-shrink: 0; }
    .nav-group { 
        margin-bottom: 0; 
        display: flex; 
        gap: 8px; 
        align-items: center; 
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-right: 16px;
        flex: 1;
    }
    .nav-group::-webkit-scrollbar { display: none; }
    .nav-label { display: none; }
    .nav-item { padding: 8px 12px; font-size: 13px; white-space: nowrap; gap: 6px; flex-shrink: 0; margin-bottom: 0; }
    .nav-item svg { width: 16px; height: 16px; }
    .nav-group:last-child { margin-top: 0; display: flex !important; }
    
    .dashboard-header { flex-direction: column; align-items: flex-start !important; gap: 20px; }
    .dashboard-header h1 { font-size: 24px; }
}
