/* STEM IA - Professional SaaS Theme with Light/Dark Mode */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* ========== DARK MODE ========== */
    --dm-bg-primary: #0f1117;
    --dm-bg-secondary: #161b22;
    --dm-bg-tertiary: #21262d;
    --dm-bg-hover: #30363d;

    --dm-text-primary: #ffffff;
    --dm-text-secondary: #c9d1d9;
    --dm-text-tertiary: #8b949e;

    --dm-border: #30363d;

    /* ========== LIGHT MODE ========== */
    --lm-bg-primary: #ffffff;
    --lm-bg-secondary: #f6f8fa;
    --lm-bg-tertiary: #eaeef2;
    --lm-bg-hover: #d0d7de;

    --lm-text-primary: #0d1117;
    --lm-text-secondary: #424a55;
    --lm-text-tertiary: #6e7681;

    --lm-border: #d0d7de;

    /* ========== ACCENT COLORS (BOTH MODES) ========== */
    --accent-primary: #0969da;
    --accent-secondary: #1f6feb;
    --accent-hover: #388bfd;

    --success: #1a7f37;
    --warning: #9e6a03;
    --error: #da3633;
    --info: #0969da;

    /* ========== TYPOGRAPHY ========== */
    --font-primary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Monaco', 'Menlo', monospace;

    /* ========== SPACING ========== */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* ========== RADIUS ========== */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* ========== TRANSITIONS ========== */
    --duration-fast: 100ms;
    --duration-base: 200ms;
    --duration-slow: 300ms;
    --timing: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Default = Dark Mode */
:root {
    --bg-primary: var(--dm-bg-primary);
    --bg-secondary: var(--dm-bg-secondary);
    --bg-tertiary: var(--dm-bg-tertiary);
    --bg-hover: var(--dm-bg-hover);
    --text-primary: var(--dm-text-primary);
    --text-secondary: var(--dm-text-secondary);
    --text-tertiary: var(--dm-text-tertiary);
    --border: var(--dm-border);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Light Mode */
html[data-theme="light"] {
    --bg-primary: var(--lm-bg-primary);
    --bg-secondary: var(--lm-bg-secondary);
    --bg-tertiary: var(--lm-bg-tertiary);
    --bg-hover: var(--lm-bg-hover);
    --text-primary: var(--lm-text-primary);
    --text-secondary: var(--lm-text-secondary);
    --text-tertiary: var(--lm-text-tertiary);
    --border: var(--lm-border);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--duration-base) var(--timing);
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
}

h1 { font-size: 2.5rem; font-weight: 900; }
h2 { font-size: 2rem; font-weight: 800; }
h3 { font-size: 1.5rem; font-weight: 700; }
h4 { font-size: 1.25rem; font-weight: 600; }
h5 { font-size: 1.125rem; font-weight: 600; }
h6 { font-size: 1rem; font-weight: 600; }

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
    line-height: 1.6;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--duration-base) var(--timing);
}

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

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all var(--duration-base) var(--timing);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

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

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

/* ========== CARDS ========== */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    transition: all var(--duration-base) var(--timing);
}

.card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--duration-base) var(--timing);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

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

/* ========== HEADER ========== */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: var(--space-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all var(--duration-base) var(--timing);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--accent-primary);
    font-family: var(--font-primary);
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.1rem;
    transition: all var(--duration-base) var(--timing);
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

/* ========== LAYOUT ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-xl);
}

.grid {
    display: grid;
    gap: var(--space-xl);
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

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

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

/* ========== BADGES ========== */
.badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    transition: all var(--duration-base) var(--timing);
}

.badge-primary {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* ========== PROGRESS ========== */
.progress {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
    border-radius: 3px;
    transition: width var(--duration-slow) var(--timing);
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn var(--duration-base) var(--timing);
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ========== SELECTION ========== */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* ========== FOCUS ========== */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}
