@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-main: #0b0f19;
  --bg-card: #151c2c;
  --bg-input: #0f172a;
  --border-color: rgba(255, 255, 255, 0.08);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-green: #10b981;
  --accent-green-bright: #34d399;
  --accent-cyan: #38bdf8;
  --accent-amber: #fbbf24;
  --accent-red: #f87171;
  
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  padding: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 640px) {
  body {
    padding: 24px;
  }
}

/* --- Container --- */
#main-content {
  max-width: 1200px;
  margin: 0 auto;
}

/* --- Login Screen --- */
#login-screen {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.login-box {
  background: var(--bg-card);
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 380px;
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.login-box h2 {
  color: var(--text-main);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.login-box input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.login-box input:focus {
  border-color: var(--accent-green);
}

.login-box button {
  width: 100%;
  padding: 14px;
  background: var(--accent-green);
  border: none;
  color: #0f172a;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.login-box button:hover {
  background: var(--accent-green-bright);
}

.login-box button:active {
  transform: scale(0.98);
}

/* --- Header --- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

header h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Zöld "élő" jelző pötty a cím mellett */
header h1::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: var(--accent-green-bright);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-green-bright);
}

@media (min-width: 640px) {
  header h1 {
    font-size: 1.6rem;
  }
}

header button {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--accent-red);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

header button:hover {
  background: var(--accent-red);
  color: #ffffff;
}

/* --- Grid Layout --- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* --- Card Design --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-header {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 12px;
}

.card-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-green-bright);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.card-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 500;
}

/* --- Sub Metrics (Mini kártyák a kártyán belül) --- */
.sub-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.mini-card {
  background: var(--bg-main);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.mini-card .title {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.mini-card .val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

/* --- Controls / Időszak választó gombok --- */
.controls {
  background: var(--bg-card);
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 768px) {
  .controls {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.btn-group {
  display: flex;
  background: var(--bg-main);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 4px;
}

.btn-group button {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-group button:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

/* Kiemelkedő, éles aktív gomb gombstílus */
.btn-group button.active {
  background: var(--accent-green);
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

/* --- Chart Card --- */
.chart-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
}

@media (min-width: 640px) {
  .chart-card {
    padding: 24px;
  }
}

#chart {
  width: 100%;
  min-height: 350px;
}

/* ApexCharts egyedi sötét téma finomhangolások */
.apexcharts-tooltip {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
  color: #f8fafc !important;
  border-radius: 8px !important;
}

.apexcharts-tooltip-title {
  background: #0f172a !important;
  border-bottom: 1px solid #334155 !important;
  font-weight: 700 !important;
  color: #cbd5e1 !important;
}

.apexcharts-legend-text {
  color: #94a3b8 !important;
  font-weight: 600 !important;
}

.apexcharts-xaxis-label, .apexcharts-yaxis-label {
  fill: #64748b !important;
}
