/* ================================================
   IS CESTNÁ SIEŤ KOŠICE — STYLESHEET
   Dark City Operations Center Theme
   Fonts: Syne + DM Sans + JetBrains Mono
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── CSS VARIABLES ──────────────────────────── */
:root {
  --bg:             #030a1a;
  --bg-card:        #0b1628;
  --bg-hover:       #101e36;
  --border:         rgba(6, 182, 212, 0.12);
  --border-bright:  rgba(6, 182, 212, 0.35);
  --accent:         #06b6d4;
  --accent-glow:    rgba(6, 182, 212, 0.22);
  --green:          #10b981;
  --green-glow:     rgba(16, 185, 129, 0.2);
  --yellow:         #f59e0b;
  --red:            #ef4444;
  --purple:         #8b5cf6;
  --text-primary:   #e2e8f0;
  --text-secondary: #6d85aa;
  --text-dim:       #334d6e;
  --ff-heading:     'Syne', sans-serif;
  --ff-body:        'DM Sans', sans-serif;
  --ff-mono:        'JetBrains Mono', monospace;
  --radius:         14px;
  --radius-sm:      9px;
  --shadow:         0 4px 28px rgba(0,0,0,0.45);
  --shadow-glow:    0 0 35px var(--accent-glow);
  --ease:           cubic-bezier(.4,0,.2,1);
}

/* ─── RESET & BASE ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--ff-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(6,182,212,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6,182,212,.025) 1px, transparent 1px);
  background-size: 52px 52px;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: #fff; }
img { max-width: 100%; }

/* ─── AUTH PAGES ─────────────────────────────── */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 55%, rgba(6,182,212,.09) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 45%, rgba(139,92,246,.07) 0%, transparent 55%),
    linear-gradient(rgba(6,182,212,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6,182,212,.025) 1px, transparent 1px);
  background-size: auto, auto, 52px 52px, 52px 52px;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 52px 42px;
  box-shadow: var(--shadow), 0 0 60px rgba(6,182,212,.08);
  animation: slideUp .5s var(--ease) forwards;
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 40%, var(--purple) 70%, transparent 100%);
  animation: shimmerBar 4s ease infinite;
}

@keyframes shimmerBar {
  0%,100% { opacity: .5; }
  50%      { opacity: 1; }
}

.auth-brand {
  text-align: center;
  margin-bottom: 38px;
}

.auth-brand-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 18px;
}

.auth-brand-logos img {
  height: 38px;
  filter: brightness(0) invert(1) opacity(.75);
  transition: opacity .2s;
}
.auth-brand-logos img:hover { opacity: 1; }

.auth-brand h1 {
  font-family: var(--ff-heading);
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.4px;
}

.auth-brand p {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: .6px;
  text-transform: uppercase;
  margin-top: 4px;
}

.auth-subtitle {
  font-family: var(--ff-heading);
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 22px;
  color: var(--text-primary);
}

/* ─── ALERTS ─────────────────────────────────── */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.5;
}
.alert-error   { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.25);  color: #fca5a5; }
.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25); color: #6ee7b7; }

/* ─── FORMS ──────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.form-group input,
.form-group select,
.filter-input {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--ff-body);
  font-size: 14px;
  padding: 11px 15px;
  outline: none;
  transition: all .22s var(--ease);
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.filter-input:focus {
  border-color: var(--accent);
  background: rgba(6,182,212,.05);
  box-shadow: 0 0 0 3px rgba(6,182,212,.12);
}

.form-group input::placeholder,
.filter-input::placeholder { color: var(--text-dim); }
.form-group select option,
.filter-input option          { background: #0f1e38; }

/* ─── BUTTONS ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--ff-body);
  font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: all .22s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent); color: #030a1a; width: 100%;
  margin-top: 4px;
}
.btn-primary:hover {
  background: #fff; color: #030a1a;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(6,182,212,.38);
}

.btn-secondary {
  background: rgba(255,255,255,.06);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(255,255,255,.1);
  border-color: var(--border-bright);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-bright);
  background: rgba(255,255,255,.04);
}

.btn-danger {
  background: rgba(239,68,68,.1);
  color: var(--red);
  border: 1px solid rgba(239,68,68,.2);
  padding: 6px 12px;
  font-size: 12px;
}
.btn-danger:hover {
  background: var(--red); color: #fff;
  transform: translateY(-1px);
}

.btn-sm { padding: 7px 14px; font-size: 13px; }

.auth-footer {
  text-align: center;
  margin-top: 26px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ─── TOPBAR ─────────────────────────────────── */
.topbar {
  display: flex; align-items: center;
  padding: 0 32px; height: 70px;
  background: rgba(11,22,40,.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 100;
  gap: 18px;
}

.topbar-logos {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.topbar-logos img {
  height: 36px;
  filter: brightness(0) invert(1) opacity(.8);
}

.topbar-divider {
  width: 1px; height: 28px;
  background: var(--border); flex-shrink: 0;
}

.topbar-title {
  flex: 1;
  font-family: var(--ff-heading);
  font-size: 17px; font-weight: 800;
  color: #fff; letter-spacing: -.3px;
}
.topbar-title span { color: var(--accent); }

.topbar-user { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.user-badge {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 5px 14px 5px 6px;
}

.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  font-family: var(--ff-heading);
}

.user-name { font-size: 13px; font-weight: 500; color: var(--text-primary); }

.logout-btn {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  padding: 7px 13px; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all .2s var(--ease);
}
.logout-btn:hover {
  color: var(--red);
  border-color: rgba(239,68,68,.2);
  background: rgba(239,68,68,.06);
}

/* ─── MAIN CONTENT ───────────────────────────── */
.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 30px 32px;
}

/* ─── STATS GRID ─────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: relative; overflow: hidden;
  transition: all .25s var(--ease);
  animation: fadeUp .5s var(--ease) both;
}
.stat-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

.stat-card::after {
  content: ''; position: absolute;
  bottom: 0; left: 0; right: 0; height: 2px;
}
.stat-card.cyan::after  { background: var(--accent); }
.stat-card.green::after { background: var(--green); }
.stat-card.yellow::after{ background: var(--yellow); }
.stat-card.red::after   { background: var(--red); }

.stat-card.cyan  { animation-delay: 0s; }
.stat-card.green { animation-delay: .08s; }
.stat-card.yellow{ animation-delay: .16s; }
.stat-card.red   { animation-delay: .24s; }

.stat-icon  { font-size: 26px; margin-bottom: 10px; display: block; }
.stat-value {
  font-family: var(--ff-mono);
  font-size: 38px; font-weight: 500;
  color: #fff; line-height: 1; margin-bottom: 5px;
}
.stat-label { font-size: 13px; color: var(--text-secondary); }

/* ─── INSIGHTS ROW ───────────────────────────── */
.insights-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  margin-bottom: 26px;
}

.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  animation: fadeUp .5s .3s var(--ease) both;
}

.insight-card h3 {
  font-family: var(--ff-heading);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.chart-wrap {
  display: flex; align-items: center; justify-content: center;
  height: 160px;
}

.stav-legend { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.stav-legend-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.stav-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.stav-lbl  { flex: 1; color: var(--text-secondary); }
.stav-cnt  { font-family: var(--ff-mono); font-size: 13px; color: var(--text-primary); }

.speed-zones {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px;
}

.speed-zone {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}
.speed-zone-val {
  font-family: var(--ff-mono); font-size: 26px; color: #fff;
}
.speed-zone-lbl { font-size: 11px; color: var(--text-secondary); margin-top: 3px; }

/* ─── PANEL HEADER ───────────────────────────── */
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.panel-title {
  font-family: var(--ff-heading); font-size: 20px; font-weight: 800;
  color: #fff; letter-spacing: -.3px;
}
.panel-actions { display: flex; gap: 10px; align-items: center; }

/* ─── FILTERS PANEL ──────────────────────────── */
.filters-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 18px;
  overflow: hidden;
  max-height: 300px;
  opacity: 1;
  transition: max-height .35s var(--ease), opacity .3s, padding .3s, margin .3s, border-color .3s;
}

.filters-card.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0; padding-bottom: 0;
  margin-bottom: 0;
  border-color: transparent;
}

.filters-form {
  display: grid;
  grid-template-columns: 2fr 1.5fr .9fr .9fr 1.6fr 1fr auto auto;
  gap: 12px;
  align-items: end;
}

.filter-group label {
  display: block;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  color: var(--text-dim); margin-bottom: 6px;
}

/* ─── TABLE ──────────────────────────────────── */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fadeUp .5s .35s var(--ease) both;
}

.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,.15);
}

.result-count { font-size: 13px; color: var(--text-secondary); }
.result-count strong { color: var(--accent); font-family: var(--ff-mono); font-size: 14px; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 13px 20px; text-align: left;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .9px;
  color: var(--text-dim);
  background: rgba(0,0,0,.18);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.sort-link {
  color: var(--text-dim);
  display: inline-flex; align-items: center; gap: 5px;
  transition: color .18s;
}
.sort-link:hover { color: var(--text-primary); }
.sort-link.active { color: var(--accent); }
.sort-arrow { font-size: 11px; }

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.03);
  transition: background .18s, border-color .18s;
  animation: rowIn .4s var(--ease) both;
  opacity: 0;
}
tbody tr:hover {
  background: rgba(6,182,212,.04);
  border-bottom-color: rgba(6,182,212,.08);
}
tbody tr:last-child { border-bottom: none; }

tbody td { padding: 13px 20px; font-size: 14px; color: var(--text-primary); }
.td-mono { font-family: var(--ff-mono); font-size: 14px; }
.td-muted { color: var(--text-secondary); font-size: 12px; }

/* Row stagger */
tbody tr:nth-child(1)  { animation-delay: .04s; }
tbody tr:nth-child(2)  { animation-delay: .08s; }
tbody tr:nth-child(3)  { animation-delay: .12s; }
tbody tr:nth-child(4)  { animation-delay: .16s; }
tbody tr:nth-child(5)  { animation-delay: .20s; }
tbody tr:nth-child(6)  { animation-delay: .24s; }
tbody tr:nth-child(7)  { animation-delay: .28s; }
tbody tr:nth-child(8)  { animation-delay: .32s; }
tbody tr:nth-child(9)  { animation-delay: .36s; }
tbody tr:nth-child(10) { animation-delay: .40s; }

/* ─── BADGES ─────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; }

.badge-vyborny    { background: rgba(16,185,129,.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,.25); }
.badge-vyborny::before  { background: var(--green); box-shadow: 0 0 5px var(--green); }

.badge-dobry      { background: rgba(6,182,212,.12);  color: #67e8f9; border: 1px solid rgba(6,182,212,.25); }
.badge-dobry::before    { background: var(--accent); box-shadow: 0 0 5px var(--accent); }

.badge-uspokojivo { background: rgba(245,158,11,.12); color: #fcd34d; border: 1px solid rgba(245,158,11,.25); }
.badge-uspokojivo::before { background: var(--yellow); }

.badge-poskodeny  { background: rgba(239,68,68,.12);  color: #fca5a5; border: 1px solid rgba(239,68,68,.25); }
.badge-poskodeny::before  { background: var(--red); animation: pulse 1.4s infinite; }

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.6); }
  50%      { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}

/* ─── EMPTY STATE ────────────────────────────── */
.empty-state {
  text-align: center; padding: 64px 24px; color: var(--text-secondary);
}
.empty-icon { font-size: 48px; display: block; margin-bottom: 12px; opacity: .35; }

/* ─── MODAL ──────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(3,10,26,.88);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: opacity .28s var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid rgba(6,182,212,.18);
  border-radius: 20px; padding: 36px;
  width: 100%; max-width: 460px;
  box-shadow: 0 30px 70px rgba(0,0,0,.65);
  transform: translateY(22px) scale(.97);
  transition: transform .28s var(--ease);
  position: relative; overflow: hidden;
}
.modal::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--purple), transparent);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 26px;
}
.modal-title {
  font-family: var(--ff-heading); font-size: 19px; font-weight: 700; color: #fff;
}
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.modal-close:hover { background: rgba(239,68,68,.1); color: var(--red); border-color: rgba(239,68,68,.25); }

/* ─── FAB ────────────────────────────────────── */
.fab {
  position: fixed; bottom: 30px; right: 30px;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--accent); color: #030a1a;
  font-size: 26px; font-weight: 300; line-height: 1;
  border: none; cursor: pointer;
  box-shadow: 0 4px 22px rgba(6,182,212,.42);
  transition: all .25s var(--ease);
  display: flex; align-items: center; justify-content: center;
  z-index: 99;
}
.fab:hover { transform: scale(1.1) rotate(45deg); box-shadow: 0 6px 32px rgba(6,182,212,.65); }

/* ─── TOASTS ─────────────────────────────────── */
.toast-container {
  position: fixed; top: 82px; right: 22px;
  z-index: 2000; display: flex; flex-direction: column; gap: 9px;
}
.toast {
  padding: 13px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 9px;
  min-width: 270px;
  animation: slideInRight .3s var(--ease), fadeOut .3s 3.5s var(--ease) forwards;
  transition: opacity .3s, transform .3s;
}
.toast-success { background: rgba(16,185,129,.14); border: 1px solid rgba(16,185,129,.3); color: #6ee7b7; }
.toast-error   { background: rgba(239,68,68,.14);  border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }

/* ─── ANIMATIONS ─────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rowIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
  to { opacity: 0; transform: translateX(14px); }
}

/* ─── RESPONSIVE ─────────────────────────────── */
@media (max-width: 1180px) {
  .stats-grid       { grid-template-columns: repeat(2, 1fr); }
  .insights-grid    { grid-template-columns: 1fr; }
  .filters-form     { grid-template-columns: 1fr 1fr; }
  .filters-card     { max-height: 600px; }
}

@media (max-width: 780px) {
  .topbar           { padding: 0 16px; gap: 10px; }
  .topbar-title     { font-size: 14px; }
  .topbar-logos img { height: 28px; }
  .user-name        { display: none; }
  .main-content     { padding: 16px; }
  .stats-grid       { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value       { font-size: 28px; }
  .filters-form     { grid-template-columns: 1fr; max-height: 900px; }
  .table-wrap       { overflow-x: auto; }
  table             { min-width: 580px; }
  .auth-card        { padding: 32px 24px; }
  .fab              { bottom: 20px; right: 18px; }
}
