/* Configuración de temas para wa-messages-scroll */

/* Tema Light (default) */
[data-theme="light"] {
  --primary: #059669;
  --primary-focus: #047857;
  --primary-content: #ffffff;
  --secondary: #6b7280;
  --secondary-focus: #4b5563;
  --secondary-content: #ffffff;
  --accent: #3b82f6;
  --accent-focus: #2563eb;
  --accent-content: #ffffff;
  --neutral: #374151;
  --neutral-focus: #1f2937;
  --neutral-content: #ffffff;
  --base-100: #ffffff;
  --base-200: #f8fafc;
  --base-300: #e2e8f0;
  --base-content: #1f2937;
  --info: #3b82f6;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
}

/* Tema Dark */
[data-theme="dark"] {
  --primary: #10b981;
  --primary-focus: #059669;
  --primary-content: #ffffff;
  --secondary: #6b7280;
  --secondary-focus: #9ca3af;
  --secondary-content: #ffffff;
  --accent: #60a5fa;
  --accent-focus: #3b82f6;
  --accent-content: #ffffff;
  --neutral: #1f2937;
  --neutral-focus: #111827;
  --neutral-content: #f9fafb;
  --base-100: #1f2937;
  --base-200: #374151;
  --base-300: #4b5563;
  --base-content: #f9fafb;
  --info: #60a5fa;
  --success: #10b981;
  --warning: #fbbf24;
  --error: #f87171;
}

/* Estilos específicos para el cambio de tema */
.theme-controller {
  transition: all 0.3s ease;
}

/* Efectos de transición suave */
*, *::before, *::after {
  transition: 
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    fill 0.3s ease,
    stroke 0.3s ease,
    opacity 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.3s ease;
}

/* Personalización del toggle de tema */
.theme-toggle {
  position: relative;
  width: 3rem;
  height: 1.5rem;
  background-color: var(--base-300);
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.theme-toggle:hover {
  background-color: var(--base-200);
}

.theme-toggle-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.25rem;
  height: 1.25rem;
  background-color: var(--base-100);
  border-radius: 50%;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

[data-theme="dark"] .theme-toggle-slider {
  transform: translateX(1.5rem);
}

/* Iconos de sol y luna */
.theme-icon {
  width: 0.875rem;
  height: 0.875rem;
  opacity: 0.7;
}

/* Personalización específica para modo oscuro en elementos de WhatsApp */
[data-theme="dark"] .wa-message.inbound .wa-message-bubble {
  background-color: #374151;
  color: #f9fafb;
}

[data-theme="dark"] .wa-message.outbound .wa-message-bubble {
  background-color: #059669;
  color: #ffffff;
}

[data-theme="dark"] .wa-conversation {
  background-color: #111827;
}

[data-theme="dark"] .wa-input-container {
  background-color: #374151;
  border: 1px solid #4b5563;
}

[data-theme="dark"] .wa-message-textarea {
  background-color: transparent;
  color: #f9fafb;
}

[data-theme="dark"] .wa-message-textarea::placeholder {
  color: #9ca3af;
}

/* Mejoras visuales para el modo oscuro */
[data-theme="dark"] .wa-conversation-card:hover {
  background-color: #374151;
}

[data-theme="dark"] .wa-conversation-card.active {
  background-color: #059669;
}

[data-theme="dark"] .card {
  background-color: var(--base-200);
  border: 1px solid var(--base-300);
}

[data-theme="dark"] .navbar {
  background-color: var(--base-100);
  border-bottom: 1px solid var(--base-300);
}

/* Estados específicos para modo oscuro */
[data-theme="dark"] .status-pending { 
  background-color: #fbbf24; 
  color: #111827; 
}

[data-theme="dark"] .status-information-requested { 
  background-color: #60a5fa; 
  color: #111827; 
}

[data-theme="dark"] .status-in-progress { 
  background-color: #34d399; 
  color: #111827; 
}

[data-theme="dark"] .status-follow-up { 
  background-color: #a78bfa; 
  color: #111827; 
}

[data-theme="dark"] .status-error { 
  background-color: #f87171; 
  color: #111827; 
}

[data-theme="dark"] .status-not-marked { 
  background-color: #9ca3af; 
  color: #111827; 
}

[data-theme="dark"] .status-completed { 
  background-color: #10b981; 
  color: #111827; 
}

/* Mejoras específicas para el header en modo oscuro */
[data-theme="dark"] .wa-header {
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  border-bottom: 1px solid #4b5563;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .wa-header h1,
[data-theme="dark"] .wa-header .navbar-start,
[data-theme="dark"] .wa-header .navbar-end {
  color: #f9fafb;
}

[data-theme="dark"] .wa-header .btn-ghost {
  color: #d1d5db;
  border-color: #4b5563;
}

[data-theme="dark"] .wa-header .btn-ghost:hover {
  background-color: #4b5563;
  color: #f9fafb;
}

/* Centrado vertical de botones en el navbar */
[data-theme="dark"] .wa-header .navbar-end {
  align-items: center;
  height: 100%;
}

[data-theme="dark"] .wa-header .navbar-end .flex {
  align-items: center;
  height: 100%;
}

/* Prefers-color-scheme para detección automática */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --primary: #10b981;
    --primary-focus: #059669;
    --primary-content: #ffffff;
    --base-100: #1f2937;
    --base-200: #374151;
    --base-300: #4b5563;
    --base-content: #f9fafb;
  }
}
