/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Brand Switcher */
.brand-switcher {
  display: flex;
  justify-content: flex-start;
  gap: 0;
  background: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
  padding: 0;
}

.brand-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 40px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 4px solid transparent;
  background: #f8f9fa;
  min-width: 200px;
}

.brand-option:hover {
  background: #e9ecef;
}

.brand-option.active {
  background: white;
  border-bottom-color: #4285F4;
}

.brand-logo {
  font-size: 32px;
  line-height: 1;
}

.brand-logo-img {
  height: 40px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

.brand-logo-fallback {
  font-size: 32px;
  line-height: 1;
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
}

.brand-option:not(.active) .brand-name {
  color: #6c757d;
}

/* Header */
.header {
  background: linear-gradient(135deg, #4285F4 0%, #34A853 100%);
  color: white;
  padding: 30px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.header h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 15px;
}

.last-updated {
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
}

.btn-refresh {
  background: white;
  color: #4285F4;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-refresh:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Date Range Filter */
.date-filter {
  background: #fff;
  padding: 20px 40px;
  border-bottom: 2px solid #e9ecef;
}

.date-filter-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.date-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-input-group label {
  font-size: 14px;
  font-weight: 600;
  color: #495057;
}

.date-input {
  padding: 8px 12px;
  font-size: 14px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  background: white;
  color: #495057;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.date-input:focus {
  outline: none;
  border-color: #4285F4;
}

.btn-filter,
.btn-filter-reset {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid #4285F4;
  background: #4285F4;
  color: white;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-filter:hover {
  background: #3367d6;
  border-color: #3367d6;
}

.btn-filter-reset {
  background: white;
  color: #6c757d;
  border-color: #dee2e6;
}

.btn-filter-reset:hover {
  background: #f8f9fa;
  border-color: #6c757d;
}

.date-range-label {
  text-align: center;
  font-size: 14px;
  color: #6c757d;
  font-weight: 500;
}

/* Language Toggle */
.language-toggle {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  background: #f8f9fa;
  border-bottom: 2px solid #e9ecef;
}

.lang-btn {
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid #dee2e6;
  background: white;
  color: #495057;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-btn:hover {
  background: #f8f9fa;
}

.lang-btn.active {
  background: #4285F4;
  color: white;
  border-color: #4285F4;
}

/* Dashboard Content */
#dashboardContent {
  padding: 30px 40px;
}

.dashboard {
  display: block;
}

.dashboard.hidden {
  display: none;
}

/* Efficiency Cards */
.efficiency-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

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

.card-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
  margin-bottom: 10px;
}

.card-value {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.card-value.small {
  font-size: 18px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  max-width: 100%;
  word-break: break-word;
}

.card-sublabel {
  font-size: 14px;
  opacity: 0.9;
}

/* Chart Rows */
.chart-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.chart-container {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
}

.chart-container:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.chart-container.full-width {
  grid-column: 1 / -1;
}

.chart-title {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f8f9fa;
}

/* Metric Selector */
.metric-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.metric-btn {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid #dee2e6;
  background: white;
  color: #495057;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.metric-btn:hover {
  background: #f8f9fa;
  border-color: #4285F4;
}

.metric-btn.active {
  background: #4285F4;
  color: white;
  border-color: #4285F4;
}

/* Weekly Filter Buttons, Comparison Buttons, Creative Metric Buttons */
.weekly-filter-btn,
.comparison-type-btn,
.comparison-metric-btn,
.creative-metric-btn {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid #dee2e6;
  background: white;
  color: #495057;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.weekly-filter-btn:hover,
.comparison-type-btn:hover,
.comparison-metric-btn:hover,
.creative-metric-btn:hover {
  background: #f8f9fa;
  border-color: #4285F4;
}

.weekly-filter-btn.active,
.comparison-type-btn.active,
.comparison-metric-btn.active,
.creative-metric-btn.active {
  background: #4285F4;
  color: white;
  border-color: #4285F4;
}

/* Creative Selector Dropdown */
.creative-selector {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid #dee2e6;
  background: white;
  color: #495057;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 300px;
}

.creative-selector:focus {
  outline: none;
  border-color: #4285F4;
}

.creative-selector:hover {
  border-color: #4285F4;
}

canvas {
  max-height: 400px;
}

/* Footer */
.footer {
  background: #f8f9fa;
  padding: 20px;
  text-align: center;
  color: #6c757d;
  font-size: 14px;
  border-top: 2px solid #e9ecef;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .chart-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .header {
    padding: 20px;
    text-align: center;
  }

  .header h1 {
    font-size: 24px;
  }

  #dashboardContent {
    padding: 20px;
  }

  .efficiency-cards {
    grid-template-columns: 1fr;
  }

  .chart-row {
    grid-template-columns: 1fr;
  }

  .card-value {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 20px;
  }

  .last-updated {
    font-size: 12px;
  }

  .btn-refresh {
    padding: 8px 16px;
    font-size: 12px;
  }

  .card-value {
    font-size: 24px;
  }
}

/* Loading State */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 400px;
  font-size: 18px;
  color: #6c757d;
}

/* Print Styles */
@media print {
  body {
    background: white;
    padding: 0;
  }

  .container {
    box-shadow: none;
  }

  .header {
    background: #4285F4;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .btn-refresh,
  .language-toggle {
    display: none;
  }

  .chart-container {
    page-break-inside: avoid;
  }
}
