/**
 * @file
 * Fashion Trends Dashboard CSS Styles
 * 
 * File: css/dashboard.css
 * Comprehensive styling for the Fashion Trends Dashboard
 */

/* ===== GLOBAL DASHBOARD STYLES ===== */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
}

/* ===== HEADER SECTION ===== */
.header {
  text-align: center;
  margin-bottom: 40px;
  color: white;
}

.header h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* ===== CONTROLS SECTION ===== */
.controls {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 25px;
  margin-bottom: 30px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.filter-group {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-item label {
  font-weight: 600;
  color: #4a5568;
  font-size: 0.9rem;
}

.filter-item select {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  font-size: 1rem;
  transition: all 0.3s ease;
  min-width: 140px;
}

.filter-item select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ===== METRICS GRID ===== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 25px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-5px);
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 8px;
}

.metric-label {
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 500;
}

.metric-change {
  font-size: 0.8rem;
  margin-top: 5px;
  padding: 4px 8px;
  border-radius: 20px;
  display: inline-block;
}

.metric-change.positive {
  background: #dcfce7;
  color: #16a34a;
}

.metric-change.negative {
  background: #fee2e2;
  color: #dc2626;
}

.metric-change.neutral {
  background: #f1f5f9;
  color: #64748b;
}

/* ===== CHARTS GRID ===== */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.chart-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 25px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  position: relative;
}

.chart-container.loading::before {
  content: 'Loading...';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.9);
  padding: 10px 20px;
  border-radius: 10px;
  z-index: 10;
}

.chart-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

/* ===== TREND ANALYSIS SECTION ===== */
.trend-analysis {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.trends-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
}

.trends-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e293b;
}

.trends-header select {
  padding: 8px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  font-size: 0.9rem;
}

.trend-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
}

.trend-category {
  background: #f8fafc;
  padding: 20px;
  border-radius: 15px;
  border-left: 5px solid #667eea;
}

.trend-category h4 {
  color: #1e293b;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.trend-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: white;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.trend-item:hover {
  transform: translateX(5px);
}

.trend-value {
  font-weight: 600;
  color: #667eea;
}

/* ===== SEASONAL COMPARISON ===== */
.seasonal-comparison {
  grid-column: 1 / -1;
  margin-top: 20px;
}

.comparison-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-button {
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  color: #4a5568;
}

.tab-button.active {
  background: #667eea;
  color: white;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.3);
}

.tab-button:hover:not(.active) {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

.comparison-content {
  background: rgba(255, 255, 255, 0.95);
  padding: 25px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.tab-content {
  display: none;
}

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

.season-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.season-card {
  background: white;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border-top: 4px solid;
  transition: transform 0.3s ease;
}

.season-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.season-card.spring { border-top-color: #22c55e; }
.season-card.summer { border-top-color: #f59e0b; }
.season-card.autumn { border-top-color: #ea580c; }
.season-card.winter { border-top-color: #3b82f6; }

.season-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: capitalize;
}

.color-palette {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.season-card p {
  margin: 8px 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.season-card strong {
  color: #374151;
}

/* ===== AI INSIGHTS PANEL ===== */
.insights-panel {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 30px;
  border-radius: 20px;
  margin-top: 30px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.insights-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: center;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.insight-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease;
}

.insight-item:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
}

.insight-icon {
  font-size: 2rem;
  margin-bottom: 10px;
  display: block;
}

.insight-item h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.insight-item p {
  font-size: 0.9rem;
  line-height: 1.4;
  opacity: 0.9;
}

/* ===== LOADING STATES ===== */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(102, 126, 234, 0.3);
  border-radius: 50%;
  border-top-color: #667eea;
  animation: spin 1s ease-in-out infinite;
}

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

/* ===== ERROR STATES ===== */
.error-message {
  background: #fee2e2;
  color: #dc2626;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 10px 0;
  font-size: 0.9rem;
}

.error-message::before {
  content: '⚠️ ';
  margin-right: 8px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
  .dashboard-container {
    padding: 15px;
  }
  
  .charts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .header h1 {
    font-size: 2rem;
  }
  
  .header p {
    font-size: 1rem;
  }
  
  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-item {
    width: 100%;
  }
  
  .filter-item select {
    min-width: auto;
    width: 100%;
  }
  
  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .trends-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }
  
  .trends-header select {
    width: 100%;
  }
  
  .trend-categories {
    grid-template-columns: 1fr;
  }
  
  .comparison-tabs {
    flex-wrap: wrap;
  }
  
  .season-cards {
    grid-template-columns: 1fr;
  }
  
  .insights-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .dashboard-container {
    padding: 10px;
  }
  
  .controls {
    padding: 15px;
  }
  
  .metric-card {
    padding: 15px;
  }
  
  .metric-value {
    font-size: 2rem;
  }
  
  .chart-container {
    padding: 15px;
  }
  
  .trend-analysis {
    padding: 20px;
  }
  
  .insights-panel {
    padding: 20px;
  }
}

/* ===== DRUPAL-SPECIFIC STYLES ===== */
.region-content .dashboard-container {
  background: none;
  padding-top: 0;
}

.page-title {
  display: none; /* Hide default page title when using dashboard */
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.filter-item select:focus,
.tab-button:focus,
.trends-header select:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
  .dashboard-container {
    background: white !important;
    color: black !important;
  }
  
  .controls,
  .tab-button {
    display: none;
  }
  
  .chart-container {
    break-inside: avoid;
  }
  
  .insights-panel {
    background: #f8fafc !important;
    color: black !important;
  }
}