/* Custom Styles for the Trade Statistics Page */

:root {
  --hero-bg-gradient: linear-gradient(135deg, #f4fcf6 0%, #fffdf4 50%, #f4fcf6 100%);
  --hero-border-color: #e2e8f0;
  --hero-text-main: #006837;
  --bg-card: #ffffff;
  --border-color: #cbd5e1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --secondary: #006837;
  --secondary-glow: rgba(0, 104, 55, 0.05);
  --primary: #d97706;
  --primary-glow: rgba(217, 119, 6, 0.05);
}

.stats-hero-banner {
  background: var(--hero-bg-gradient);
  border-bottom: 1px solid var(--hero-border-color);
  padding: 80px 0;
  text-align: center;
  color: var(--hero-text-main);
  position: relative;
  overflow: hidden;
}

.stats-hero-banner::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, transparent 60%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Stat Metric Counter Cards */
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 30px 25px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.03);
  transition: var(--transition-smooth);
}

.metric-card:hover {
  transform: translateY(-5px);
  border-color: rgba(4, 120, 87, 0.3);
  box-shadow: 0 20px 40px rgba(4, 120, 87, 0.06);
}

.metric-card-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--secondary-glow);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 20px auto;
}

.metric-card-saffron .metric-card-icon {
  background: var(--primary-glow);
  color: var(--primary);
}

.metric-card-blue .metric-card-icon {
  background: rgba(2, 132, 199, 0.08);
  color: var(--accent-blue);
}

.metric-val {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 5px;
  letter-spacing: -0.03em;
}

.metric-label {
  font-family: var(--font-heading);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Charts Wrapper */
.chart-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.03);
  padding: 30px;
  height: 100%;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 320px;
  margin-top: 20px;
}

/* Detailed Trade Table Styling */
.table-panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.03);
  padding: 35px;
}

.custom-table {
  width: 100%;
  margin-bottom: 0;
  vertical-align: middle;
  border-collapse: separate;
  border-spacing: 0 8px;
}

.custom-table thead th {
  background: #f1f5f9;
  border: none;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-main);
  padding: 15px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.custom-table thead th:first-child {
  border-radius: 10px 0 0 10px;
}

.custom-table thead th:last-child {
  border-radius: 0 10px 10px 0;
}

.custom-table tbody tr {
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.01);
  transition: var(--transition-smooth);
}

.custom-table tbody tr:hover {
  transform: scale(1.005);
}

.custom-table tbody td {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 15px;
  font-size: 0.95rem;
}

.custom-table tbody td:first-child {
  border-left: 1px solid var(--border-color);
  border-radius: 10px 0 0 10px;
}

.custom-table tbody td:last-child {
  border-right: 1px solid var(--border-color);
  border-radius: 0 10px 10px 0;
}

.stat-trend-indicator {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 20px;
}

.stat-trend-up {
  background: rgba(16, 185, 129, 0.1);
  color: var(--secondary);
}

.stat-trend-down {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.table-search-input {
  border-radius: 30px;
  padding: 10px 25px;
  border-color: var(--border-color);
  font-size: 0.9rem;
  max-width: 320px;
}

.table-search-input:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px var(--secondary-glow);
}

/* Feature Images */
.featured-stat-img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}

.featured-stat-img:hover {
  transform: scale(1.02);
}

/* Premium Trade Statistics Dashboard (Light Theme - Concept 1) */
.trade-dashboard-box {
  display: flex;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.06);
  margin-top: 30px;
  min-height: 750px;
  position: relative;
}

/* Sidebar Styling */
.trade-dashboard-sidebar {
  width: 320px;
  background: rgba(248, 250, 252, 0.5);
  border-right: 1px solid rgba(226, 232, 240, 0.8);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-search-wrapper {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(255, 255, 255, 0.6);
}

.sidebar-search-input {
  border-radius: 30px;
  padding: 12px 24px;
  border: 1px solid rgba(203, 213, 225, 0.8);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
  width: 100%;
}

.sidebar-search-input:focus {
  border-color: #006837;
  box-shadow: 0 0 0 3px rgba(0, 104, 55, 0.12);
  outline: none;
}

.country-list-scroll {
  flex-grow: 1;
  overflow-y: auto;
  max-height: 620px;
  padding: 15px 10px;
}

.country-list-scroll::-webkit-scrollbar {
  width: 5px;
}

.country-list-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.1);
  border-radius: 10px;
}

.country-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-radius: 14px;
  color: #475569;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  margin-bottom: 6px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.country-item:hover {
  background: rgba(0, 104, 55, 0.04);
  color: #006837;
  transform: translateX(3px);
}

.country-item.active {
  background: rgba(0, 104, 55, 0.08);
  color: #006837;
  border-color: rgba(0, 104, 55, 0.15);
  box-shadow: 0 4px 12px rgba(0, 104, 55, 0.04);
}

.country-badge-trade {
  font-size: 0.72rem;
  font-weight: 800;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.8);
  color: #64748b;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.country-item.active .country-badge-trade {
  background: #006837;
  color: #ffffff;
  border-color: #006837;
}

/* Main Panel Styling */
.trade-dashboard-main {
  flex-grow: 1;
  padding: 40px;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.showcase-header {
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  padding-bottom: 24px;
  margin-bottom: 30px;
}

.showcase-country-title {
  font-family: var(--font-heading);
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
}

.showcase-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.showcase-metric-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 20px;
  padding: 20px 24px;
  text-align: left;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.02);
  transition: all 0.3s ease;
}

.showcase-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.04);
}

.showcase-metric-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 800;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}

.showcase-metric-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

/* Route Map Visualizer (GSAP Morphed) */
.route-map-container {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.01), 0 10px 30px rgba(15, 23, 42, 0.02);
}

.route-map-svg {
  width: 100%;
  height: auto;
  max-height: 220px;
  display: block;
}

/* Double-Bar Chart Visualizer */
.chart-panel-visualizer {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 24px;
  padding: 30px;
  margin-bottom: 30px;
  position: relative;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.02);
}

.chart-legend-box {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  justify-content: flex-end;
}

.legend-item {
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: #475569;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 8px;
}

.legend-export { background: #d97706; }
.legend-import { background: #006837; }

/* Custom CSS-drawn Bar Chart with gridlines */
.custom-bars-wrapper {
  display: flex;
  height: 280px;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 2px solid #e2e8f0;
  padding: 0 10px 10px 50px; /* offset left to fit Y-axis labels */
  position: relative;
}

.chart-grid-lines {
  position: absolute;
  top: 0;
  left: 50px;
  right: 10px;
  height: 230px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  z-index: 1;
}

.grid-line {
  width: 100%;
  border-bottom: 1px dashed rgba(203, 213, 225, 0.4);
  position: relative;
}

.grid-line::before {
  content: attr(data-label);
  position: absolute;
  right: 100%;
  bottom: -6px;
  margin-right: 12px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #94a3b8;
}

.bar-year-group-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 16%;
  z-index: 2;
}

.bar-values-pair {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 230px;
  width: 100%;
  justify-content: center;
}

.bar-fill-indicator {
  width: 20px;
  height: 0%;
  border-radius: 6px 6px 0 0;
  transition: height 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
}

.bar-fill-indicator:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.bar-fill-export {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15);
}

.bar-fill-import {
  background: linear-gradient(180deg, #10b981 0%, #006837 100%);
  box-shadow: 0 4px 12px rgba(0, 104, 55, 0.15);
}

/* Tooltip on hover */
.bar-fill-indicator::after {
  content: attr(data-val);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -8px) scale(0.95);
  background: #0f172a;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.12);
  z-index: 10;
}

.bar-fill-indicator:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -8px) scale(1);
}

.bar-year-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: #64748b;
  margin-top: 10px;
}

/* Cargo vectors details */
.cargo-vectors-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

.cargo-vector-list-wrapper {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.01);
}

.cargo-vector-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.cargo-vector-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-left: 0;
  margin-bottom: 0;
  list-style: none;
}

.cargo-vector-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cargo-vector-item.export-tag {
  background: rgba(217, 119, 6, 0.06);
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.15);
}

.cargo-vector-item.export-tag:hover {
  background: rgba(217, 119, 6, 0.1);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.08);
}

.cargo-vector-item.import-tag {
  background: rgba(0, 104, 55, 0.06);
  color: #006837;
  border: 1px solid rgba(0, 104, 55, 0.15);
}

.cargo-vector-item.import-tag:hover {
  background: rgba(0, 104, 55, 0.1);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 10px rgba(0, 104, 55, 0.08);
}

/* Responsive adjustments */
@media (max-width: 991px) {
  .trade-dashboard-box {
    flex-direction: column;
  }
  .trade-dashboard-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  }
  .country-list-scroll {
    max-height: 250px;
  }
  .showcase-metrics-grid {
    grid-template-columns: 1fr;
  }
  .cargo-vectors-grid {
    grid-template-columns: 1fr;
  }
}

