/* =====================================================
   SQLQuest – Design System Global
   Paleta: Azul escuro + Laranja SQL
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

/* ---- CSS Variables ---- */
:root {
    /* SQL Theme Colors */
    --blue: #1e88e5;
    --blue-dark: #1565c0;
    --blue-glow: rgba(30, 136, 229, 0.25);
    --orange: #ff9600;
    --orange-dark: #e65100;
    --orange-glow: rgba(255, 150, 0, 0.25);
    --cyan: #00bcd4;
    --purple: #a560f8;
    --green: #43a047;
    --red: #ea2b2b;
    --red-dark: #c01a1a;
    --gold: #ffd900;

    /* Backgrounds */
    --bg: #0a1628;
    --bg-2: #0f1f3d;
    --card: #142244;
    --card-2: #1a2d55;
    --border: #1e3a6e;
    --border-light: #2a4f8a;

    /* Text */
    --text: #e8f0fe;
    --text-muted: #7fa3d1;
    --text-dim: #4a6fa0;

    /* Spacing & Shape */
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --radius-xl: 32px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);

    /* Animation */
    --transition: 0.2s ease;
    --transition-slow: 0.4s ease;

    /* Font */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --header-h: 64px;

    /* Primary action color (orange for SQL theme) */
    --primary: var(--orange);
    --primary-dark: var(--orange-dark);
    --primary-glow: var(--orange-glow);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

a {
    color: var(--orange);
    text-decoration: none;
    transition: opacity var(--transition);
}

a:hover {
    opacity: 0.8;
}

img {
    max-width: 100%;
}

/* ---- Typography ---- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 800;
    line-height: 1.2;
    color: var(--text);
}

h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
}

h3 {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
}

p {
    color: var(--text-muted);
    line-height: 1.6;
}

small {
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.btn:active {
    transform: translateY(2px);
}

.btn-primary {
    background: var(--orange);
    color: #fff;
    box-shadow: 0 4px 0 var(--orange-dark);
}

.btn-primary:hover {
    background: var(--orange-dark);
    transform: translateY(-1px);
    box-shadow: 0 5px 0 #bf360c;
    color: #fff;
}

.btn-blue {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 4px 0 var(--blue-dark);
}

.btn-blue:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--orange);
    border: 2px solid var(--orange);
}

.btn-outline:hover {
    background: var(--orange-glow);
    color: var(--orange);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 2px solid var(--border);
}

.btn-ghost:hover {
    border-color: var(--border-light);
    color: var(--text);
}

.btn-danger {
    background: var(--red);
    color: #fff;
    box-shadow: 0 4px 0 var(--red-dark);
}

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
    border-radius: 16px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
    border-radius: 10px;
}

/* ---- Alerts ---- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.alert-error {
    background: rgba(234, 43, 43, 0.15);
    border: 1px solid rgba(234, 43, 43, 0.4);
    color: #ff8080;
}

.alert-success {
    background: rgba(67, 160, 71, 0.15);
    border: 1px solid rgba(67, 160, 71, 0.4);
    color: #81c784;
}

/* ---- App Header ---- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--header-h);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-logo {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.header-logo span {
    color: var(--orange);
}

/* ---- SQL Code Styling ---- */
code,
.sql-code {
    font-family: var(--font-mono);
    background: rgba(255, 150, 0, 0.1);
    border: 1px solid rgba(255, 150, 0, 0.2);
    padding: 2px 8px;
    border-radius: 6px;
    color: var(--orange);
    font-size: 0.9em;
}

/* ---- Utility ---- */
.text-orange {
    color: var(--orange);
}

.text-blue {
    color: var(--blue);
}

.text-green {
    color: var(--green);
}

.text-red {
    color: var(--red);
}

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

/* ---- Badge de Nível ---- */
.nivel-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nivel-iniciante {
    background: rgba(67, 160, 71, 0.2);
    color: #81c784;
    border: 1px solid rgba(67, 160, 71, 0.4);
}

.nivel-intermediario {
    background: rgba(255, 150, 0, 0.2);
    color: #ffb74d;
    border: 1px solid rgba(255, 150, 0, 0.4);
}

.nivel-avancado {
    background: rgba(165, 96, 248, 0.2);
    color: #ce93d8;
    border: 1px solid rgba(165, 96, 248, 0.4);
}

/* ---- Modais ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.modal-box {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

/* ---- Animações ---- */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---- Scrollbar SQL ---- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-2);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}