/* ===================================
   DESIGN SYSTEM - CSS VARIABLES
   Centro Psicológico Profesional
   =================================== */

:root {
    /* === Color Palette === */
    /* Primary Colors */
    --color-primary: #5B8FB9;
    --color-primary-light: #7AABCD;
    --color-primary-dark: #4A7699;
    --color-primary-rgb: 91, 143, 185;
    
    /* Secondary Colors */
    --color-secondary: #7CB89D;
    --color-accent: #B8A9C9;
    
    /* Neutral Colors */
    --color-slate-50: #f8fafc;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-300: #cbd5e1;
    --color-slate-400: #94a3b8;
    --color-slate-500: #64748b;
    --color-slate-600: #475569;
    --color-slate-700: #334155;
    --color-slate-800: #1e293b;
    --color-slate-900: #0f172a;
    
    /* Semantic Colors */
    --color-success: #7CB89D;
    --color-warning: #D4A574;
    --color-error: #C77C7C;
    --color-info: #5B8FB9;
    
    /* Background Colors */
    --color-bg-light: #F5F5F0;
    --color-bg-dark: #1a2332;
    --color-surface-light: #ffffff;
    --color-surface-dark: #2a3442;
    
    /* === Typography === */
    /* Font Families */
    --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Font Sizes - Type Scale (1.250 - Major Third) */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.563rem;    /* 25px */
    --font-size-3xl: 1.953rem;    /* 31px */
    --font-size-4xl: 2.441rem;    /* 39px */
    --font-size-5xl: 3.052rem;    /* 49px */
    --font-size-6xl: 3.815rem;    /* 61px */
    
    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    --font-weight-black: 900;
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;
    
    /* === Spacing Scale === */
    /* Based on 8px grid system */
    --spacing-1: 0.25rem;   /* 4px */
    --spacing-2: 0.5rem;    /* 8px */
    --spacing-3: 0.75rem;   /* 12px */
    --spacing-4: 1rem;      /* 16px */
    --spacing-5: 1.25rem;   /* 20px */
    --spacing-6: 1.5rem;    /* 24px */
    --spacing-8: 2rem;      /* 32px */
    --spacing-10: 2.5rem;   /* 40px */
    --spacing-12: 3rem;     /* 48px */
    --spacing-16: 4rem;     /* 64px */
    --spacing-20: 5rem;     /* 80px */
    --spacing-24: 6rem;     /* 96px */
    
    /* === Border Radius === */
    --radius-sm: 0.25rem;   /* 4px */
    --radius-base: 0.375rem; /* 6px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-2xl: 1.5rem;   /* 24px */
    --radius-3xl: 2rem;     /* 32px */
    --radius-full: 9999px;
    
    /* === Shadows === */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Colored Shadows */
    --shadow-primary: 0 10px 25px -5px rgba(var(--color-primary-rgb), 0.3);
    --shadow-primary-lg: 0 20px 35px -5px rgba(var(--color-primary-rgb), 0.4);
    
    /* === Transitions === */
    --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-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* === Z-Index Scale === */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    
    /* === Breakpoints (for reference in JS) === */
    --breakpoint-sm: 640px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1280px;
    --breakpoint-2xl: 1536px;
}

/* === Dark Mode Variables === */
.dark {
    --color-bg: var(--color-bg-dark);
    --color-surface: var(--color-surface-dark);
    --color-text: var(--color-slate-100);
    --color-text-muted: var(--color-slate-400);
}

/* Light Mode Variables */
.light {
    --color-bg: var(--color-bg-light);
    --color-surface: var(--color-surface-light);
    --color-text: var(--color-slate-900);
    --color-text-muted: var(--color-slate-600);
}

/* ===================================
   BASE STYLES
   =================================== */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* ===================================
   TYPOGRAPHY UTILITIES
   =================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
}

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

/* ===================================
   COMPONENT STYLES
   =================================== */

/* Navigation Link Styles */
.nav-link {
    position: relative;
    display: inline-block;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width var(--transition-base);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
    width: 100%;
}

/* Material Icons Configuration */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.material-symbols-filled {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ===================================
   ANIMATION CLASSES
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Utility Animation Classes */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.6s ease-out;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

/* ===================================
   ACCESSIBILITY
   =================================== */

/* Focus visible styles for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1rem;
    background-color: var(--color-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
}

.skip-to-main:focus {
    left: 1rem;
    top: 1rem;
}

/* 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-width: 0;
}

/* ===================================
   RESPONSIVE UTILITIES
   =================================== */

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-6);
    padding-right: var(--spacing-6);
}

@media (min-width: 1024px) {
    .container {
        padding-left: var(--spacing-10);
        padding-right: var(--spacing-10);
    }
}

/* ===================================
   SERVICES TABS STYLES
   =================================== */

/* Tab Navigation */
.service-tab {
    cursor: pointer;
    position: relative;
    color: var(--color-slate-600);
    background-color: transparent;
    border: none;
    outline: none;
    white-space: nowrap;
}

.dark .service-tab {
    color: var(--color-slate-400);
}

.service-tab:hover {
    background-color: var(--color-slate-100);
}

.dark .service-tab:hover {
    background-color: var(--color-slate-700);
}

.service-tab.active {
    background-color: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-lg);
}

.dark .service-tab.active {
    background-color: var(--color-primary);
}

/* Tab Content */
.tab-content {
    display: none;
    opacity: 0;
    animation: fadeInTab 0.3s ease-in-out forwards;
}

.tab-content.active {
    display: block;
    opacity: 1;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Tabs */
@media (max-width: 768px) {
    .service-tab {
        font-size: var(--font-size-xs);
        padding: var(--spacing-2) var(--spacing-4);
    }
    
    .service-tab span:last-child {
        display: none;
    }
    
    .service-tab .material-symbols-outlined {
        margin: 0;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }

    thead {
        display: table-header-group;
    }

    tr,
    img {
        page-break-inside: avoid;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}
