/* CineAHO KOSIS Inflation Stats Stylesheet */

/* Theme & Variables */
:root {
  /* HSL Colors */
  --hue-purple: 270;
  --hue-blue: 210;
  --hue-green: 145;
  --hue-gold: 45;
  --hue-red: 350;
  --hue-cyan: 190;

  /* Theme Core (Dark Mode default) */
  --bg-color: #060913;
  --bg-grid: rgba(255, 255, 255, 0.015);
  
  --panel-bg: rgba(14, 20, 38, 0.55);
  --panel-border: rgba(255, 255, 255, 0.05);
  --panel-hover-border: rgba(0, 242, 254, 0.25);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dark: #475569;
  
  /* Gradation Accents */
  --grad-purple: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
  --grad-blue: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --grad-cyan: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  --grad-green: linear-gradient(135deg, #10b981 0%, #047857 100%);
  --grad-gold: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  --grad-red: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
  
  --neon-glow: 0 0 30px rgba(126, 34, 206, 0.2);
  --neon-border-glow: 0 0 15px rgba(0, 242, 254, 0.3);

  --font-main: 'Noto Sans KR', 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
  
  --highlight-color: #fbbf24;
}

[data-theme="light"] {
  --bg-color: #f8fafc;
  --bg-grid: rgba(15, 23, 42, 0.02);
  
  --panel-bg: rgba(255, 255, 255, 0.7);
  --panel-border: rgba(15, 23, 42, 0.06);
  --panel-hover-border: rgba(59, 130, 246, 0.3);
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dark: #cbd5e1;
  
  --neon-glow: 0 0 30px rgba(59, 130, 246, 0.1);
  --shadow-card: 0 12px 40px 0 rgba(15, 23, 42, 0.08);
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background-color 0.5s ease, color 0.3s ease;
}

/* Grid Background */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -2;
  pointer-events: none;
}

/* Ambient Glow */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(160px);
  z-index: -3;
  pointer-events: none;
  opacity: 0.25;
}

.bg-glow-purple {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #7e22ce 0%, transparent 70%);
  top: -100px;
  left: 5%;
}

.bg-glow-blue {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #2563eb 0%, transparent 70%);
  top: 30%;
  right: 5%;
}

/* Common Panels */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--panel-hover-border);
}

/* Header */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  margin: 1rem 1.5rem 0 1.5rem;
  border-radius: 50px;
  transition: var(--transition-smooth);
}

.glass-header {
  background: rgba(14, 20, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.logo-circle {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-text {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
}

.logo-text span {
  color: var(--text-muted);
  font-weight: 400;
}

.header-nav {
  flex-grow: 1;
  margin: 0 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-nav::-webkit-scrollbar {
  display: none;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  white-space: nowrap;
}

.nav-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  padding: 0.5rem 0.25rem;
  position: relative;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--text-main);
}

.nav-list a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #2563eb;
  border-radius: 2px;
}

.btn-back-dashboard {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  padding: 0.5rem 1.2rem;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-back-dashboard:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #2563eb;
  transform: translateX(-2px);
}

/* Kosis Container */
.kosis-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Header Section */
.kosis-header-section {
  text-align: center;
}

.main-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
}

.main-title span {
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 1.5rem auto;
  line-height: 1.6;
}

.tag-badges {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.25rem 0.75rem;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Main Dashboard Panel */
.dashboard-panel {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.db-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.db-title-bar h3 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.db-title-bar span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-refresh {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  padding: 0.55rem 1.25rem;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-refresh:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4);
}

/* 6 Category Cards Grid */
.category-cards-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 0.5rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  position: relative;
  gap: 0.65rem;
  transition: var(--transition-smooth);
}

.cat-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.cat-card.active {
  border-color: rgba(37, 99, 235, 0.5);
  background: rgba(37, 99, 235, 0.12);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.08) inset;
}

.card-icon {
  font-size: 1.35rem;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Blue dot on top-right corner of active card */
.card-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 6px;
  height: 6px;
  background-color: #3b82f6;
  border-radius: 50%;
  box-shadow: 0 0 10px #3b82f6;
}

/* Settings Filter Box */
.filter-panel {
  padding: 1.25rem 1.5rem;
}

.filter-row {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: 2rem;
  align-items: center;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrapper select {
  width: 100%;
  padding: 0.6rem 2.25rem 0.6rem 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  appearance: none;
}

.select-wrapper i {
  position: absolute;
  right: 0.85rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  pointer-events: none;
}

.index-desc-text {
  font-size: 0.75rem;
  color: var(--text-dark);
  margin-top: 0.15rem;
}

/* Range group styling */
.range-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.range-header label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.range-date-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: #3b82f6;
}

.range-buttons {
  display: flex;
  gap: 0.35rem;
}

.btn-range {
  flex: 1;
  padding: 0.5rem 0.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-range:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-range.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

/* Analysis Tabbing Area */
.analysis-tabs-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.analysis-tabs-bar {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: #3b82f6;
  background: rgba(37, 99, 235, 0.08);
}

/* Info Alert Banner */
.info-alert-banner {
  display: flex;
  gap: 1rem;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  align-items: flex-start;
}

.info-bulb {
  font-size: 1.25rem;
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
  margin-top: 0.15rem;
}

.info-text-box h5 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.info-text-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Tab contents hide/show */
.tab-content {
  display: none;
}

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

/* Canvas chart wrapper */
.chart-canvas-wrapper {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

#inflation-chart,
#compare-chart {
  display: block;
  max-width: 100%;
}

/* Interactive Chart Tooltip */
.chart-tooltip {
  position: absolute;
  background: rgba(14, 20, 38, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.8rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

/* Compare View Checkbox Grid */
.compare-control-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.compare-control-box h5 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.compare-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.comp-check-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
}

.comp-check-item input {
  accent-color: #3b82f6;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.comp-check-item input:checked + span {
  color: #fff;
  font-weight: 600;
}

/* 4) Statistical Analysis summaries */
.analysis-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.analysis-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.analysis-card span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.analysis-card strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
}

.analysis-editorial-box {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 1.5rem;
  border-radius: 16px;
}

.analysis-editorial-box h5 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.analysis-editorial-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 5) Raw Data Table Area */
.data-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.data-table-header h5 {
  font-size: 0.85rem;
  font-weight: 700;
}

.btn-export-csv {
  background: #10b981;
  color: #fff;
  border: none;
  padding: 0.5rem 1.2rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
  transition: var(--transition-smooth);
}

.btn-export-csv:hover {
  background: #059669;
  transform: translateY(-1px);
}

.table-scroll-area {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
}

.kosis-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.kosis-data-table th {
  background: rgba(14, 20, 38, 0.8);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kosis-data-table td {
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-family: var(--font-display);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.kosis-data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* 6) Info Document Tab */
.info-document-panel h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #3b82f6;
}

.info-doc-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.info-doc-section h5 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  border-left: 3px solid #3b82f6;
  padding-left: 0.5rem;
}

.info-doc-section p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.text-blue { color: #3b82f6; }
.text-green { color: #10b981; }
.text-orange { color: #f97316; }
.text-cyan { color: #06b6d4; }
.text-purple { color: #8b5cf6; }
.text-red { color: #ef4444; }

/* ----------------------------------------------------
   Floating Navigator Widgets
   ---------------------------------------------------- */
.floating-navigator {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.85rem;
  z-index: 1000;
}

.nav-overlay-menu {
  width: 200px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: var(--transition-smooth);
  margin-bottom: 0.25rem;
}

.nav-overlay-menu.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.nav-overlay-menu h5 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.5rem;
}

.nav-overlay-menu ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.50rem;
}

.nav-overlay-menu li {
  font-size: 0.8rem;
  color: var(--text-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.nav-overlay-menu li:hover,
.nav-overlay-menu li.active {
  color: var(--text-main);
}

.nav-overlay-menu li span {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255,255,255,0.04);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  color: #10b981;
}

.nav-overlay-menu li.active span {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.floating-buttons-col {
  display: flex;
  flex-direction: column;
  gap: 0.50rem;
  align-items: center;
}

.progress-badge {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.progress-ring__circle {
  transition: stroke-dashoffset 0.35s;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.progress-text {
  position: absolute;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 800;
  color: #3b82f6;
}

.btn-float {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(14, 20, 38, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-float:hover {
  background: #2563eb;
  border-color: #2563eb;
  transform: translateY(-2px);
}

/* Toast Alert Box */
.toast-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(16, 185, 129, 0.95);
  color: #ffffff;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.35);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.toast-notification.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsiveness */
@media (max-width: 1024px) {
  .category-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .filter-row {
    grid-template-columns: 1fr;
  }
  .analysis-tabs-bar {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .analysis-tabs-bar::-webkit-scrollbar {
    display: none;
  }
  .analysis-summary-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .category-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .analysis-summary-grid {
    grid-template-columns: 1fr;
  }
}
