/* ==========================================================================
   Fijate Tools - Calendario fenológico de siembra y trasplante
   Tokens corporativos, layout canónico y cronograma mensual visual
   ========================================================================== */

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

  /* Estados de siembra */
  --status-semillero: #8b5cf6;
  --status-semillero-bg: #ede9fe;
  --status-trasplante: #15803d;
  --status-trasplante-bg: #dcfce7;
  --status-directa: #059669;
  --status-directa-bg: #d1fae5;
  --status-cosecha: #d97706;
  --status-cosecha-bg: #fef3c7;

  --bg-page: #f8faf8;
  --card-bg: #ffffff;
  --card-border: #e2e8e2;
  --card-border-hover: #cbd5cb;
  --card-shadow: 0 4px 20px -2px rgba(21, 128, 61, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.03);

  --text-main: #19241d;
  --text-muted: #485c50;
  --text-subtle: #6c8074;

  --primary: #059669;
  --primary-hover: #047857;
  --primary-light: #ecfdf5;
  --primary-text: #ffffff;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --bg-page: #08110b;
  --card-bg: #0f1c13;
  --card-border: #1a2e21;
  --card-border-hover: #294734;
  --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.6);

  --text-main: #eff5f1;
  --text-muted: #9eb5a7;
  --text-subtle: #678070;

  --primary: #10b981;
  --primary-hover: #059669;
  --primary-light: #062b1b;
  --primary-text: #02140c;

  --status-semillero: #c4b5fd;
  --status-semillero-bg: rgba(139, 92, 246, 0.22);
  --status-trasplante: #86efac;
  --status-trasplante-bg: rgba(34, 197, 94, 0.22);
  --status-directa: #6ee7b7;
  --status-directa-bg: rgba(16, 185, 129, 0.22);
  --status-cosecha: #fde047;
  --status-cosecha-bg: rgba(245, 158, 11, 0.22);
}

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

h1, h2, h3, h4, h5, h6, .brand-title, .section-title, .hero-title {
  font-family: var(--font-heading);
}

.mono, code {
  font-family: var(--font-mono);
}

/* Suite banner switcher */
.suite-nav-strip {
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  padding: 0.6rem 1rem;
}
.suite-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.suite-nav-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.suite-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.suite-link-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--bg-page);
  border: 1px solid var(--card-border);
  transition: var(--transition);
}
.suite-link-item:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.suite-link-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 700;
}

/* Tool main layout */
.tool-layout {
  max-width: 1240px;
  margin: 1.25rem auto 3rem;
  padding: 0 1rem;
  width: 100%;
}
.tool-with-sidebar {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}

/* Hero card */
.hero-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
}
.hero-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 0.35rem;
}
.hero-tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* Zone and filter card */
.controls-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
}
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  align-items: flex-end;
}
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.field-group label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}
.field-group select,
.field-group input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: var(--bg-page);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}
.field-group select {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  padding-right: 36px;
}
.field-group select:focus,
.field-group input:focus {
  border-color: var(--primary);
}

.zone-description-box {
  background: var(--bg-page);
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* Legend bar */
.legend-strip {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  background: var(--bg-page);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.legend-dot.semillero { background: var(--status-semillero); }
.legend-dot.trasplante { background: var(--status-trasplante); }
.legend-dot.directa { background: var(--status-directa); }
.legend-dot.cosecha { background: var(--status-cosecha); }

/* Timeline table card */
.timeline-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.timeline-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.timeline-table th, .timeline-table td {
  padding: 0.65rem 0.5rem;
  border: 1px solid var(--card-border);
  text-align: center;
}
.timeline-table th {
  background: var(--bg-page);
  font-weight: 700;
  color: var(--text-muted);
}
.timeline-table th.col-crop {
  text-align: left;
  min-width: 170px;
}
.timeline-table th.current-month {
  background: var(--primary-light);
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}
.crop-cell-head {
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.crop-cell-head:hover {
  color: var(--primary);
}
.month-cell {
  position: relative;
  height: 38px;
  padding: 2px;
}
.month-cell.is-now {
  background: rgba(5, 150, 105, 0.04);
}
.status-pill {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.status-pill.semillero { background: var(--status-semillero-bg); color: var(--status-semillero); }
.status-pill.trasplante { background: var(--status-trasplante-bg); color: var(--status-trasplante); }
.status-pill.directa { background: var(--status-directa-bg); color: var(--status-directa); }
.status-pill.cosecha { background: var(--status-cosecha-bg); color: var(--status-cosecha); }

/* Lunar guide card */
.lunar-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.5rem;
}
.lunar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.lunar-phase-box {
  background: var(--bg-page);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}
.lunar-phase-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}
.lunar-phase-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-overlay.open {
  display: flex;
}
.modal-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  padding: 1.5rem;
  position: relative;
}
.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
}

/* Guide */
.seo-guide-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--card-shadow);
  margin-top: 2rem;
}
.seo-guide-section h2 {
  font-size: 1.35rem;
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
}
.seo-guide-section h2:first-of-type {
  margin-top: 0;
}
.seo-guide-section p, .seo-guide-section li {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}
