/**
 * Estilos Canónicos y Sistema de Diseño - Comprobador de Compatibilidad de Peces de Acuario (AqAdvisor en español)
 * Antigravity - fijate.com/tools
 */

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

  /* Paleta Tema Claro */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-card-hover: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-focus: #0ea5e9;

  /* Acentos Acuariofilia */
  --accent-cyan: #0891b2;
  --accent-cyan-light: #e0f2fe;
  --accent-emerald: #059669;
  --accent-emerald-light: #ecfdf5;
  --accent-amber: #d97706;
  --accent-amber-light: #fef3c7;
  --accent-rose: #e11d48;
  --accent-rose-light: #ffe4e6;

  /* Sombras y radios */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --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);
}

/* Modo Oscuro - Midnight Slate */
[data-theme="dark"] {
  --bg-page: #0b0f17;
  --bg-card: #151b26;
  --bg-card-subtle: #1c2433;
  --bg-card-hover: #232d3f;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #232d3f;
  --border-focus: #38bdf8;

  --accent-cyan: #22d3ee;
  --accent-cyan-light: rgba(6, 182, 212, 0.15);
  --accent-emerald: #34d399;
  --accent-emerald-light: rgba(16, 185, 129, 0.15);
  --accent-amber: #fbbf24;
  --accent-amber-light: rgba(245, 158, 11, 0.15);
  --accent-rose: #f43f5e;
  --accent-rose-light: rgba(225, 29, 72, 0.15);

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
}

/* Base y contención */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

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

/* Layout Canónico */
.tool-layout {
  flex: 1 0 auto;
  max-width: 1440px;
  margin: 1.5rem auto 3.5rem;
  padding: 0 1rem;
  width: 100%;
  box-sizing: border-box;
}

.tool-main-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-width: 0;
  width: 100%;
}

/* Encabezado de la herramienta */
.tool-header-block {
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.tool-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--accent-cyan-light);
  color: var(--accent-cyan);
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.tool-title {
  font-size: 2.1rem;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.tool-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 900px;
}

/* Presets Comunitarios Rápidos */
.community-presets-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.presets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.presets-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.community-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.community-preset-btn {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
}

.community-preset-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.preset-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.preset-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Cuadrícula Principal de 2 Columnas */
.aquarium-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

@media (min-width: 992px) {
  .aquarium-main-grid {
    grid-template-columns: 420px 1fr;
  }
}

/* Columna Izquierda: Configuración de Urna y Fauna Actual */
.tank-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.aquarium-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Formularios y Controles */
.form-group {
  margin-bottom: 1.15rem;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.input-with-suffix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-suffix input {
  flex: 1 1 0%;
  width: 0;
  min-width: 0;
  padding-right: 2.2rem;
}

.input-suffix {
  position: absolute;
  right: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  pointer-events: none;
}

.form-control,
.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 0.85rem;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.92rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.tank-vol-summary {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
}

.vol-pill {
  flex: 1;
  text-align: center;
  padding: 0.4rem 0.5rem;
  background: var(--bg-card-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

.vol-pill strong {
  display: block;
  font-size: 0.95rem;
  color: var(--accent-cyan);
}

/* Fauna Actual en la Urna */
.selected-fish-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.selected-fish-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.selected-fish-item:hover {
  border-color: var(--accent-cyan);
}

.selected-fish-info {
  flex: 1;
  min-width: 0;
  padding-right: 0.5rem;
}

.selected-fish-title {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-fish-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-qty-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-qty-step {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-qty-step:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.qty-number {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 24px;
  text-align: center;
}

.btn-remove-row {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  margin-left: 0.25rem;
  transition: all 0.15s ease;
}

.btn-remove-row:hover {
  color: var(--accent-rose);
  background: var(--accent-rose-light);
}

.selected-fish-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
}

.btn-clear-tank {
  background: transparent;
  border: none;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.btn-clear-tank:hover {
  color: var(--accent-rose);
}

/* Columna Derecha: Cockpit de Diagnóstico y Buscador */
.cockpit-main-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Cockpit de Resultados */
.cockpit-dashboard {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.cockpit-top-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .cockpit-top-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.metric-hero-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.metric-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.metric-status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.badge-good {
  background: var(--accent-emerald-light);
  color: var(--accent-emerald);
}

.badge-optimal {
  background: var(--accent-cyan-light);
  color: var(--accent-cyan);
}

.badge-warning {
  background: var(--accent-amber-light);
  color: var(--accent-amber);
}

.badge-critical {
  background: var(--accent-rose-light);
  color: var(--accent-rose);
}

.metric-big-value {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  margin: 0.35rem 0;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: var(--border-color);
  border-radius: 9999px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease, background-color 0.3s ease;
}

.progress-bar-fill.status-good {
  background: var(--accent-emerald);
}

.progress-bar-fill.status-optimal {
  background: var(--accent-cyan);
}

.progress-bar-fill.status-warning {
  background: var(--accent-amber);
}

.progress-bar-fill.status-critical {
  background: var(--accent-rose);
}

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

/* Tarjetas de Parámetros de Agua */
.water-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.param-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: left;
  transition: border-color 0.2s ease;
}

.param-card-error {
  border-color: var(--accent-rose) !important;
  background: var(--accent-rose-light) !important;
}

.param-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.param-ideal-val {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.param-range-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Distribución de Estratos de Nado */
.strata-section {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.strata-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.strata-bars-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.strata-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.strata-label {
  width: 90px;
  color: var(--text-secondary);
}

.strata-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  overflow: hidden;
}

.strata-bar-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--accent-cyan);
  transition: width 0.3s ease;
}

.strata-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  width: 65px;
  text-align: right;
  color: var(--text-muted);
}

/* Cambios de Agua y Acciones */
.maintenance-actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.water-change-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.water-change-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-cyan-light);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
}

.water-change-text strong {
  display: block;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.water-change-text span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.report-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-secondary-action {
  height: 40px;
  padding: 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Muro de Alertas */
.alerts-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.alerts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.alerts-badge-pill {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
}

.alerts-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.alert-box {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
}

.alert-box-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.alert-box-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.alert-box-content p {
  font-size: 0.85rem;
  line-height: 1.45;
}

.alert-critical-box {
  background: var(--accent-rose-light);
  border-left-color: var(--accent-rose);
  color: var(--text-primary);
}
.alert-critical-box .alert-box-icon {
  color: var(--accent-rose);
}

.alert-warning-box {
  background: var(--accent-amber-light);
  border-left-color: var(--accent-amber);
  color: var(--text-primary);
}
.alert-warning-box .alert-box-icon {
  color: var(--accent-amber);
}

.alert-tip-box {
  background: var(--accent-cyan-light);
  border-left-color: var(--accent-cyan);
  color: var(--text-primary);
}
.alert-tip-box .alert-box-icon {
  color: var(--accent-cyan);
}

.alert-success-box {
  background: var(--accent-emerald-light);
  border-left-color: var(--accent-emerald);
  color: var(--text-primary);
}
.alert-success-box .alert-box-icon {
  color: var(--accent-emerald);
}

/* Buscador y Catálogo de Peces */
.catalog-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.catalog-header {
  margin-bottom: 1.25rem;
}

.catalog-search-bar {
  margin: 1rem 0;
}

.catalog-search-input {
  width: 100%;
  height: 44px;
  padding: 0 1rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.catalog-search-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.family-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.btn-family-chip {
  padding: 0.4rem 0.85rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-family-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

.btn-family-chip.active {
  background: var(--accent-cyan);
  color: #ffffff;
  border-color: var(--accent-cyan);
  font-weight: 600;
}

.fish-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.fish-catalog-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.fish-catalog-card:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-sm);
}

.fish-catalog-card.selected-in-tank {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan-light);
}

.fish-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.fish-common-name {
  font-size: 1rem;
  font-weight: 700;
}

.fish-scientific-name {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
}

.fish-size-pill {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-muted);
}

.fish-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.fish-stat-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.fish-brief-info {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 1rem;
  flex: 1;
}

.fish-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.card-current-qty {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  visibility: hidden;
}

.card-current-qty.visible {
  visibility: visible;
}

.btn-add-fish {
  height: 36px;
  padding: 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-cyan);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: auto;
}

.btn-add-fish:hover {
  background: #0284c7;
  transform: translateY(-1px);
}

/* Modal Corporativo */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-backdrop.active .modal-card {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-body {
  padding: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
}

.btn-modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-modal-action {
  height: 40px;
  padding: 0 1.25rem;
  background: var(--accent-cyan);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}

/* Acordeones y Guía SEO */
.seo-guide-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.seo-guide-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.seo-guide-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.seo-guide-content h3 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.75rem;
}

.faq-accordion-group {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
}

.faq-item summary {
  padding: 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--accent-cyan);
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-content {
  padding: 0 1rem 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Reglas de Impresión */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .app-header,
  .tools-ad-banner-section,
  .tool-ad-sidebar,
  .fijate-footer,
  .community-presets-section,
  .catalog-section,
  .report-buttons,
  .modal-backdrop {
    display: none !important;
  }
  .tool-layout {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .aquarium-main-grid {
    grid-template-columns: 1fr !important;
  }
  .aquarium-card,
  .cockpit-dashboard,
  .alerts-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
}
