/* ==========================================================================
   Calculadora de Dosis Pediátricas - Estilos Modernos
   ========================================================================== */

:root {
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-heading: 'Outfit', 'Inter', sans-serif;

  --bg-app: #080c14;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-input: #0f172a;
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.25);
  --accent-orange: #f97316;
  --accent-red: #ef4444;
  --success: #10b981;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg-app: #f0fdfa; /* Tono clínico suave y limpio */
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #ffffff;
  --bg-input: #ffffff;
  --border-glass: rgba(0, 0, 0, 0.08);
  --border-focus: #0284c7;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #0284c7;
  --primary-glow: rgba(2, 132, 199, 0.2);
  --accent-orange: #ea580c;
  --accent-red: #dc2626;
  --success: #059669;
  color-scheme: light;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-wrapper {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* Hero */
.tool-hero {
  margin-bottom: 1.5rem;
}

.tool-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.85rem;
}

.tool-hero h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.tool-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 800px;
}

/* Pediatric Card */
.pediatric-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  margin-bottom: 2rem;
}

.pediatric-input-section {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

[data-theme="light"] .pediatric-input-section {
  background: #f8fafc;
}

@media (max-width: 768px) {
  .pediatric-input-section {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input-field-wrap {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

.form-input {
  width: 100%;
  min-height: 48px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  padding: 0.6rem 1rem;
  transition: all 0.2s;
  -moz-appearance: textfield;
}

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

.unit-suffix {
  position: absolute;
  right: 1rem;
  font-family: var(--font-main);
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 48px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  transition: all 0.2s;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

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

/* Medicines Grid */
.medicines-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.med-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all 0.2s ease;
}

[data-theme="light"] .med-card {
  background: #ffffff;
}

.med-card.paracetamol {
  border-left: 5px solid var(--primary);
}

.med-card.ibuprofen {
  border-left: 5px solid var(--accent-orange);
}

.med-card.ibuprofen-conc {
  border-left: 5px solid var(--accent-red);
}

.med-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 0.75rem;
}

.med-title-group h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--text-main);
}

.med-conc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.med-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.med-badge.blue { background: rgba(56, 189, 248, 0.15); color: var(--primary); }
.med-badge.orange { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); }
.med-badge.red { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

.med-dose-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dose-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dose-interval {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.dose-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.dose-number.text-orange { color: var(--accent-orange); }
.dose-number.text-red { color: var(--accent-red); }

.dose-formula {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dose-alt {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Pediatric Warning */
.pediatric-warning-card {
  display: flex;
  gap: 1rem;
  background: rgba(249, 115, 22, 0.08);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.warn-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.warn-content h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--accent-orange);
  margin-bottom: 0.25rem;
}

.warn-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Edu Grid */
.percent-edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .percent-edu-grid {
    grid-template-columns: 1fr;
  }
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.edu-card h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.edu-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.edu-card code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  color: var(--primary);
}
