/* ==============================================
   MODERNIZED MAIN STYLES - PROFESSIONAL & CLEAN
   ============================================== */

/* Reset and Base Variables */
:root {
    /* Modern Professional Color Palette */
    --primary-color: #2563eb;           /* Professional blue */
    --primary-hover: #1d4ed8;         /* Deeper blue */
    --primary-light: #dbeafe;         /* Very light blue */
    --secondary-color: #64748b;       /* Modern gray */
    --secondary-hover: #475569;       /* Darker gray */
    --accent-color: #8b5cf6;          /* Sophisticated purple */
    --accent-light: #f3e8ff;          /* Light purple */

    /* Semantic Colors */
    --success-color: #10b981;          /* Modern green */
    --warning-color: #f59e0b;          /* Warm orange */
    --error-color: #ef4444;           /* Modern red */
    --info-color: #06b6d4;            /* Modern cyan */

    /* Neutral Scale - More Readable */
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;

    /* Clean Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --modal-backdrop: rgba(255, 255, 255, 0.8);
    --modal-blur: blur(3px);
    --bg-muted: #f5f5f5;
    --bg-accent: #f8fafc;
    --bg-overlay: rgba(255, 255, 255, 0.8);

    /* Borders - Subtle but Clear */
    --border-subtle: #e5e5e5;
    --border-medium: #d4d4d4;
    --border-strong: #a3a3a3;

    /* Refined Shadow System */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Modern Typography Scale */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --text-display: 3rem;      /* 48px - Headlines */
    --text-headline: 2rem;     /* 32px - Sub-headlines */
    --text-title: 1.5rem;      /* 24px - Section titles */
    --text-body: 1rem;         /* 16px - Body text */
    --text-caption: 0.875rem;  /* 14px - Captions */
    --text-small: 0.75rem;     /* 12px - Small text */

    /* Professional Spacing Scale */
    --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 */

    /* Border Radius Scale */
    --radius-sm: 0.375rem;     /* 6px */
    --radius-md: 0.5rem;       /* 8px */
    --radius-lg: 0.75rem;      /* 12px */
    --radius-xl: 1rem;         /* 16px */
    --radius-2xl: 1.5rem;      /* 24px */

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* Light Theme (Default Professional) */
:root {
    --text-primary: #171717;    /* neutral-900 */
    --text-secondary: #525252;  /* neutral-600 */
    --text-muted: #737373;      /* neutral-500 */
    --text-inverse: #ffffff;
}

/* Dark Theme - Variables centralizadas en core/themes.css */
/* Nota: Todas las variables de tema oscuro están definidas en core/themes.css */

/* Base Styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    color: var(--text-primary);
    background: var(--bg-primary);
    font-size: var(--text-body);
    line-height: 1.6;
    min-height: 100vh;
}

/* Links */
a {
    color: var(--text-link);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* Utility Classes */
.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;
}

.visually-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-caption);
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-inverse);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--text-inverse);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-small);
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-body);
}

.btn-full {
    width: 100%;
}

/* Form Elements */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-body);
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right var(--space-3) center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: var(--space-10);
}

/* Card Components */
.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-accent);
}

.card-body {
    padding: var(--space-6);
}

.card-title {
    margin: 0;
    font-size: var(--text-title);
    font-weight: 600;
    color: var(--text-primary);
}

.card-subtitle {
    margin: var(--space-2) 0 0 0;
    font-size: var(--text-caption);
    color: var(--text-secondary);
}

.card-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-accent);
}

/* ====================================================
   COMPONENTES ESPECÍFICOS EXTRAÍDOS A MÓDULOS:
   - Header público → components/public-header.css
   - Hero section → components/public-hero.css
   - Stats section → components/public-stats.css
   - Features grid → components/public-features.css
   - Footer → layout/footer.css
   ==================================================== */


/* Responsive Design - General utilities only */
/* Component-specific responsive styles moved to their own files */

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --border-subtle: var(--border-strong);
        --shadow-sm: none;
        --shadow-md: none;
        --shadow-lg: none;
    }
}

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

/* Skip Links */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius-md);
    z-index: 1000;
    font-size: var(--text-small);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 6px;
}

/** Theme Switcher Component */
.theme-switcher {
  position: relative;
}

.theme-switcher-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.theme-switcher-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.theme-switcher-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 200px;
  background-color: var(--card-bg);
  border: var(--border-width) solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  z-index: var(--z-dropdown);
}

.theme-switcher-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
}

.theme-option:hover {
  background-color: var(--bg-hover);
}

.theme-option.active {
  background-color: var(--bg-active);
  font-weight: var(--font-semibold);
}

.theme-icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* Theme Toggle Button Styles */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  margin-right: 12px;
  background: var(--neutral-100);
  border: 1px solid var(--neutral-300);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--neutral-700);
}

.theme-toggle-btn:hover {
  background: var(--neutral-200);
  border-color: var(--neutral-400);
  color: var(--neutral-900);
  transform: scale(1.05);
}

.theme-toggle-btn .theme-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.theme-toggle-btn .theme-icon.hidden {
  display: none;
}

/* Dark theme adjustments */
[data-theme="dark"] .theme-toggle-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--neutral-300);
}

[data-theme="dark"] .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--neutral-100);
}

/* Theme switcher menu */
.theme-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: white;
  border: 1px solid var(--neutral-300);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
  overflow: hidden;
}

.theme-switcher-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

[data-theme="dark"] .theme-switcher-menu {
  background: var(--neutral-800);
  border-color: var(--neutral-700);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.theme-options {
  padding: 8px;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: var(--neutral-900);
  border-radius: 8px;
  font-size: 14px;
}

.theme-option:hover {
  background-color: var(--neutral-100);
}

.theme-option.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 600;
}

[data-theme="dark"] .theme-option {
  color: var(--neutral-100);
}

[data-theme="dark"] .theme-option:hover {
  background-color: var(--neutral-700);
}

[data-theme="dark"] .theme-option.active {
  background-color: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
}

.theme-check {
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.theme-check.visible {
  opacity: 1;
}

.theme-check .icon {
  width: 16px;
  height: 16px;
  color: var(--primary-color);
}

[data-theme="dark"] .theme-check .icon {
  color: #60a5fa;
}

.theme-switcher-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--neutral-200);
}

[data-theme="dark"] .theme-switcher-header {
  border-bottom-color: var(--neutral-700);
}

.theme-switcher-header h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-900);
}

[data-theme="dark"] .theme-switcher-header h4 {
  color: var(--neutral-100);
}

.theme-switcher-header p {
  margin: 0;
  font-size: 12px;
  color: var(--neutral-600);
}

[data-theme="dark"] .theme-switcher-header p {
  color: var(--neutral-400);
}

.theme-switcher-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--neutral-200);
  text-align: center;
}

[data-theme="dark"] .theme-switcher-footer {
  border-top-color: var(--neutral-700);
}

.theme-switcher-footer small {
  font-size: 11px;
  color: var(--neutral-500);
}

[data-theme="dark"] .theme-switcher-footer small {
  color: var(--neutral-400);
}
