/* =============================================
   PARAÍSO NATURAL — perfil.css
   Estilos para la página de perfil de usuario
============================================= */

/* ---- Variables ---- */
:root {
  --green:        #2d7a3e;
  --green-light:  #4a9d5f;
  --gold:         #c9a961;
  --dark:         #2c3e50;
  --orange:       #f5a623;
}

/* ---- Reset base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: #f3f4f6;
}

/* =====================
   FRUTIGER AERO CARDS
===================== */
.aero-card {
  position: relative;
  border: 1px solid rgba(255,255,255,.7);
  background:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,.72), rgba(255,255,255,0) 45%),
    radial-gradient(circle at 80% 20%, rgba(179,234,255,.35), rgba(179,234,255,0) 55%),
    linear-gradient(160deg, rgba(255,255,255,.94), rgba(230,247,255,.86) 48%, rgba(238,255,241,.84));
  box-shadow: 0 14px 34px rgba(36, 102, 76, 0.15), inset 0 1px 0 rgba(255,255,255,.9);
  backdrop-filter: blur(6px);
  animation: aeroSoftRise .55s ease both;
}

.aero-card::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 1rem;
  background: linear-gradient(130deg, rgba(255,255,255,.35), rgba(255,255,255,0) 44%);
}

.aero-pill {
  border: 1px solid rgba(255,255,255,.72);
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(239,251,255,.86));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 7px 16px rgba(51, 115, 89, 0.08);
}

.level-widget {
  border: 1px solid rgba(255,255,255,.72);
  background: linear-gradient(150deg, rgba(255,255,255,.88), rgba(234,250,255,.78));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 9px 20px rgba(40, 110, 82, .1);
}

.level-progress-track {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(184, 213, 227, .45), rgba(213, 232, 242, .82));
  border: 1px solid rgba(151, 190, 212, .42);
}

.level-progress-fill {
  position: relative;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399 0%, #22d3ee 46%, #60a5fa 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 5px 12px rgba(56, 189, 248, .35);
  transition: width .95s cubic-bezier(.17,.84,.44,1);
}

.level-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.66) 42%, transparent 76%);
  opacity: 0;
}

.level-progress-fill.is-animating::after {
  animation: progressShine 1.1s ease;
}

@keyframes aeroSoftRise {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes progressShine {
  from { opacity: .2; transform: translateX(-110%); }
  to   { opacity: .95; transform: translateX(110%); }
}

/* =====================
   TABS
===================== */
.tab-btn {
  color: #6b7280;
  border-bottom: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: .82rem;
  padding-top: .85rem;
  padding-bottom: .85rem;
}

.tab-btn:hover {
  color: var(--green);
  background-color: #f0fdf4;
}

.tab-btn.active {
  color: var(--green);
  border-bottom-color: var(--green);
  background-color: #ecfdf5;
  font-weight: 700;
}

.tab-content {
  animation: fadeInTab 0.25s ease;
}

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =====================
   INPUTS
===================== */
.input-field {
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(45, 122, 62, 0.15);
}

.input-field:disabled,
.input-field[readonly] {
  background-color: #f9fafb;
  color: #9ca3af;
  cursor: not-allowed;
}

/* =====================
   AVATAR
===================== */
#avatarPreview {
  transition: transform 0.3s ease;
}

#avatarPreview:hover {
  transform: scale(1.05);
}

/* =====================
   INDICADOR FUERZA CONTRASEÑA
===================== */
.strength-weak   { background-color: #ef4444 !important; }
.strength-fair   { background-color: #f97316 !important; }
.strength-good   { background-color: #eab308 !important; }
.strength-strong { background-color: #22c55e !important; }

/* =====================
   REQUISITOS CONTRASEÑA
===================== */
.req-ok   .req-icon { color: #22c55e; }
.req-fail .req-icon { color: #ef4444; }
.req-ok   { color: #16a34a; }

/* =====================
   TOAST NOTIFICATIONS
===================== */
.toast {
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: 260px;
  max-width: 380px;
  animation: slideInToast 0.35s ease forwards;
  transition: opacity 0.3s ease;
}

.toast-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
}

.toast-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.toast-warning {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
}

.toast-info {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e40af;
}

@keyframes slideInToast {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast.fade-out {
  opacity: 0;
  transform: translateX(60px);
}

/* =====================
   BADGE DE ROL
===================== */
.badge-cliente     { background-color: var(--green);   color: #fff; }
.badge-vendedor    { background-color: var(--gold);    color: #1a1a1a; }
.badge-admin       { background-color: #7c3aed;        color: #fff; }
.badge-superadmin  { background-color: #dc2626;        color: #fff; }

/* =====================
   CAMPOS SOLO LECTURA (sistema)
===================== */
.readonly-field {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  color: #6b7280;
  user-select: none;
}

/* =====================
   RESPONSIVE AJUSTES
===================== */
@media (max-width: 640px) {
  .tab-btn {
    padding: 0.65rem 0.75rem;
    font-size: 0.7rem;
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (min-width: 1024px) {
  .tab-btn {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }
}

/* =====================
   MOBILE ENHANCEMENTS
===================== */
@media (max-width: 767px) {
  /* Página: reducir padding top en móvil (navbar más pequeño) */
  main.pt-24 {
    padding-top: 5rem;
  }

  #toastContainer {
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.85rem;
  }

  #toastContainer .toast {
    width: 100%;
    max-width: none;
  }

  /* Título de página */
  h1.text-4xl {
    font-size: 1.9rem;
  }

  /* Toast: ancho máximo en móvil */
  .toast {
    min-width: 0;
    width: calc(100vw - 2.5rem);
    max-width: calc(100vw - 2.5rem);
    font-size: 0.82rem;
    padding: 10px 14px;
  }

  /* Tabs: scroll horizontal cómodo */
  .flex.border-b.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .flex.border-b.overflow-x-auto::-webkit-scrollbar {
    display: none;
  }

  /* Contenido de tab: padding reducido en mobile */
  .tab-content.p-6 {
    padding: 1rem;
  }

  /* Formularios: botones de guardar full-width en mobile */
  #btnGuardarDatos,
  #btnCambiarPass,
  #btnCambiarEmail {
    width: 100%;
    justify-content: center;
  }

  /* Sección de seguridad: texto truncado con max-width mayor */
  #emailSeguridad {
    max-width: 160px;
  }

  /* Cards de membresía: scroll horizontal en mobile */
  #profileMembershipPlans {
    display: flex;
    overflow-x: auto;
    gap: 0.75rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #profileMembershipPlans::-webkit-scrollbar {
    display: none;
  }
  #profileMembershipPlans > * {
    min-width: 14rem;
    flex-shrink: 0;
  }

  .admin-config-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.55rem;
  }

  .admin-config-icon {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  #tabDatos .flex.flex-wrap.items-center.justify-between.gap-3 > button {
    width: 100%;
  }

  /* Dirección form: padding reducido */
  #formDireccion {
    gap: 0.65rem;
  }

  /* Campos de solo lectura del sistema: grid 1 col en xs */
  .grid.grid-cols-1.md\:grid-cols-3 {
    gap: 0.5rem;
  }
}

/* Pantallas muy pequeñas (< 400px) */
@media (max-width: 399px) {
  main.pt-24 {
    padding-top: 4.5rem;
  }
  .tab-btn {
    padding: 0.55rem 0.55rem;
    font-size: 0.65rem;
  }
  h1.text-4xl {
    font-size: 1.65rem;
  }
}

/* =====================
   ANIMACIÓN PULSE AVATAR
===================== */
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(45, 122, 62, 0.4); }
  70%  { box-shadow: 0 0 0 10px rgba(45, 122, 62, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 122, 62, 0); }
}

#avatarPreview {
  animation: pulse-ring 3s infinite;
  border-radius: 9999px;
}

/* =====================
   SCROLLBAR PERSONALIZADO
===================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: var(--green); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-light); }

/* =====================
   CATÁLOGO ADMIN SPACE
===================== */
.catalogo-admin-card {
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.catalogo-admin-card table {
  min-width: 620px;
}

/* =====================
   ENTRADA CONFIG ADMIN
===================== */
.admin-config-entry {
  display: block;
  width: 100%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-decoration: none;
}

.admin-config-entry::before,
.admin-config-entry::after {
  content: none !important;
}

.admin-config-inner {
  position: relative;
  z-index: 1;
  padding-left: 0.35rem;
}

.admin-config-icon {
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(45, 122, 62, 0.2);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 8px 18px rgba(45, 122, 62, 0.14);
  font-size: 1.25rem;
  color: #2d7a3e;
  flex-shrink: 0;
}

.membresia-card {
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: linear-gradient(145deg, #ffffff, #f8fbff);
  padding: 0.95rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.membresia-card.is-active {
  border-color: rgba(45, 122, 62, 0.4);
  background: linear-gradient(145deg, #f0fdf4, #ecfeff);
}

.membresia-benefit {
  font-size: 11px;
  line-height: 1.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
}

@media (max-width: 1536px) {
  .catalogo-admin-card table {
    min-width: 560px;
  }
}

/* =====================
   DARK MODE PERFIL
===================== */
body.theme-night {
  background: radial-gradient(circle at 20% 20%, rgba(18, 48, 38, 0.6), transparent 35%),
    linear-gradient(180deg, #081912 0%, #0c251c 55%, #122f24 100%);
  color: #e5e7eb;
}

.theme-night header {
  background: rgba(8, 28, 22, 0.78);
  border-color: rgba(126, 242, 180, 0.22);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.32);
}

.theme-night main .bg-white,
.theme-night .aero-card,
.theme-night .aero-pill,
.theme-night .level-widget,
.theme-night .catalogo-admin-card,
.theme-night #modalLogout .bg-white,
.theme-night #modalMarca .bg-white,
.theme-night #modalCategoria .bg-white {
  background: linear-gradient(145deg, rgba(17, 43, 34, 0.96), rgba(15, 36, 29, 0.94));
  border-color: rgba(134, 239, 172, 0.18);
  color: #d8eee4;
}

.theme-night .tab-btn {
  color: #b7d8cb;
}

.theme-night .tab-btn:hover,
.theme-night .tab-btn.active {
  color: #baf3cf;
  background-color: rgba(52, 211, 153, 0.14);
  border-bottom-color: #4ade80;
}

.theme-night h1,
.theme-night h2,
.theme-night h3,
.theme-night h4 {
  color: #e8fff3;
}

.theme-night .level-progress-track {
  background: linear-gradient(180deg, rgba(17, 51, 58, .8), rgba(19, 66, 78, .95));
  border-color: rgba(77, 187, 229, .35);
}

.theme-night .text-gray-500,
.theme-night .text-gray-600,
.theme-night .text-gray-700,
.theme-night .text-gray-800 {
  color: #d2e8de !important;
}

.theme-night .bg-gray-50,
.theme-night .bg-gray-100,
.theme-night .bg-green-50,
.theme-night .bg-amber-50,
.theme-night .bg-emerald-50,
.theme-night .bg-orange-50 {
  background: rgba(255, 255, 255, 0.06) !important;
}

.theme-night .border,
.theme-night .border-gray-200,
.theme-night .border-gray-300 {
  border-color: rgba(134, 239, 172, 0.22) !important;
}

.theme-night input,
.theme-night textarea,
.theme-night select,
.theme-night .readonly-field,
.theme-night #emailActualMostrado,
.theme-night #readRol,
.theme-night #readNivel,
.theme-night #readActivo {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #e5f7ef !important;
  border-color: rgba(134, 239, 172, 0.28) !important;
}

.theme-night .input-field:focus {
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.24);
}

.theme-night footer {
  background: #06120f;
}

.theme-night .membresia-card {
  border-color: rgba(134, 239, 172, 0.24);
  background: linear-gradient(145deg, rgba(17, 43, 34, 0.96), rgba(15, 36, 29, 0.94));
}

.theme-night .membresia-card.is-active {
  border-color: rgba(74, 222, 128, 0.5);
  background: linear-gradient(145deg, rgba(24, 69, 48, 0.98), rgba(16, 49, 39, 0.96));
}

.theme-night .membresia-card .bg-emerald-50,
.theme-night .membresia-card .bg-sky-50,
.theme-night .membresia-card .bg-emerald-100,
.theme-night .membresia-card .bg-sky-100,
.theme-night .membresia-card .bg-slate-100,
.theme-night .membresia-card .bg-gray-100 {
  background: rgba(255, 255, 255, 0.14) !important;
  border-color: rgba(223, 255, 240, 0.28) !important;
}

.theme-night .membresia-card .text-emerald-700,
.theme-night .membresia-card .text-emerald-800,
.theme-night .membresia-card .text-sky-700,
.theme-night .membresia-card .text-sky-800,
.theme-night .membresia-card .text-slate-600,
.theme-night .membresia-card .text-gray-600,
.theme-night .membresia-card .text-gray-700,
.theme-night .membresia-card .text-gray-800,
.theme-night .membresia-card .text-gray-500,
.theme-night .membresia-card .text-amber-700,
.theme-night .membresia-card .text-blue-700 {
  color: #ebfff5 !important;
}

.theme-night .membresia-card .membresia-benefit {
  background: rgba(237, 247, 255, 0.9);
  border-color: rgba(191, 219, 254, 0.8);
  color: #0f3a70;
}

.theme-night #profileMembershipPlans .rounded-xl.border.border-gray-200.bg-gray-50,
.theme-night #direccionesPerfilLista p.text-sm.text-gray-500 {
  color: #d7eee2 !important;
}

.theme-night #formDireccion .bg-white,
.theme-night #formDatos .bg-white,
.theme-night #tabDatos .bg-white,
.theme-night #tabPedidos .bg-white,
.theme-night #tabPassword .bg-white,
.theme-night #tabEmail .bg-white {
  background: rgba(255, 255, 255, 0.08) !important;
}

.theme-night #tabDatos .text-gray-500,
.theme-night #tabDatos .text-gray-600,
.theme-night #tabDatos .text-gray-700,
.theme-night #tabDatos .text-gray-800,
.theme-night #tabPedidos .text-gray-500,
.theme-night #tabPedidos .text-gray-600,
.theme-night #tabPedidos .text-gray-700,
.theme-night #tabPedidos .text-gray-800,
.theme-night #tabPassword .text-gray-500,
.theme-night #tabPassword .text-gray-600,
.theme-night #tabPassword .text-gray-700,
.theme-night #tabPassword .text-gray-800,
.theme-night #tabEmail .text-gray-500,
.theme-night #tabEmail .text-gray-600,
.theme-night #tabEmail .text-gray-700,
.theme-night #tabEmail .text-gray-800 {
  color: #e4f6ee !important;
}