/* ==========================================================================
   MAPLYTICS DESIGN SYSTEM
   Dark/Light Theme Support
   ========================================================================== */

:root {
    /* Dark Theme (Default) */
    --bg-base: #09090b;
    --bg-surface: #18181b;
    --bg-elevated: #27272a;
    --bg-hover: #3f3f46;
    --bg-active: #52525b;

    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-inverse: #09090b;

    --border-default: #27272a;
    --border-subtle: #3f3f46;
    --border-strong: #52525b;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #f87171 100%);

    /* Solid Colors */
    --accent-primary: #6366f1;
    --accent-primary-hover: #818cf8;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-pink: #d946ef;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);

    /* Glass Effect */
    --glass-bg: rgba(24, 24, 27, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme */
[data-theme="light"] {
    --bg-base: #fafafa;
    --bg-surface: #ffffff;
    --bg-elevated: #f4f4f5;
    --bg-hover: #e4e4e7;
    --bg-active: #d4d4d8;

    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    --text-inverse: #fafafa;

    --border-default: #e4e4e7;
    --border-subtle: #d4d4d8;
    --border-strong: #a1a1aa;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary-hover);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md), 0 0 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.4);
    color: white;
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ==========================================================================
   CARDS
   ========================================================================== */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    padding: 24px;
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* ==========================================================================
   THEME TOGGLE
   ========================================================================== */
.theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 18px;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--border-subtle);
    transform: scale(1.05);
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */
.text-center { text-align: center; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }

.bg-base { background: var(--bg-base); }
.bg-surface { background: var(--bg-surface); }
.bg-elevated { background: var(--bg-elevated); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-sm { max-width: 800px; }
.container-lg { max-width: 1400px; }
