/* ============================================================
   COMPONENTS.CSS — SimpleConvertly v1.0
   Componentes reutilizados en 3+ páginas (calculadoras,
   herramientas de imagen, conversor).
   Importar después de base.css.
   ============================================================ */

/* ── Layout principal de dos columnas ────────────────────── */
.main-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 28px;
}

/* ── Tarjeta de inputs ────────────────────────────────────── */
.input-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
  animation: fadeUp 0.5s var(--ease) 0.05s both;
  position: sticky;
  top: 20px;
}
.input-card h2,
.card-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-bottom: 22px;
}

/* ── Tarjeta de resultados ────────────────────────────────── */
.results-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
  animation: fadeUp 0.5s var(--ease) 0.1s both;
}

/* ── Glass card (conversor principal) ─────────────────────── */
.glass {
  background: var(--surface);
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 44px 48px;
  animation: fadeUp 0.55s var(--ease) 0.1s both;
}

/* ── Grupos de campo ──────────────────────────────────────── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field-group label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.field-group label span {
  font-size: 0.68rem;
  color: var(--gold);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Input de texto/número ────────────────────────────────── */
.field-input-wrap,
.field-wrap { position: relative; }

.field-input {
  width: 100%;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--surface-2);
  border: 1.5px solid var(--border-md);
  border-radius: var(--r-md);
  padding: 11px 44px 11px 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

.field-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  pointer-events: none;
}

/* ── Select estilizado ────────────────────────────────────── */
.field-select {
  width: 100%;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--surface-2);
  border: 1.5px solid var(--border-md);
  border-radius: var(--r-md);
  padding: 11px 40px 11px 14px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg fill='none' height='16' viewBox='0 0 20 20' width='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7l5 5 5-5' stroke='%238c8680' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.field-select:hover { border-color: var(--gold); }

/* ── Range slider ─────────────────────────────────────────── */
.range-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 5px;
  border-radius: 99px;
  border: none;
  outline: none;
  cursor: pointer;
  background: var(--border-md);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: 0 2px 6px var(--gold-glow);
  cursor: pointer;
  transition: transform var(--t-fast);
}
input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.2); }
.range-val {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 52px;
  text-align: right;
}

/* ── Switch de tipo / modo ────────────────────────────────── */
.type-switch,
.modo-switch {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px;
  margin-bottom: 16px;
}
.type-btn,
.modo-btn {
  flex: 1;
  padding: 7px;
  text-align: center;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--t-fast);
  border: none;
  background: transparent;
  font-family: var(--font-body);
}
.type-btn.active,
.modo-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ── KPI / Stat items ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}
.stat-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
body.dark .stat-item,
[data-theme="dark"] .stat-item { background: var(--bg-2); }
.stat-item:hover { border-color: var(--gold); transform: translateY(-2px); }

.stat-item-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.copy-hint {
  font-size: 0.62rem;
  color: var(--gold);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.stat-item:hover .copy-hint { opacity: 1; }

.stat-item-val {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
}
.stat-item-val.green { color: var(--green); }
.stat-item-val.red   { color: var(--red);   }
.stat-item-val.gold  { color: var(--gold);  }
.stat-item-sub { font-size: 0.74rem; color: var(--muted); margin-top: 2px; }

/* ── Tip cards ────────────────────────────────────────────── */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.tip-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  transition: border-color var(--t-base), transform var(--t-base);
}
.tip-card:hover { border-color: var(--gold); transform: translateY(-3px); }
.tip-icon  { font-size: 1.6rem; margin-bottom: 10px; display: block; }
.tip-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.tip-card p  { font-size: 0.85rem; color: var(--muted); line-height: 1.65; }

/* ── Botón principal (CTA) ────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  font-family: var(--font-display);
  box-shadow: 0 2px 8px var(--gold-glow);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px var(--gold-glow); }

/* ── Colores de valor semántico (compartidos) ─────────────── */
.val-green { color: var(--green); }
.val-red   { color: var(--red);   }
.val-gold  { color: var(--gold);  }

/* ── Responsive compartido ────────────────────────────────── */
@media (max-width: 900px) {
  .main-layout { grid-template-columns: 1fr; }
  .input-card  { position: static; }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
  .glass      { padding: 24px 18px; }
}
