/* ==========================================================================
   Calculadora de Ovulación - Estilos Modernos y Responsivos
   ========================================================================== */

: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: #a855f7; /* Púrpura ovulación */
  --primary-glow: rgba(168, 85, 247, 0.25);
  --accent: #f43f5e; /* Rojo periodo */
  --fert-green: #10b981; /* Verde fertil */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg-app: #faf5ff;
  --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: #9333ea;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #9333ea;
  --primary-glow: rgba(147, 51, 234, 0.2);
  --accent: #e11d48;
  --fert-green: #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(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 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;
}

/* Ovulation Card */
.ovulation-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;
}

.ovulation-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .ovulation-form-grid {
    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);
}

.form-input-date,
.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: 1.05rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
  transition: all 0.2s;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

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

/* Key Results */
.fertility-key-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 860px) {
  .fertility-key-results {
    grid-template-columns: 1fr;
  }
}

.fert-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

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

.fert-card.peak {
  border-color: var(--primary);
  background: rgba(168, 85, 247, 0.08);
}

.fert-card.fertile {
  border-color: var(--fert-green);
  background: rgba(16, 185, 129, 0.08);
}

.fert-icon {
  font-size: 2rem;
  line-height: 1;
}

.fert-info {
  display: flex;
  flex-direction: column;
}

.fert-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.fert-val {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0.2rem 0;
}

.fert-card.peak .fert-val {
  color: var(--primary);
}

.fert-card.fertile .fert-val {
  color: var(--fert-green);
}

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

/* Calendar Section */
.fertility-calendar-section {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

[data-theme="light"] .fertility-calendar-section {
  background: #ffffff;
}

.cal-legend {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot-period { background: var(--accent); }
.dot-fertile { background: var(--fert-green); }
.dot-ovulation { background: var(--primary); }

.calendar-months-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 990px) {
  .calendar-months-grid {
    grid-template-columns: 1fr;
  }
}

.month-block {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

[data-theme="light"] .month-block {
  background: #f8fafc;
}

.month-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 0.75rem;
  text-transform: capitalize;
}

.days-header-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.days-body-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  color: var(--text-main);
  position: relative;
}

.day-cell.empty {
  visibility: hidden;
}

.day-cell.is-period {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent);
  border: 1px solid rgba(244, 63, 94, 0.4);
  font-weight: 800;
}

.day-cell.is-fertile {
  background: rgba(16, 185, 129, 0.2);
  color: var(--fert-green);
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-weight: 800;
}

.day-cell.is-ovulation {
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 0 8px var(--primary-glow);
}

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