/**
 * Studio Grafix Statistic Data Styles
 * Compatible with evmagazin.cz design
 */

/* Main containers */
.statistic-data-page {
  background: #f8f9fa;
  min-height: 100vh;
  padding: 2rem 0;
}

.statistic-data-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header section */
.statistic-data-header {
  background: linear-gradient(135deg, #191838 0%, #2a2456 100%);
  color: white;
  padding: 3rem 2rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 10px 30px rgba(25, 24, 56, 0.3);
}

.statistic-data-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #17D377;
  background-clip: text;
}

.statistic-data-header .subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  line-height: 1.6;
}

.statistic-data-header .meta-info {
  margin-top: 1.5rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

.meta-item .icon {
  width: 20px;
  height: 20px;
  background: #17D377;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

/* Statistics grid */
.statistics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.statistic-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #17D377;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.statistic-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #17D377, transparent);
  opacity: 0.1;
  border-radius: 0 12px 0 100px;
}

.statistic-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.statistic-card h3 {
  color: #191838;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.statistic-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #17D377;
  margin-bottom: 0.5rem;
}

.statistic-label {
  color: #666;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Charts section */
.charts-section {
  margin: 3rem 0;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
}

.chart-container {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  position: relative;
}

.chart-container h3 {
  color: #191838;
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 600;
}

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

.chart-wrapper canvas {
  max-height: 100%;
  max-width: 100%;
}

/* Data tables */
.data-table-container {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  margin: 2rem 0;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  background: linear-gradient(135deg, #191838, #2a2456);
  color: white;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  border: none;
}

.data-table th:first-child {
  border-radius: 8px 0 0 0;
}

.data-table th:last-child {
  border-radius: 0 8px 0 0;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s ease;
}

.data-table tr:hover td {
  background-color: #f8f9fa;
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* Rank indicators */
.rank-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.rank-1 { background: #17D377; }
.rank-2 { background: #ffa500; }
.rank-3 { background: #cd7f32; }
.rank-other { background: #666; }

/* Growth indicators */
.growth-positive {
  color: #17D377;
  font-weight: 600;
}

.growth-negative {
  color: #ff6b6b;
  font-weight: 600;
}

.growth-neutral {
  color: #ffa500;
  font-weight: 600;
}

.growth-indicator::before {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 0.5rem;
}

.growth-positive::before {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 8px solid #17D377;
}

.growth-negative::before {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid #ff6b6b;
}

/* Country flags */
.country-flag {
  display: inline-block;
  width: 24px;
  height: 16px;
  border-radius: 2px;
  margin-right: 0.5rem;
  background-size: cover;
  background-position: center;
  vertical-align: middle;
}

.country-usa { background: linear-gradient(to bottom, #b22234 0%, #b22234 50%, #ffffff 50%, #ffffff 100%); }
.country-china { background: linear-gradient(to bottom, #de2910 0%, #de2910 100%); }
.country-germany { background: linear-gradient(to bottom, #000000 0%, #000000 33%, #dd0000 33%, #dd0000 66%, #ffce00 66%, #ffce00 100%); }
.country-korea { background: linear-gradient(to bottom, #ffffff 0%, #ffffff 50%, #cd2e3a 50%, #cd2e3a 100%); }
.country-europe { background: linear-gradient(to bottom, #003399 0%, #003399 100%); }
.country-sweden { background: linear-gradient(to bottom, #006aa7 0%, #006aa7 50%, #fecc02 50%, #fecc02 100%); }

/* Key insights section */
.key-insights {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
  border-left: 4px solid #17D377;
}

.key-insights h3 {
  color: #191838;
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.key-insights h3::before {
  content: "💡";
  font-size: 1.2rem;
}

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

.insight-item {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.insight-item h4 {
  color: #191838;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.insight-item p {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Navigation */
.statistic-navigation {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  margin: 2rem 0;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-link {
  background: linear-gradient(135deg, #191838, #2a2456);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.nav-link:hover {
  background: linear-gradient(135deg, #17D377, #15b86a);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(23, 211, 119, 0.3);
}

.nav-link.active {
  background: #17D377;
  border-color: #15b86a;
}

/* Responsive design */
@media (max-width: 768px) {
  .statistic-data-header {
    padding: 2rem 1rem;
    text-align: center;
  }

  .statistic-data-header h1 {
    font-size: 2rem;
  }

  .statistic-data-header .meta-info {
    justify-content: center;
  }

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

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

  .chart-wrapper {
    height: 300px;
  }

  .data-table-container {
    padding: 1rem;
  }

  .nav-links {
    flex-direction: column;
    align-items: center;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .statistic-data-container {
    padding: 0 0.5rem;
  }

  .statistic-card {
    padding: 1.5rem;
  }

  .chart-container {
    padding: 1rem;
  }

  .chart-wrapper {
    height: 250px;
  }

  .statistic-value {
    font-size: 2rem;
  }
}

/* Loading animations */
.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #17D377;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fade-in {
  animation: fadeIn 0.6s ease-in;
}

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

/* Tooltips */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #191838;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  font-size: 0.8rem;
  z-index: 1000;
}

.tooltip::before {
  content: '';
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #191838;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.tooltip:hover::after,
.tooltip:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Print styles */
@media print {
  .statistic-data-page {
    background: white;
  }

  .statistic-data-header {
    background: #191838 !important;
    -webkit-print-color-adjust: exact;
  }

  .nav-link,
  .statistic-navigation {
    display: none;
  }

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

  .statistic-card {
    page-break-inside: avoid;
    margin-bottom: 1rem;
  }
}