@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&display=swap');

:root {
  --bg-dark: #080F08;
  --base-green: #448545;
  --neon-green: #4ADE80;
  --base-mustard: #F6A700;
  --neon-mustard: #FACC15;
  --text-main: #E2E8F0;
  --text-muted: #94A3B8;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(74, 222, 128, 0.15);
  --font-main: 'Inter', system-ui, sans-serif;
  
  /* Manteniendo variables anteriores para compatibilidad del resto de la app */
  --green: var(--base-green);
  --mustard: var(--base-mustard);
  --bg-color: var(--bg-dark);
  --text-color: var(--text-main);
  --card-bg: #1E1E1E;
  --input-bg: #2D2D2D;
  --border-color: #333;
}

body.light-theme {
  --bg-dark: #F8FAFC;
  --text-main: #0F172A;
  --text-muted: #475569;
  --glass-bg: rgba(0, 0, 0, 0.03);
  --glass-border: rgba(68, 133, 69, 0.2);

  /* Variables anteriores para light-theme */
  --bg-color: var(--bg-dark);
  --text-color: var(--text-main);
  --card-bg: #FFFFFF;
  --input-bg: #F0F0F0;
  --border-color: #CCCCCC;
}

body {
  margin: 0;
  padding-top: 100px;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-main);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.header-pro {
  position: fixed; top: 0; width: 100%; z-index: 1000;
  padding: 15px 0; background-color: var(--glass-bg);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
}
.nav-container {
  display: flex; justify-content: space-between; align-items: center;
  width: 90%; max-width: 1200px; margin: 0 auto;
}
.brand-container { display: flex; align-items: center; gap: 12px; }
.brand-icon { height: 36px; }

/* Tipografía animada del logo */
.brand-text {
  font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 28px;
  background: linear-gradient(120deg, var(--base-green) 40%, #ffffff 50%, var(--base-green) 60%);
  background-size: 200% auto; color: transparent; -webkit-background-clip: text;
  background-clip: text; animation: shine 6s linear infinite;
}
.brand-at {
  background: linear-gradient(120deg, var(--base-mustard) 40%, #ffffff 50%, var(--base-mustard) 60%);
  background-size: 200% auto; color: transparent; -webkit-background-clip: text;
  background-clip: text; animation: shine 6s linear infinite;
}
@keyframes shine {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* Botón Toggle Theme */
.btn-neon {
  background: transparent; color: var(--neon-mustard);
  font-family: var(--font-main); font-weight: 600; font-size: 14px;
  padding: 10px 20px; border: 1px solid var(--neon-mustard);
  border-radius: 8px; cursor: pointer; transition: all 0.3s ease;
}
.btn-neon:hover {
  background: var(--neon-mustard); color: #080F08;
}

h1, h2 {
  margin: 0;
}

main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  border: 1px solid var(--border-color);
}

.card h2 {
  margin-bottom: 0.5rem;
  color: var(--mustard);
}

.title-with-tooltip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.5rem;
}

/* Icono de Ayuda */
.btn-info-icon {
  background: var(--mustard);
  color: #111;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* Modal Window */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-content {
  background-color: var(--card-bg);
  width: 90%;
  max-width: 500px;
  border-radius: 12px;
  padding: 2rem;
  position: relative;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  border: 1px solid var(--border-color);
}

.modal-close-x {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  color: var(--text-color);
  font-size: 1.8rem;
  padding: 0;
  width: 30px;
  height: 30px;
  line-height: 1;
}

.modal-close-x:hover {
  color: #ff5252;
}

.modal-title {
  color: var(--green);
  font-family: 'Inter', sans-serif;
  margin-top: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--mustard);
  padding-bottom: 0.5rem;
}

.modal-section {
  margin-bottom: 1.5rem;
}

.modal-section h3 {
  color: var(--mustard);
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}

.modal-section p {
  line-height: 1.5;
  margin: 0;
  font-size: 0.95rem;
}

.highlight {
  background-color: rgba(246, 167, 0, 0.2);
  color: var(--mustard);
  padding: 2px 5px;
  border-radius: 4px;
  font-weight: bold;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

input, textarea {
  background-color: var(--input-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  padding: 0.8rem;
  border-radius: 4px;
  font-family: inherit;
  transition: border-color 0.2s;
}

input.input-error {
  border: 2px solid #ff5252;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  transition: all 0.2s;
}

button:hover:not(:disabled) {
  opacity: 0.9;
}

button:disabled {
  background-color: #555;
  color: #888;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--green);
  color: white;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  margin-top: 1rem;
}

.btn-secondary {
  background-color: transparent;
  color: var(--mustard);
  border: 1px solid var(--mustard);
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.btn-secondary:hover {
  background-color: var(--mustard);
  color: #111;
}

.btn-theme {
  background-color: var(--mustard);
  color: #333;
  padding: 0.5rem 1rem;
}

.btn-gigante {
  background-color: var(--mustard);
  color: #111;
  width: 100%;
  padding: 1.5rem;
  font-size: 1.5rem;
  margin-top: 1rem;
  border-radius: 8px;
  text-transform: uppercase;
}

/* Alertas Especiales */
.alert-danger {
  background-color: rgba(255, 82, 82, 0.1);
  border-left: 5px solid #ff5252;
  color: #ff5252;
  padding: 1rem;
  margin-top: 1rem;
  font-weight: bold;
  border-radius: 4px;
}

.alert-warning {
  background-color: rgba(246, 167, 0, 0.1);
  border-left: 5px solid var(--mustard);
  color: var(--mustard);
  padding: 1rem;
  margin-top: 1rem;
  font-weight: bold;
  border-radius: 4px;
}

.hidden {
  display: none;
}

.preview-bubble {
  background-color: var(--input-bg);
  padding: 1rem;
  border-radius: 12px 12px 12px 0;
  border-left: 4px solid var(--green);
  font-style: italic;
  white-space: pre-wrap;
  min-height: 50px;
}

.status-msg {
  margin-top: 1rem;
  font-weight: bold;
}

.success { color: var(--green); }
.error { color: #ff5252; }
.warning { color: var(--mustard); }

/* --- Login UI Refinements --- */
#login-overlay {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: var(--bg-dark);
  z-index: 900;
}

.login-panel-centered {
  text-align: center;
  margin: 0 auto;
  max-width: 400px;
  width: 90%;
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  border: 1px solid var(--glass-border);
}

.login-panel-centered .form-group label {
  text-align: left;
  display: block;
}

.input-icon-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  padding: 0 1rem;
  border-radius: 4px;
  transition: border-color 0.2s;
}

.input-icon-wrapper input {
  border: none;
  background: transparent;
  width: 100%;
  padding: 0.8rem 0;
  outline: none;
  color: var(--text-color);
}

.neon-icon-input {
  stroke: var(--neon-green);
  fill: none;
  filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.8));
  flex-shrink: 0;
}

/* Btn Icon Only */
.btn-icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  font-size: 1.2rem;
  background: transparent;
  border: 1px solid var(--neon-mustard);
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-icon-only:hover {
  background: var(--neon-mustard);
  box-shadow: 0 0 10px var(--neon-mustard);
  color: #080F08;
}

.btn-login-style {
  background-color: #121412; /* Neutral muy oscuro, casi negro */
  color: #FFFFFF; /* Texto blanco puro */
  font-weight: 700;
  letter-spacing: 1px;
  border: 1px solid #448545; /* Verde corporativo como contorno */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  cursor: pointer;
  
  /* Se elimina la animación 'shine' */
  background-image: none; 
}

.btn-login-style:hover {
  background-color: #1a1f1a; /* Aclara levemente el fondo oscuro */
  border-color: #68c46a; /* El borde se ilumina al pasar el mouse */
  box-shadow: 0 0 15px rgba(104, 196, 106, 0.3); /* Resplandor sutil */
  transform: translateY(-2px);
}

/* --- Dashboard UI Unification --- */

/* 1. Tarjetas Base y Modales */
.card, .dash-box, .modal-content {
  background-color: #121412;
  border: 1px solid #2a352b; /* Verde muy oscuro para contorno sutil */
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
}

/* Línea de acento corporativo en los títulos de cada módulo */
.card h2, .dash-box h3, .modal-title {
  color: #ffffff;
  border-bottom: 1px solid #448545;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

/* 2. Campos de Texto y Textareas (Spintax, Agendar, etc.) */
#app-content .form-group input:not([type="file"]), 
#app-content .form-group textarea, 
#app-content .form-group select {
  background-color: #0a0c0a; /* Fondo más oscuro que la tarjeta para profundidad */
  border: 1px solid #2a352b;
  color: #ffffff;
  border-radius: 4px;
  padding: 10px;
}

#app-content .form-group input:focus, 
#app-content .form-group textarea:focus {
  border-color: #448545;
  box-shadow: 0 0 8px rgba(68, 133, 69, 0.3);
  outline: none;
}

/* 3. Unificación de Botones del Panel */
.btn-primary, .btn-secondary, main .btn-gigante {
  background-color: #121412;
  color: #ffffff;
  font-weight: 700;
  border: 1px solid #448545;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  cursor: pointer;
  background-image: none; /* Eliminar cualquier gradiente previo */
}

.btn-primary:hover, .btn-secondary:hover, main .btn-gigante:hover {
  background-color: #1a1f1a;
  border-color: #68c46a;
  box-shadow: 0 0 15px rgba(104, 196, 106, 0.3);
  transform: translateY(-2px);
}

/* 4. Área de Vista Previa (Burbuja de Mensaje) */
.preview-bubble {
  background-color: #1a1f1a;
  border: 1px solid #448545;
  border-left: 4px solid #448545; /* Acento estilo WhatsApp oscuro */
  color: #e0e0e0;
  white-space: pre-wrap;
}

/* 5. Botones Tag (Insertar Nombre) */
.btn-tag-insert {
  background-color: #121412;
  color: #4ADE80;
  border: 1px solid #4ADE80;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-left: auto;
}

.btn-tag-insert:hover {
  background-color: #4ADE80;
  color: #080F08;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

/* 6. Logo Overlay en el QR */
#qr-logo-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: white; /* Fondo blanco sutil para que resalte sobre los puntos negros */
  padding: 3px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  z-index: 10;
}

/* 7. Icono de Información (SVG Neón) */
.btn-info-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.btn-info-icon:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 5px #448545);
}
.neon-icon-info {
  stroke: #448545;
}
.light-theme .neon-icon-info {
  stroke: #2c5a2c;
}

/* 8. Badge de Estado de Enlace WhatsApp */
.wa-badge {
  display: flex;
  align-items: center;
  background: rgba(68, 133, 69, 0.1);
  border: 1px solid #448545;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: #448545;
  font-weight: 600;
  gap: 8px;
  margin-left: auto;
  margin-right: 15px;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #448545;
  border-radius: 50%;
  box-shadow: 0 0 8px #448545;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(68, 133, 69, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(68, 133, 69, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(68, 133, 69, 0); }
}

/* 9. Dashboard UI Refinements */
.dashboard-section h2, .dash-box h3 {
  text-align: center;
}

.neon-item {
  border-left: 4px solid #448545;
  background: rgba(68, 133, 69, 0.05);
  box-shadow: 0 0 10px rgba(68, 133, 69, 0.2);
  margin-bottom: 12px;
  padding: 15px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}
.neon-item:hover {
  box-shadow: 0 0 15px rgba(68, 133, 69, 0.4);
}

.btn-delete-camp {
  background: transparent;
  color: #d4a017;
  border: 1px solid #d4a017;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}
.btn-delete-camp:hover {
  background: rgba(212, 160, 23, 0.2);
}

.neon-error {
  border-left: 4px solid #ff3333;
  background: rgba(255, 51, 51, 0.05);
  box-shadow: 0 0 10px rgba(255, 51, 51, 0.2);
  margin-top: 8px;
  padding: 10px;
  border-radius: 4px;
  color: #ffaaac;
  font-size: 0.9em;
}
.log-campaign-group {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.success-counter {
  color: #448545;
  font-weight: bold;
  font-size: 1.1em;
}
