/* ============================================================
   PONTOAZT — Design System
   Tokens, variáveis, reset e base visual
   ============================================================ */

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

/* ============================================================
   CSS CUSTOM PROPERTIES (TOKENS)
   ============================================================ */
:root {
    /* === Cores Primárias === */
    --primary-50: #fff7ed;
    --primary-100: #ffedd5;
    --primary-200: #fed7aa;
    --primary-300: #fdba74;
    --primary-400: #fb923c;
    --primary-500: #f97316;
    --primary-600: #ea580c;
    --primary-700: #c2410c;
    --primary-800: #9a3412;
    --primary-900: #7c2d12;

    /* === Cores de Acento === */
    --accent-cyan: #06b6d4;
    --accent-teal: #14b8a6;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    --accent-violet: #8b5cf6;

    /* === Cores de Status === */
    --success-light: #d1fae5;
    --success: #10b981;
    --success-dark: #059669;
    --warning-light: #fef3c7;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --danger-light: #fee2e2;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --info-light: #dbeafe;
    --info: #3b82f6;
    --info-dark: #2563eb;

    /* === Neutros (Light Mode) === */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-surface-active: #e2e8f0;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: #1e293b;
    --bg-sidebar-active: #334155;
    --bg-input: #ffffff;
    --bg-overlay: rgba(15, 23, 42, 0.5);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-inverse: #f8fafc;
    --text-sidebar: #cbd5e1;
    --text-sidebar-active: #ffffff;
    --text-link: #4f46e5;

    --border-color: #e2e8f0;
    --border-color-strong: #cbd5e1;
    --border-color-focus: #818cf8;
    --border-input: #d1d5db;

    /* === Tipografia === */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;

    --font-light: 300;
    --font-regular: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;

    /* === Espaçamento === */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* === Sombras === */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);

    /* === Border Radius === */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* === Transições === */
    --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);
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* === Z-Index === */
    --z-dropdown: 50;
    --z-sticky: 100;
    --z-fixed: 200;
    --z-modal-backdrop: 300;
    --z-modal: 400;
    --z-toast: 500;
    --z-tooltip: 600;

    /* === Layout === */
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 64px;
    --topbar-height: 64px;
    --content-max-width: 1400px;
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] {
    --bg-body: #0b0f1a;
    --bg-surface: #111827;
    --bg-surface-elevated: #1e293b;
    --bg-surface-hover: #1e293b;
    --bg-surface-active: #334155;
    --bg-sidebar: #070b14;
    --bg-sidebar-hover: #111827;
    --bg-sidebar-active: #1e293b;
    --bg-input: #1e293b;
    --bg-overlay: rgba(0, 0, 0, 0.7);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-link: #818cf8;

    --border-color: #1e293b;
    --border-color-strong: #334155;
    --border-input: #374151;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.25);
}

/* ============================================================
   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;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    font-weight: var(--font-regular);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-body);
    min-height: 100vh;
    overflow-x: hidden;
}

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

img, video { max-width: 100%; height: auto; display: block; }

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

table { border-collapse: collapse; width: 100%; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

::selection {
    background: var(--primary-200);
    color: var(--primary-900);
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--border-color-focus);
    outline-offset: 2px;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

/* Gradients */
.gradient-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
}
.gradient-accent {
    background: linear-gradient(135deg, var(--accent-cyan), var(--primary-500));
}
.gradient-success {
    background: linear-gradient(135deg, var(--accent-emerald), var(--accent-teal));
}
.gradient-warm {
    background: linear-gradient(135deg, var(--accent-amber), var(--accent-rose));
}
.gradient-mesh {
    background: 
        radial-gradient(at 40% 20%, var(--primary-100) 0px, transparent 50%),
        radial-gradient(at 80% 0%, #dbeafe 0px, transparent 50%),
        radial-gradient(at 0% 50%, #c7d2fe 0px, transparent 50%);
}

/* Text */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-500), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.animate-fadeIn { animation: fadeIn var(--transition-slow) ease-out; }
.animate-fadeInUp { animation: fadeInUp var(--transition-slow) ease-out; }
.animate-fadeInDown { animation: fadeInDown var(--transition-fast) ease-out; }
.animate-slideInRight { animation: slideInRight var(--transition-slow) ease-out; }
.animate-scaleIn { animation: scaleIn var(--transition-base) ease-out; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* SR Only */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Truncate */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
