/**
 * Tu Localidad - Base CSS
 * Variables, tipografia, reset, contenedores
 * Mobile-first, dark theme
 */

/* ============================================
   CSS CUSTOM PROPERTIES (Variables)
   ============================================ */
:root {
    /* Colores principales */
    --color-bg-primary: #070A12;
    --color-bg-secondary: #0D1117;
    --color-bg-tertiary: #161B22;
    --color-bg-card: rgba(22, 27, 34, 0.6);

    /* Colores de acento */
    --color-accent-primary: #7C5CFF;
    --color-accent-secondary: #00D4FF;
    --color-accent-gradient: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-secondary));

    /* Colores de texto */
    --color-text-primary: #F0F6FC;
    --color-text-secondary: #8B949E;
    --color-text-muted: #6E7681;

    /* Colores semanticos */
    --color-success: #3FB950;
    --color-warning: #D29922;
    --color-error: #F85149;
    --color-info: #58A6FF;

    /* Bordes y sombras */
    --color-border: rgba(240, 246, 252, 0.1);
    --color-border-hover: rgba(240, 246, 252, 0.2);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(124, 92, 255, 0.3);
    --shadow-glow-cyan: 0 0 20px rgba(0, 212, 255, 0.3);

    /* Glass effect */
    --glass-bg: rgba(13, 17, 23, 0.7);
    --glass-border: rgba(240, 246, 252, 0.08);
    --glass-blur: 12px;

    /* Tipografia */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-family-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Tamanos de fuente (fluid) */
    --font-size-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
    --font-size-sm: clamp(0.8125rem, 0.775rem + 0.25vw, 0.875rem);
    --font-size-base: clamp(0.9375rem, 0.9rem + 0.25vw, 1rem);
    --font-size-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.125rem);
    --font-size-xl: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
    --font-size-2xl: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
    --font-size-3xl: clamp(1.875rem, 1.5rem + 1.2vw, 2.5rem);
    --font-size-4xl: clamp(2.25rem, 1.8rem + 1.5vw, 3rem);
    --font-size-5xl: clamp(2.75rem, 2rem + 2vw, 4rem);

    /* Line heights */
    --line-height-tight: 1.2;
    --line-height-base: 1.6;
    --line-height-relaxed: 1.75;

    /* Espaciado (8px base) */
    --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 */
    --space-24: 6rem;     /* 96px */

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

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Z-index scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-tooltip: 600;

    /* Container widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1200px;
    --container-padding: var(--space-4);

    /* Header height */
    --header-height: 72px;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    :root {
        --container-padding: var(--space-6);
        --header-height: 80px;
    }
}

@media (min-width: 1024px) {
    :root {
        --container-padding: var(--space-8);
    }
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background gradient overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 92, 255, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(0, 212, 255, 0.1), transparent);
    pointer-events: none;
    z-index: -1;
}

/* ============================================
   TYPOGRAPHY BASE
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-display);
    font-weight: 700;
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-4);
}

p:last-child {
    margin-bottom: 0;
}

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

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

a:focus-visible {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

strong, b {
    font-weight: 600;
    color: var(--color-text-primary);
}

small {
    font-size: var(--font-size-sm);
}

/* ============================================
   LISTS
   ============================================ */
ul, ol {
    list-style: none;
}

/* ============================================
   IMAGES & MEDIA
   ============================================ */
img, svg, video {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ============================================
   FORMS BASE
   ============================================ */
button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

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

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ============================================
   LAYOUT CONTAINERS
   ============================================ */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.container--sm {
    max-width: var(--container-sm);
}

.container--md {
    max-width: var(--container-md);
}

.container--lg {
    max-width: var(--container-lg);
}

.container--fluid {
    max-width: none;
}

/* ============================================
   SECTION SPACING
   ============================================ */
.section {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
}

.section--sm {
    padding-top: var(--space-10);
    padding-bottom: var(--space-10);
}

.section--lg {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
}

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

/* Screen reader 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;
}

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Text colors */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent-primary); }
.text-accent-secondary { color: var(--color-accent-secondary); }

/* Gradient text */
.text-gradient {
    background: var(--color-accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.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-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.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 utilities */
.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); }

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Spacing utilities */
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.my-8 { margin-top: var(--space-8); margin-bottom: var(--space-8); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }
