/**
 * SmartDect.ro - Design System v2.0 FIXED
 * Normalización completa y tamaños consistentes
 * @author SmartDect Team
 */

/* ============================================
   CSS VARIABLES - COLOR SYSTEM
   ============================================ */

:root {
    /* Primary Colors */
    --primary: #5bec13;
    --primary-hover: #4ed310;
    --primary-light: rgba(91, 236, 19, 0.1);
    --primary-border: rgba(91, 236, 19, 0.3);
    --primary-glow: rgba(91, 236, 19, 0.5);

    /* Background Colors */
    --background-dark: #162210;
    --background-light: #f6f8f6;
    --surface-dark: #1f2d18;
    --surface-light: #2a3b20;

    /* Border Colors */
    --border-dark: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.15);

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;
    --text-dark: #0f172a;

    /* Semantic Colors */
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    --error-light: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.1);

    /* Glassmorphism */
    --glass-bg: rgba(22, 34, 16, 0.85);
    --glass-bg-light: rgba(31, 45, 24, 0.5);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(12px);
}

/* ============================================
   TYPOGRAPHY SYSTEM (FIXED)
   ============================================ */

:root {
    /* Font Families */
    --font-display: 'Public Sans', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Monaco', 'Courier New', monospace;

    /* Font Sizes - NORMALIZADOS */
    --text-xs: 0.75rem;
    /* 12px */
    --text-sm: 0.875rem;
    /* 14px */
    --text-base: 1rem;
    /* 16px - ARREGLADO */
    --text-lg: 1.125rem;
    /* 18px */
    --text-xl: 1.25rem;
    /* 20px */
    --text-2xl: 1.5rem;
    /* 24px */
    --text-3xl: 1.875rem;
    /* 30px */
    --text-4xl: 2.25rem;
    /* 36px */
    --text-5xl: 3rem;
    /* 48px */

    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-black: 900;

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;
}

/* ============================================
   SPACING SYSTEM
   ============================================ */

:root {
    --space-0: 0;
    --space-1: 0.25rem;
    /* 4px */
    --space-2: 0.5rem;
    /* 8px */
    --space-3: 0.75rem;
    /* 12px */
    --space-4: 1rem;
    /* 16px */
    --space-5: 1.25rem;
    /* 20px */
    --space-6: 1.5rem;
    /* 24px */
    --space-8: 2rem;
    /* 32px */
    --space-10: 2.5rem;
    /* 40px */
    --space-12: 3rem;
    /* 48px */
    --space-16: 4rem;
    /* 64px */
    --space-20: 5rem;
    /* 80px */
}

/* ============================================
   BORDER RADIUS
   ============================================ */

:root {
    --radius-sm: 0.25rem;
    /* 4px */
    --radius-md: 0.5rem;
    /* 8px */
    --radius-lg: 0.75rem;
    /* 12px */
    --radius-xl: 1rem;
    /* 16px */
    --radius-2xl: 1.5rem;
    /* 24px */
    --radius-full: 9999px;
}

/* ============================================
   SHADOWS & EFFECTS
   ============================================ */

:root {
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px var(--primary-glow);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.3s ease;
}

/* ============================================
   Z-INDEX SCALE
   ============================================ */

:root {
    --z-base: 1;
    --z-dropdown: 10;
    --z-sticky: 20;
    --z-fixed: 30;
    --z-modal: 50;
}

/* ============================================
   GLOBAL RESETS & NORMALIZATION
   ============================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    /* Base rem size */
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-display);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--background-dark);
    background-image: radial-gradient(circle at top center, #1b1b1b, var(--background-dark) 60%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Normalize headings */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

h1 {
    font-size: var(--text-4xl);
}

h2 {
    font-size: var(--text-3xl);
}

h3 {
    font-size: var(--text-2xl);
}

h4 {
    font-size: var(--text-xl);
}

h5 {
    font-size: var(--text-lg);
}

h6 {
    font-size: var(--text-base);
}

/* Normalize paragraphs and links */
p {
    margin: 0;
    line-height: var(--leading-relaxed);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */

.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.container-wide {
    max-width: 1400px;
}

.container-narrow {
    max-width: 800px;
}

/* ============================================
   FLEX & GRID UTILITIES
   ============================================ */

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.flex-col {
    flex-direction: column;
}

.flex-1 {
    flex: 1 1 0%;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: var(--space-1);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.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);
}

.col-span-1 {
    grid-column: span 1 / span 1;
}

.col-span-2 {
    grid-column: span 2 / span 2;
}

.col-span-3 {
    grid-column: span 3 / span 3;
}

.col-span-4 {
    grid-column: span 4 / span 4;
}

.col-span-full {
    grid-column: 1 / -1;
}

/* ============================================
   TYPOGRAPHY UTILITIES
   ============================================ */

.text-xs {
    font-size: var(--text-xs);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-base {
    font-size: var(--text-base);
}

.text-lg {
    font-size: var(--text-lg);
}

.text-xl {
    font-size: var(--text-xl);
}

.text-2xl {
    font-size: var(--text-2xl);
}

.text-3xl {
    font-size: var(--text-3xl);
}

.text-4xl {
    font-size: var(--text-4xl);
}

.text-5xl {
    font-size: var(--text-5xl);
}

.font-light {
    font-weight: var(--font-light);
}

.font-normal {
    font-weight: var(--font-normal);
}

.font-medium {
    font-weight: var(--font-medium);
}

.font-semibold {
    font-weight: var(--font-semibold);
}

.font-bold {
    font-weight: var(--font-bold);
}

.font-black {
    font-weight: var(--font-black);
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.uppercase {
    text-transform: uppercase;
}

.lowercase {
    text-transform: lowercase;
}

.capitalize {
    text-transform: capitalize;
}

/* ============================================
   COLOR UTILITIES
   ============================================ */

.text-primary {
    color: var(--primary);
}

.text-white {
    color: var(--text-primary);
}

.text-muted {
    color: var(--text-muted);
}

.text-subtle {
    color: var(--text-subtle);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-error {
    color: var(--error);
}

.text-info {
    color: var(--info);
}

.bg-primary {
    background-color: var(--primary);
}

.bg-surface {
    background-color: var(--surface-dark);
}

.bg-dark {
    background-color: var(--background-dark);
}

/* ============================================
   SPACING UTILITIES
   ============================================ */

.p-0 {
    padding: 0;
}

.p-2 {
    padding: var(--space-2);
}

.p-3 {
    padding: var(--space-3);
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

.p-8 {
    padding: var(--space-8);
}

.m-0 {
    margin: 0;
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-3 {
    margin-bottom: var(--space-3);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.mb-12 {
    margin-bottom: var(--space-12);
}

/* ============================================
   DISPLAY & VISIBILITY
   ============================================ */

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.hidden {
    display: none;
}

/* ============================================
   GLASSMORPHISM
   ============================================ */

.glass {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

.glass-light {
    background: var(--glass-bg-light);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
}

/* ============================================
   RESPONSIVE DESIGN (MOBILE FIRST)
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    /* Grid responsiveness */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: var(--text-3xl);
    }

    h2 {
        font-size: var(--text-2xl);
    }
}

@media (min-width: 769px) {
    .md\:block {
        display: block;
    }

    .md\:hidden {
        display: none;
    }

    .md\:flex {
        display: flex;
    }

    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .md\:col-span-1 {
        grid-column: span 1 / span 1;
    }

    .md\:col-span-2 {
        grid-column: span 2 / span 2;
    }

    .md\:col-span-3 {
        grid-column: span 3 / span 3;
    }

    .md\:col-span-4 {
        grid-column: span 4 / span 4;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {

    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   POSITIONING UTILITIES
   ============================================ */

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}

.top-0 {
    top: 0;
}

.right-0 {
    right: 0;
}

.bottom-0 {
    bottom: 0;
}

.left-0 {
    left: 0;
}

.top-full {
    top: 100%;
}

.z-0 {
    z-index: 0;
}

.z-10 {
    z-index: 10;
}

.z-20 {
    z-index: 20;
}

.z-30 {
    z-index: 30;
}

.z-40 {
    z-index: 40;
}

.z-50 {
    z-index: 50;
}

.z-dropdown {
    z-index: var(--z-dropdown);
}

.z-sticky {
    z-index: var(--z-sticky);
}

.z-fixed {
    z-index: var(--z-fixed);
}

.z-modal {
    z-index: var(--z-modal);
}

/* ============================================
   SIZING UTILITIES
   ============================================ */

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.w-screen {
    width: 100vw;
}

.h-screen {
    height: 100vh;
}

.w-56 {
    width: 14rem;
}

/* 224px */
.w-64 {
    width: 16rem;
}

/* 256px */
.w-72 {
    width: 18rem;
}

/* 288px */
.w-80 {
    width: 20rem;
}

/* 320px */
.w-96 {
    width: 24rem;
}

/* 384px */

.h-auto {
    height: auto;
}

.shadow-xl {
    box-shadow: var(--shadow-xl);
}

.fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}