/* ═══════════════════════════════════════════
   DELHI HC CASE ALERT — STYLESHEET v2.0
   ═══════════════════════════════════════════ */

/* ── THEME TOKENS ── */
:root {
  --font:      'DM Sans', system-ui, sans-serif;
  --mono:      'JetBrains Mono', monospace;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 3px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --shadow-lg: 0 4px 24px rgba(0,0,0,.10);
  --transition: .22s cubic-bezier(.4,0,.2,1);
}

/* ── DARK (default) ── */
[data-theme="dark"] {
  --bg:        #0a0f1a;
  --bg2:       #111827;
  --surface:   #1a2235;
  --surface2:  #232f45;
  --border:    #2a3650;
  --text:      #e8ecf4;
  --text2:     #94a3b8;
  --text3:     #64748b;
  --accent:    #3b82f6;
  --accent-fg: #fff;
  --green:     #22c55e;
  --orange:    #f59e0b;
  --red:       #ef4444;
  --card-glow: rgba(59,130,246,.06);
}

/* ── LIGHT ── */
[data-theme="light"] {
  --bg:        #f0f2f5;
  --bg2:       #fff;
  --surface:   #ffffff;
  --surface2:  #f8f9fb;
  --border:    #e2e8f0;
  --text:      #0f172a;
  --text2:     #475569;
  --text3:     #94a3b8;
  --accent:    #2563eb;
  --accent-fg: #fff;
  --green:     #16a34a;
  --orange:    #d97706;
  --red:       #dc2626;
  --card-glow: rgba(37,99,235,.04);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── SHELL ── */
.shell {
  max-width: 1060px;
  margin: 0 auto;
  padding: 20px 20px 40px;
}

/* ═══════ TOP BAR ═══════ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 20px;
  flex-wrap: wrap;
}
.topbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar__logo {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--accent);
  color: #fff;
  border-radius: 12px;
  flex-shrink: 0;
}
.topbar__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.topbar__sub {
  font-size: 13px;
  color: var(--text2);
  font-weight: 400;
}
.topbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar__live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--green);
  background: rgba(34,197,94,.08);
  padding: 5px 12px;
  border-radius: 20px;
}

/* pulse dot */
.pulse {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulsate 2s ease infinite;
}
@keyframes pulsate {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .4; transform: scale(.7); }
}

/* icon button */
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.icon-btn:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--text3);
}

/* ═══════ STATS ═══════ */
.stats {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.stat {
  flex: 1;
  min-width: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
  transition: background var(--transition), border-color var(--transition);
}
.stat__num {
  display: block;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.2;
}
.stat__lbl {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  margin-top: 3px;
}

/* ═══════ CARDS (panels) ═══════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  transition: background var(--transition), border-color var(--transition);
}
.card__heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text);
}
.card__heading svg { color: var(--accent); flex-shrink: 0; }
.card__heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ═══════ FORM ELEMENTS ═══════ */
.lbl {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 6px;
}
.lbl span { font-weight: 400; color: var(--text3); }

textarea, input[type="number"], select, .filter-bar input {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: 14px;
}
textarea:focus, input[type="number"]:focus, select:focus, .filter-bar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 16px;
  line-height: 1.5;
}
.hint svg { flex-shrink: 0; margin-top: 1px; }

/* ═══════ BUTTONS ═══════ */
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), transform .12s, box-shadow var(--transition);
}
.btn:active { transform: scale(.97); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
  box-shadow: 0 2px 8px rgba(59,130,246,.3);
}
.btn--primary:hover { box-shadow: 0 4px 16px rgba(59,130,246,.4); }

.btn--ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border);
}
.btn--ghost:hover { background: var(--surface2); color: var(--text); }

.btn--outline {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
}
.btn--outline:hover { background: rgba(34,197,94,.08); }

.btn--whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 9px 18px;
  background: #25d366;
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .2s;
}
.btn--whatsapp:hover { background: #1ebe57; }

/* ═══════ BADGE ═══════ */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px; height: 22px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--mono);
  color: #fff;
  background: var(--accent);
  border-radius: 12px;
}

/* ═══════ ALERT LIST ═══════ */
.alert-list {
  list-style: none;
}
.alert-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.alert-list li:last-child { border-bottom: none; }
.alert-list li:hover { background: var(--card-glow); }
.alert-list .al-icon {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: rgba(59,130,246,.1);
  color: var(--accent);
  border-radius: 8px;
  flex-shrink: 0;
}
.alert-list .al-text { flex: 1; }
.alert-list .al-time { font-size: 11px; color: var(--text3); font-family: var(--mono); }

/* ═══════ FILTER BAR ═══════ */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.filter-bar input { flex: 1; margin-bottom: 0; }
.filter-bar select { width: 180px; margin-bottom: 0; }

/* ═══════ COURT GRID ═══════ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.grid__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--text3);
  font-size: 14px;
}

/* ── Court Card ── */
.court-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: transform .18s, box-shadow .25s, border-color .25s, background var(--transition);
  position: relative;
  overflow: hidden;
}
.court-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  border-radius: 4px 0 0 4px;
}
.court-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.court-card.s-hearing::before  { background: var(--accent); }
.court-card.s-mentioning::before { background: var(--orange); }
.court-card.s-idle::before     { background: var(--text3); }
.court-card.s-completed::before { background: var(--green); }

/* highlight tracked court */
.court-card.tracked {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}

.cc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.cc-court {
  font-size: 15px;
  font-weight: 700;
}
.cc-tag {
  font-size: 10px;
  font-family: var(--mono);
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .04em;
}
.cc-tag.t-hearing    { background: rgba(59,130,246,.12); color: var(--accent); }
.cc-tag.t-mentioning { background: rgba(245,158,11,.12); color: var(--orange); }
.cc-tag.t-idle       { background: rgba(100,116,139,.1);  color: var(--text3); }
.cc-tag.t-completed  { background: rgba(34,197,94,.1);    color: var(--green); }

.cc-row {
  font-size: 13px;
  color: var(--text2);
  padding: 3px 0;
  display: flex;
  gap: 6px;
}
.cc-row b {
  color: var(--text);
  font-weight: 500;
  min-width: 66px;
  flex-shrink: 0;
}
.cc-item {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.cc-details {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.cc-details summary {
  font-size: 12px;
  font-weight: 500;
  color: var(--text3);
  cursor: pointer;
  user-select: none;
}
.cc-details summary:hover { color: var(--text2); }
.cc-details div {
  font-size: 12px;
  color: var(--text2);
  margin-top: 4px;
  line-height: 1.5;
  word-break: break-word;
}

/* ═══════ TOAST ═══════ */
.toast-box {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  color: var(--text);
  animation: slideIn .3s ease;
  max-width: 340px;
}
.toast--success { border-left: 3px solid var(--green); }
.toast--warn    { border-left: 3px solid var(--orange); }
.toast--error   { border-left: 3px solid var(--red); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ═══════ FOOTER ═══════ */
.foot {
  text-align: center;
  font-size: 12px;
  color: var(--text3);
  padding: 20px 0 0;
  line-height: 1.7;
}
.foot strong { color: var(--text2); font-weight: 500; }
.foot__credit { margin-top: 2px; font-style: italic; }
.foot__credit strong { color: var(--text); }

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 640px) {
  .shell { padding: 12px 12px 30px; }
  .topbar { gap: 8px; }
  .topbar__title { font-size: 17px; }
  .stats { gap: 6px; }
  .stat { min-width: 70px; padding: 10px 8px; }
  .stat__num { font-size: 18px; }
  .row-2col { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; }
  .filter-bar select { width: 100%; }
  .btn-row { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}

/* ═══════ SCROLLBAR (dark) ═══════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ═══════ ANIMATIONS ═══════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.court-card { animation: fadeUp .35s ease both; }
.court-card:nth-child(2) { animation-delay: .03s; }
.court-card:nth-child(3) { animation-delay: .06s; }
.court-card:nth-child(4) { animation-delay: .09s; }
.court-card:nth-child(5) { animation-delay: .12s; }
.court-card:nth-child(6) { animation-delay: .15s; }
