/* ============================================================
   HolaDoc! — Base Styles (base.css)
   Estilo Apicona — Corporativo / Médico
   ============================================================ */

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

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-surface);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  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);}

p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  font-size: var(--text-base);
}

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

strong { font-weight: var(--font-bold); }
em { font-style: italic; }

ul, ol { list-style: none; }

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

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

/* ── Selection ──────────────────────────────────────────── */
::selection {
  background: var(--primary);
  color: #fff;
}

/* ── Scrollbar (thin, themed) ───────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Focus visible (accessibility) ─────────────────────── */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Helper Classes ─────────────────────────────────────── */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }
.text-muted   { color: var(--text-muted); }
.text-primary-color { color: var(--primary); }
.text-dark    { color: var(--text-primary); }
.text-white   { color: #fff; }

.font-bold    { font-weight: var(--font-bold); }
.font-semibold{ font-weight: var(--font-semibold); }

.hidden       { display: none !important; }
.mt-1 { margin-top: var(--space-2); }
.mt-2 { margin-top: var(--space-3); }
.mt-3 { margin-top: var(--space-4); }
.mb-1 { margin-bottom: var(--space-2); }
.mb-2 { margin-bottom: var(--space-3); }
.mb-3 { margin-bottom: var(--space-4); }

.flex         { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2        { gap: var(--space-2); }
.gap-3        { gap: var(--space-3); }

/* ── Section Utility ─────────────────────────────────────── */
.section       { margin-bottom: var(--space-6); }
.section-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-label {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: var(--space-2);
}

/* ── Grid System ─────────────────────────────────────────── */
.grid    { display: grid; }
.grid-2  { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.grid-3  { grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.grid-4  { grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-4); }

/* ── Page Layout ─────────────────────────────────────────── */
.page-enter { animation: fadeInUp 0.3s ease both; }

.page-header {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--border-light);
}

.page-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.page-subtitle {
  font-size: var(--text-base);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
  cursor: pointer;
  text-decoration: none;
  transition: color var(--transition-fast);
}
.page-back:hover { color: var(--primary); }

/* ── Stagger animation ───────────────────────────────────── */
.stagger-children > * { animation: fadeInUp 0.3s ease both; }
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.10s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.20s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.5); }
  70%  { transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}

/* ── DARK BACKGROUND TEXT OVERRIDES (Para paneles con fondo oscuro) ── */
body.dark-bg-theme .page-title,
body.dark-bg-theme .page-subtitle,
body.dark-bg-theme .section-title,
body.dark-bg-theme .empty-state-text,
body.dark-bg-theme .page-back {
  color: #ffffff !important;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

body.dark-bg-theme .flex-between > a {
  color: #93C5FD !important;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

body.dark-bg-theme p:not(.card p):not(.toast p) {
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 5px rgba(0,0,0,0.8);
}

body.dark-bg-theme .card .page-title,
body.dark-bg-theme .card .page-subtitle,
body.dark-bg-theme .card .section-title,
body.dark-bg-theme .card p,
body.dark-bg-theme .toast p {
  color: var(--text-primary) !important;
  text-shadow: none !important;
}
