/* ========================================
   📊 ANALYTICS DASHBOARD - ESTILO ELEGANTE
   ======================================== */

.analytics {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
}

/* Hero Section (igual que Options) */
.analytics__header {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.analytics__header-content {
  flex: 1;
}

.analytics__header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.analytics__header-icon {
  font-size: 3rem;
}

.analytics__header-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 600px;
  margin: 0;
}

.analytics__header-stats {
  display: flex;
  gap: 32px;
}

.analytics__header-stat {
  text-align: center;
}

.analytics__header-stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.analytics__header-stat-label {
  font-size: 0.9rem;
  color: var(--muted);
}

/* KPI CARDS */
.analytics__kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.analytics__kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.analytics__kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  opacity: 0.6;
}

.analytics__kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
}

.analytics__kpi-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.analytics__kpi-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  font-weight: 600;
}

.analytics__kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--neon), var(--neon-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.analytics__kpi-change {
  font-size: 0.9rem;
  color: #10b981;
  font-weight: 500;
}

/* CHARTS */
.analytics__charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

@media (max-width: 1024px) {
  .analytics__charts-grid {
    grid-template-columns: 1fr;
  }
}

.analytics__chart-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.analytics__chart-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  opacity: 0.6;
}

.analytics__chart-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
}

.analytics__chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.analytics__chart-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.analytics__chart-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.analytics__chart-btn {
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
}

.analytics__chart-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.analytics__chart-btn.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

/* TOP PERFORMERS */
.analytics__top-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.analytics__top-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.analytics__top-item:hover {
  background: rgba(99, 102, 241, 0.05);
  border-left-color: #6366f1;
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateX(4px);
}

.analytics__top-item-rank {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-right: 16px;
  min-width: 40px;
  text-align: center;
}

.analytics__top-item-info {
  flex: 1;
}

.analytics__top-item-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.analytics__top-item-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.analytics__top-item-badge {
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  min-width: 80px;
}

/* LOADING */
.analytics__loading {
  text-align: center;
  padding: 80px 20px;
  color: white;
}

.analytics__spinner {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.analytics__error {
  background: white;
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  color: #ef4444;
  max-width: 600px;
  margin: 40px auto;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .analytics {
    padding: 20px 16px;
  }

  .analytics__header h1 {
    font-size: 32px;
  }

  .analytics__kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ====================================
   🔍 EVIDENCIA DEL PORTFOLIO
   ==================================== */

.analytics__evidence-section {
  margin-bottom: 32px;
}

.analytics__evidence-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.analytics__evidence-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  opacity: 0.6;
}

.analytics__evidence-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
}

.analytics__evidence-header {
  margin-bottom: 20px;
}

.analytics__evidence-header h3 {
  margin: 0 0 8px 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.analytics__evidence-subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.analytics__evidence-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px;
  background: rgba(99, 102, 241, 0.05);
  border-left: 3px solid #6366f1;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.analytics__evidence-icon {
  font-size: 1.1rem;
}

.analytics__top-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Prediction Accuracy Section */
.analytics__prediction-accuracy-section {
  margin: 32px 0;
}

.analytics__prediction-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.analytics__prediction-stat {
  padding: 20px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  text-align: center;
}

.analytics__prediction-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: #6366f1;
  margin-bottom: 8px;
}

.analytics__prediction-stat-label {
  font-size: 0.9rem;
  color: var(--muted);
}

.analytics__prediction-details {
  margin-top: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}
