/* ============================================
   ELIXIR MARKETING DASHBOARD - ESTILOS
   Branding: Rosa #EA34FA | Fondo #070616
   ============================================ */

:root {
  /* Colores Corporativos Elixir */
  --elixir-pink: #EA34FA;
  --elixir-dark: #070616;
  --elixir-white: #FFFFFF;
  --elixir-text: #1C1C1C;
  
  /* Colores Funcionales */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  /* Grises */
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* ============================================
   RESET Y BASE
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--elixir-dark) 0%, #0a0824 100%);
  color: var(--elixir-white);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */

header {
  background: rgba(7, 6, 22, 0.95);
  backdrop-filter: blur(10px);
  padding: 1.5rem 2rem;
  border-bottom: 2px solid var(--elixir-pink);
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--elixir-pink) 0%, #ff6bff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-icon {
  font-size: 2rem;
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn-header {
  padding: 0.6rem 1.2rem;
  border: 2px solid var(--elixir-pink);
  background: transparent;
  color: var(--elixir-pink);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-header:hover {
  background: var(--elixir-pink);
  color: var(--elixir-white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(234, 52, 250, 0.4);
}

/* ============================================
   MAIN CONTAINER
   ============================================ */

.container {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
}

/* ============================================
   TABS NAVIGATION
   ============================================ */

.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid rgba(234, 52, 250, 0.2);
  overflow-x: auto;
}

.tab-btn {
  padding: 1rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--gray-300);
  cursor: pointer;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--elixir-pink);
  background: rgba(234, 52, 250, 0.1);
}

.tab-btn.active {
  color: var(--elixir-pink);
  border-bottom-color: var(--elixir-pink);
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(234, 52, 250, 0.2);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(234, 52, 250, 0.3);
  border-color: var(--elixir-pink);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(234, 52, 250, 0.2);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--elixir-white);
}

/* ============================================
   KPI CARDS
   ============================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: linear-gradient(135deg, rgba(234, 52, 250, 0.1) 0%, rgba(234, 52, 250, 0.05) 100%);
  border: 2px solid rgba(234, 52, 250, 0.3);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.kpi-card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 24px rgba(234, 52, 250, 0.4);
}

.kpi-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.kpi-label {
  font-size: 0.9rem;
  color: var(--gray-300);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--elixir-pink);
  line-height: 1;
}

.kpi-change {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

.kpi-change.positive {
  color: var(--success);
}

.kpi-change.negative {
  color: var(--danger);
}

/* ============================================
   CHARTS
   ============================================ */

.chart-container {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  height: 400px;
  position: relative;
}

.chart-wrapper {
  position: relative;
  height: 100%;
}

/* ============================================
   FORMS & INPUTS
   ============================================ */

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--elixir-white);
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #1a1a2e;
  border: 2px solid rgba(234, 52, 250, 0.3);
  border-radius: 8px;
  color: var(--elixir-white);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-select option {
  background: #1a1a2e;
  color: var(--elixir-white);
  padding: 0.5rem;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--elixir-pink);
  box-shadow: 0 0 0 3px rgba(234, 52, 250, 0.2);
}

.form-input::placeholder {
  color: var(--gray-300);
}

/* ============================================
   FILE UPLOAD
   ============================================ */

.file-upload-area {
  border: 3px dashed rgba(234, 52, 250, 0.4);
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: rgba(234, 52, 250, 0.05);
}

.file-upload-area:hover,
.file-upload-area.drag-over {
  border-color: var(--elixir-pink);
  background: rgba(234, 52, 250, 0.1);
  transform: scale(1.02);
}

.upload-icon {
  font-size: 3rem;
  color: var(--elixir-pink);
  margin-bottom: 1rem;
}

.upload-text {
  font-size: 1.1rem;
  color: var(--elixir-white);
  margin-bottom: 0.5rem;
}

.upload-hint {
  font-size: 0.9rem;
  color: var(--gray-300);
}

#fileInput {
  display: none;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--elixir-pink) 0%, #ff6bff 100%);
  color: var(--elixir-white);
  box-shadow: 0 4px 12px rgba(234, 52, 250, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(234, 52, 250, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--elixir-white);
  border: 2px solid rgba(234, 52, 250, 0.3);
}

.btn-secondary:hover {
  background: rgba(234, 52, 250, 0.2);
  border-color: var(--elixir-pink);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   TABLES
   ============================================ */

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
}

.data-table thead {
  background: rgba(234, 52, 250, 0.2);
}

.data-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--elixir-pink);
  border-bottom: 2px solid var(--elixir-pink);
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(234, 52, 250, 0.1);
}

.data-table tbody tr:hover {
  background: rgba(234, 52, 250, 0.1);
}

/* Formato condicional - CPF Playlists (NUEVO ESQUEMA) */
.excellent-cpf {
  background: rgba(255, 255, 255, 0.1) !important; /* Blanco < €0.50 */
  color: #ffffff;
  font-weight: 700;
}

.good-cpf {
  background: rgba(251, 191, 36, 0.2) !important; /* Naranja claro €0.50-0.70 */
  color: #fbbf24;
  font-weight: 700;
}

.warning-cpf {
  background: rgba(249, 115, 22, 0.3) !important; /* Naranja oscuro €0.70-0.99 */
  color: #f97316;
  font-weight: 700;
}

.critical-cpf {
  background: rgba(239, 68, 68, 0.3) !important; /* Rojo > €0.99 */
  color: #ef4444;
  font-weight: 700;
}

/* Backward compatibility - mantener por si acaso */
.low-cost { background: rgba(255, 255, 255, 0.1) !important; color: #ffffff; }
.medium-cost { background: rgba(251, 191, 36, 0.2) !important; color: #fbbf24; }
.high-cost { background: rgba(239, 68, 68, 0.3) !important; color: #ef4444; }

/* ============================================
   NUEVOS COLORES CPF - ELIXIR
   ============================================ */

/* Monitoring CPF */
.cpf-excellent {
  background: rgba(16, 185, 129, 0.2) !important; /* Verde < €0.50 */
  color: #10B981;
  font-weight: 600;
}

.cpf-good {
  background: rgba(251, 146, 60, 0.2) !important; /* Naranja claro €0.50-0.70 */
  color: #FB923C;
  font-weight: 600;
}

.cpf-warning {
  background: rgba(249, 115, 22, 0.2) !important; /* Naranja oscuro €0.70-0.99 */
  color: #F97316;
  font-weight: 600;
}

.cpf-critical {
  background: rgba(239, 68, 68, 0.2) !important; /* Rojo ≥ €1.00 */
  color: #EF4444;
  font-weight: 600;
}

/* TrackBoost CPF */
.tb-excellent {
  background: rgba(16, 185, 129, 0.2) !important; /* Verde ≤ €0.50 */
  color: #10B981;
  font-weight: 600;
}

.tb-warning {
  background: rgba(251, 191, 36, 0.2) !important; /* Amarillo €0.51-0.90 */
  color: #FBBF24;
  font-weight: 600;
}

.tb-critical {
  background: rgba(239, 68, 68, 0.2) !important; /* Rojo > €0.90 */
  color: #EF4444;
  font-weight: 600;
}

/* Conversiones */
.conv-warning {
  background: rgba(239, 68, 68, 0.15) !important; /* Resaltado conversión alta */
  border: 2px solid #EF4444;
}

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */

.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.2);
  border-left: 4px solid var(--success);
  color: #6ee7b7;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.2);
  border-left: 4px solid var(--warning);
  color: #fcd34d;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.2);
  border-left: 4px solid var(--danger);
  color: #fca5a5;
}

.alert-info {
  background: rgba(59, 130, 246, 0.2);
  border-left: 4px solid var(--info);
  color: #93c5fd;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(234, 52, 250, 0.3);
  border-top-color: var(--elixir-pink);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 6, 22, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .tabs {
    flex-wrap: wrap;
  }
  
  .chart-container {
    height: 300px;
  }
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none; }
.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
