/**
 * yogUP CRM — Hoja de Estilos Complementaria (Clay UI & Zen Aesthetic)
 * Limpio, sin emojis, compatible con Tailwind CSS y Lucide Icons
 */

@import url('./variables.css');

/* 1. Transición Zen Fluida del Sidebar */
#app-sidebar {
  width: 16rem; /* 256px */
  opacity: 1;
  transform: translateX(0);
  transition: width 0.36s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.36s cubic-bezier(0.16, 1, 0.3, 1),
              margin 0.36s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.28s ease,
              transform 0.36s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  will-change: width, padding, opacity, transform;
}

#app-sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: -1.25rem !important;
  opacity: 0 !important;
  transform: translateX(-16px);
  pointer-events: none !important;
  border-width: 0 !important;
}

/* 2. Botón Hamburguesa Delante de H1 ("Si está uno no está el otro") */
.sidebar-hamburger-btn {
  width: 0;
  height: 40px;
  margin-right: 0;
  opacity: 0;
  transform: scale(0.75) translateX(-8px);
  pointer-events: none;
  overflow: hidden;
  border-width: 0;
  transition: width 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              margin 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.24s ease,
              transform 0.32s cubic-bezier(0.16, 1, 0.3, 1),
              border-width 0.1s ease;
  will-change: width, margin, opacity, transform;
}

body.sidebar-is-collapsed .sidebar-hamburger-btn {
  width: 40px;
  height: 40px;
  margin-right: 14px;
  opacity: 1;
  transform: scale(1) translateX(0);
  pointer-events: auto;
  border-width: 1px;
}

.sidebar-hamburger-btn:hover {
  transform: scale(1.06) rotate(4deg);
  background-color: #f8fafc;
  box-shadow: 0 8px 24px rgba(26, 38, 57, 0.08);
}

.sidebar-hamburger-btn:active {
  transform: scale(0.94);
}

#btn-collapse-sidebar {
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

#btn-collapse-sidebar:hover {
  transform: scale(1.1) rotate(-8deg);
  background-color: #f1f5f9;
  color: #191c21;
}

#btn-collapse-sidebar:active {
  transform: scale(0.92);
}

/* 3. Items de Navegación yogUP:
   - Opción activa SIN SHADOW
   - Fondo equivalente sólido al 10% del verde lima sobre blanco (#f6fcdd)
   - Sin canal alfa/transparencia
*/
.nav-item {
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item:hover {
  transform: translateX(3px);
  background-color: #f8fafc;
}

.nav-item.active {
  background-color: #f6fcdd !important; /* Color equivalente sólido al 10% de #d4f552 sobre blanco */
  color: #1a2704 !important;
  font-weight: 700 !important;
  box-shadow: none !important;          /* Sin sombras */
  border: 1px solid #edf8c8 !important;
}

.nav-item.active i {
  color: #557707 !important;
}

/* 4. Stat Cards Pastel Niond con Elevación Zen */
.stat-card-lavender {
  background-color: #ece6fd;
  border: 1px solid #ded3fc;
  color: #4c358f;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card-lavender:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(76, 53, 143, 0.12);
}

.stat-card-mint {
  background-color: #c6f4d6;
  border: 1px solid #abedd0;
  color: #1b6238;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card-mint:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(27, 98, 56, 0.12);
}

.stat-card-sky {
  background-color: #d6e9fe;
  border: 1px solid #c0defe;
  color: #1e5288;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card-sky:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(30, 82, 136, 0.12);
}

.stat-card-chai {
  background-color: #fdecd9;
  border: 1px solid #fad9b8;
  color: #8c4912;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-card-chai:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(140, 73, 18, 0.1);
}

/* 5. Tablas Limpias */
.zen-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.zen-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.zen-table th {
  position: sticky;
  top: 0;
  background-color: #ffffff;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
  color: #64748b;
  border-bottom: 2px solid #f1f5f9;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.03);
  z-index: 10;
}

.zen-table td {
  padding: 16px;
  font-size: 13px;
  border-bottom: 1px solid #f8fafc;
  vertical-align: middle;
  transition: background-color 0.18s ease;
}

.zen-table tr:hover td {
  background-color: #fcfdfe;
}

/* 6. Pills de Estado */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.pill:hover {
  filter: brightness(0.97);
}

.pill-saved {
  background-color: #c6f4d6;
  color: #1b6238;
}

.pill-not-saved {
  background-color: #fdecd9;
  color: #8c4912;
}

.pill-active {
  background-color: #d6e9fe;
  color: #1e5288;
}

.pill-lead {
  background-color: #ece6fd;
  color: #4c358f;
}

.pill-inactive {
  background-color: #fde4ec;
  color: #8a244c;
}

.pill-unsubscribed {
  background-color: #f1f5f9;
  color: #64748b;
}

/* 7. Weihu Kanban Cards */
.weihu-card {
  border-radius: 20px;
  padding: 18px;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(26, 38, 57, 0.03);
}

.weihu-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(26, 38, 57, 0.09);
}

/* 8. Botón de WhatsApp Oficial */
.btn-whatsapp {
  background-color: #25d366;
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  border-radius: 9999px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
  text-decoration: none;
}

.btn-whatsapp:hover {
  background-color: #20bd5a;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
}

.btn-whatsapp:active {
  transform: scale(0.97);
}

/* 9. Botón Lima Zen / yogUP */
.btn-lime-zen {
  background-color: #d4f552;
  color: #141d03;
  font-weight: 700;
  border-radius: 9999px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-lime-zen:hover {
  background-color: #c4e837;
  transform: translateY(-1.5px);
}

.btn-lime-zen:active {
  transform: scale(0.97);
}

/* 10. Modal Glassmorphism */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: #ffffff;
  border-radius: 28px;
  width: 92%;
  max-width: 520px;
  padding: 28px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  transform: scale(0.96) translateY(8px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-content {
  transform: scale(1) translateY(0);
}

/* 11. Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 12px 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid #d4f552;
  animation: toastSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlide {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 12. Modal Extendido y Confirmaciones */
.modal-content.modal-lg {
  max-width: 860px;
}

.modal-content.modal-sm {
  max-width: 420px;
}

/* 13. Editor Visual de Correo WYSIWYG */
.email-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
}

.editor-btn {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  background: transparent;
  transition: all 0.15s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.editor-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.email-editor-content {
  min-height: 280px;
  max-height: 520px;
  overflow-y: auto;
  padding: 32px;
  background: #ffffff;
  border: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: #334155;
  outline: none;
}

.email-editor-content:focus {
  outline: none;
}

.email-editor-content h1 {
  color: #0f172a;
  font-size: 24px;
  font-weight: 800;
  margin-top: 6px;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.email-editor-content h2 {
  color: #0f172a;
  font-size: 20px;
  font-weight: 800;
  margin-top: 18px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.email-editor-content h3 {
  color: #1e293b;
  font-size: 16.5px;
  font-weight: 700;
  margin-top: 16px;
  margin-bottom: 8px;
}

.email-editor-content p {
  margin-bottom: 14px;
  color: #334155;
}

.email-editor-content ul, .email-editor-content ol {
  margin-left: 22px;
  margin-bottom: 16px;
  color: #334155;
}

.email-editor-content li {
  margin-bottom: 6px;
  line-height: 1.65;
}

.email-editor-content blockquote {
  border-left: 3.5px solid #0f172a;
  padding: 10px 16px;
  margin: 16px 0;
  background-color: #f8fafc;
  border-radius: 0 10px 10px 0;
  font-style: italic;
  color: #475569;
}

/* ==========================================================================
   10. Estilos Kanban Drag & Drop Zen (Grab, Grabbing y Drop Targets)
   ========================================================================== */
.kanban-card {
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, opacity 0.15s ease;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.dragging {
  opacity: 0.4;
  transform: scale(0.98) rotate(1deg);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

.kanban-col-cards {
  min-height: 360px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.kanban-col-cards.drag-over {
  background-color: rgba(212, 245, 82, 0.1) !important;
  border: 2px dashed #84cc16 !important;
  border-radius: 24px;
}

.kanban-drop-placeholder {
  height: 90px;
  border: 2px dashed #84cc16;
  background-color: #f7fee7;
  border-radius: 22px;
  margin: 6px 0;
  pointer-events: none;
  transition: height 0.15s ease;
}

/* ==========================================================================
   10. Glassmorphism Login Screen
   ========================================================================== */
.login-glass-card {
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.login-glass-input {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff !important;
  transition: all 0.25s ease;
}

.login-glass-input:focus {
  background: rgba(255, 255, 255, 0.16) !important;
  border-color: #d4f552 !important;
  box-shadow: 0 0 0 3px rgba(212, 245, 82, 0.28) !important;
}

.login-glass-input::placeholder {
  color: rgba(255, 255, 255, 0.45) !important;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.animate-shake {
  animation: shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ==========================================================================
   11. Scrollbar Personalizada: Transparente, barra negra y flechas negras
   ========================================================================== */
/* Para Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #0f172a transparent;
}

/* Para navegadores basados en Chromium / WebKit */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
  background-color: transparent;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: #0f172a;
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #000000;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* Botones con flechas negras sobre fondo transparente */
::-webkit-scrollbar-button:single-button {
  background-color: transparent;
  display: block;
  height: 12px;
  width: 12px;
  background-size: 8px;
  background-repeat: no-repeat;
  background-position: center;
}

/* Flecha Arriba */
::-webkit-scrollbar-button:single-button:vertical:decrement {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='%230f172a'><polygon points='12 5 3 16 21 16'/></svg>");
}

/* Flecha Abajo */
::-webkit-scrollbar-button:single-button:vertical:increment {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='%230f172a'><polygon points='12 19 3 8 21 8'/></svg>");
}

/* Flecha Izquierda */
::-webkit-scrollbar-button:single-button:horizontal:decrement {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='%230f172a'><polygon points='5 12 16 3 16 21'/></svg>");
}

/* Flecha Derecha */
::-webkit-scrollbar-button:single-button:horizontal:increment {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='%230f172a'><polygon points='19 12 8 3 8 21'/></svg>");
}

/* ==========================================================================
   12. Botón Sutil y Elegante Scroll-to-Top (Zen Minimalist)
   ========================================================================== */
.scroll-to-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  color: #0f172a;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.92);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.scroll-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.scroll-to-top-btn:hover {
  background: #ffffff;
  border-color: #0f172a;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 28px -6px rgba(15, 23, 42, 0.18);
  color: #000000;
}

.scroll-to-top-btn:active {
  transform: translateY(0) scale(0.96);
}



