/*
 * ╔══════════════════════════════════════════════════════════════════════╗
 * ║  ui-layout.css — Premium Style Layer for Esports.INFO.BD             ║
 * ║  Extends the existing Tailwind + style.css system with a premium     ║
 * ║  sidebar, card, table, and layout classes.                           ║
 * ║  All vars come from the HSL tokens defined in style.css.             ║
 * ╚══════════════════════════════════════════════════════════════════════╝
 */

/* ── Shadcn Sidebar (premium redesign of #sidebar) ──────────────────── */
#sidebar {
  --sb-accent-line: linear-gradient(180deg, hsl(var(--primary)), hsl(217 80% 70%));
  background: #0a1220;
  border-right: 1px solid rgba(59, 130, 246, 0.12);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="light"] #sidebar {
  background: #ffffff;
  border-right: 1px solid hsl(var(--border));
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.08);
}

/* Brand header */
.sidebar-brand {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.08));
  border-bottom: 1px solid rgba(59, 130, 246, 0.14);
  padding: 0 1.125rem;
}

html[data-theme="light"] .sidebar-brand {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(124, 58, 237, 0.03));
  border-bottom: 1px solid hsl(var(--border));
}

.sidebar-brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(217 80% 70%));
  border-radius: 8px;
  clip-path: none;
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.4);
}

.sidebar-brand-name {
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

/* User card */
.sidebar-user {
  background: rgba(59, 130, 246, 0.04);
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
  padding: 0.875rem 1.125rem;
}

html[data-theme="light"] .sidebar-user {
  background: rgba(37, 99, 235, 0.03);
  border-bottom: 1px solid hsl(var(--border));
}

.sidebar-avatar,
.sidebar-avatar-placeholder {
  border: 2px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.sidebar-user-role {
  font-size: 0.68rem;
  color: hsl(var(--primary));
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* Section labels */
.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  padding: 1.1rem 1.25rem 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sidebar-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(59, 130, 246, 0.1);
  margin-left: 0.35rem;
}

html[data-theme="light"] .sidebar-section-label::after {
  background: hsl(var(--border));
}

/* Nav links — Shadcn style */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.575rem 1rem;
  margin: 0.1rem 0.625rem;
  border-radius: 0.5rem;
  font-size: 0.855rem;
  font-weight: 450;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
  position: relative;
  cursor: pointer;
  border: 1px solid transparent;
}

.sidebar-link:hover {
  color: hsl(var(--foreground));
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.15);
}

.sidebar-link.active {
  color: #e2e8f0;
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.25);
  font-weight: 600;
  box-shadow: inset 3px 0 0 hsl(var(--primary));
}

.sidebar-link.active::before {
  display: none; /* replaced by box-shadow inset */
}

.sidebar-icon {
  width: 17px;
  text-align: center;
  font-size: 0.875rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-link.active .sidebar-icon {
  color: hsl(var(--primary));
  opacity: 1;
}

/* Light-mode link overrides */
html[data-theme="light"] .sidebar-link { color: #475569; }
html[data-theme="light"] .sidebar-link:hover {
  color: #1e40af;
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.15);
}
html[data-theme="light"] .sidebar-link.active {
  color: #1e3a8a;
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: inset 3px 0 0 hsl(var(--primary));
}

/* Sidebar badge */
.sidebar-badge {
  margin-left: auto;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.38rem;
  border-radius: 9999px;
  min-width: 17px;
  text-align: center;
  line-height: 1.4;
}

.sidebar-badge-danger { background: #dc2626; }

/* Bottom section */
.sidebar-bottom {
  padding: 0.625rem;
  border-top: 1px solid rgba(59, 130, 246, 0.1);
}

html[data-theme="light"] .sidebar-bottom {
  border-top: 1px solid hsl(var(--border));
}

/* ── Topbar Shadcn polish ────────────────────────────────────────────── */
#topbar {
  background: rgba(6, 9, 15, 0.92);
  backdrop-filter: blur(12px) saturate(1.6);
  -webkit-backdrop-filter: blur(12px) saturate(1.6);
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

html[data-theme="light"] #topbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: hsl(var(--border));
}

.topbar-page-title {
  font-size: 1.05rem;
  color: hsl(var(--foreground));
}

.topbar-btn {
  color: hsl(var(--muted-foreground));
  border-radius: 0.5rem;
}

.topbar-btn:hover {
  color: hsl(var(--foreground));
  background: rgba(59, 130, 246, 0.1);
}

/* ── Shadcn Card (general-purpose) ────────────────────────────────────── */
.shadcn-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-shadcn);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.shadcn-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
}

html[data-theme="light"] .shadcn-card {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.shadcn-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.shadcn-card-title {
  font-family: 'Oxanium', 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  letter-spacing: 0.02em;
}

.shadcn-card-description {
  font-size: 0.82rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.2rem;
}

.shadcn-card-body {
  padding: 1.25rem 1.5rem;
}

.shadcn-card-footer {
  padding: 0.875rem 1.5rem;
  border-top: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Shadcn Table ─────────────────────────────────────────────────────── */
.shadcn-table-wrap {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-shadcn);
  overflow: hidden;
}

.shadcn-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.shadcn-table thead th {
  background: rgba(59, 130, 246, 0.06);
  color: hsl(var(--muted-foreground));
  font-family: 'Oxanium', 'Space Grotesk', sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid hsl(var(--border));
  white-space: nowrap;
}

html[data-theme="light"] .shadcn-table thead th {
  background: rgba(37, 99, 235, 0.05);
}

.shadcn-table tbody td {
  padding: 0.7rem 1rem;
  color: hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border));
  transition: background 0.15s;
}

.shadcn-table tbody tr:last-child td { border-bottom: none; }

.shadcn-table tbody tr:hover td {
  background: rgba(59, 130, 246, 0.04);
}

html[data-theme="light"] .shadcn-table tbody tr:hover td {
  background: rgba(37, 99, 235, 0.04);
}

/* ── Shadcn Button variants ───────────────────────────────────────────── */
.shadcn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.shadcn-btn-default {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.shadcn-btn-default:hover {
  background: hsl(var(--primary) / 0.85);
  color: hsl(var(--primary-foreground));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.shadcn-btn-outline {
  background: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
}

.shadcn-btn-outline:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.shadcn-btn-ghost {
  background: transparent;
  color: hsl(var(--muted-foreground));
}

.shadcn-btn-ghost:hover {
  background: rgba(59, 130, 246, 0.1);
  color: hsl(var(--foreground));
}

.shadcn-btn-destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

.shadcn-btn-destructive:hover {
  background: hsl(var(--destructive) / 0.85);
  color: hsl(var(--destructive-foreground));
}

.shadcn-btn-sm {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
}

.shadcn-btn-xs {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.375rem;
}

/* ── Shadcn Badge ─────────────────────────────────────────────────────── */
.shadcn-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  transition: opacity 0.15s;
}

.shadcn-badge-default   { background: rgba(59,130,246,0.18);  color: #60a5fa;  border-color: rgba(59,130,246,0.3); }
.shadcn-badge-secondary { background: rgba(148,163,184,0.15); color: #94a3b8;  border-color: rgba(148,163,184,0.25); }
.shadcn-badge-success   { background: rgba(34,197,94,0.15);   color: #4ade80;  border-color: rgba(34,197,94,0.3); }
.shadcn-badge-warning   { background: rgba(245,158,11,0.15);  color: #fbbf24;  border-color: rgba(245,158,11,0.3); }
.shadcn-badge-danger    { background: rgba(239,68,68,0.15);   color: #f87171;  border-color: rgba(239,68,68,0.3); }
.shadcn-badge-violet    { background: rgba(139,92,246,0.15);  color: #a78bfa;  border-color: rgba(139,92,246,0.3); }

html[data-theme="light"] .shadcn-badge-default   { background: rgba(37,99,235,0.1);  color: #1e40af; border-color: rgba(37,99,235,0.22); }
html[data-theme="light"] .shadcn-badge-success   { background: rgba(22,163,74,0.1);  color: #15803d; border-color: rgba(22,163,74,0.22); }
html[data-theme="light"] .shadcn-badge-warning   { background: rgba(180,83,9,0.1);   color: #92400e; border-color: rgba(180,83,9,0.22); }
html[data-theme="light"] .shadcn-badge-danger    { background: rgba(220,38,38,0.1);  color: #b91c1c; border-color: rgba(220,38,38,0.22); }
html[data-theme="light"] .shadcn-badge-violet    { background: rgba(124,58,237,0.1); color: #7c3aed; border-color: rgba(124,58,237,0.22); }

/* ── Shadcn Input ─────────────────────────────────────────────────────── */
.shadcn-input {
  display: flex;
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--input));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  padding: 0.5rem 0.875rem;
  transition: border-color 0.18s, box-shadow 0.18s;
  font-family: inherit;
  outline: none;
}

.shadcn-input::placeholder { color: hsl(var(--muted-foreground)); }

.shadcn-input:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.2);
}

/* ── Shadcn Select ────────────────────────────────────────────────────── */
.shadcn-select {
  display: flex;
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--input));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  padding: 0.5rem 0.875rem;
  transition: border-color 0.18s, box-shadow 0.18s;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.shadcn-select:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.2);
}

/* ── Shadcn Separator ─────────────────────────────────────────────────── */
.shadcn-separator {
  height: 1px;
  width: 100%;
  background: hsl(var(--border));
  border: none;
  margin: 0;
}

.shadcn-separator-vertical {
  width: 1px;
  height: 100%;
  background: hsl(var(--border));
}

/* ── Page layout helpers ──────────────────────────────────────────────── */
.shadcn-page-header {
  margin-bottom: 1.5rem;
}

.shadcn-page-title {
  font-family: 'Oxanium', 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  letter-spacing: 0.02em;
  line-height: 1.2;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.shadcn-page-description {
  font-size: 0.9rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.35rem;
}

.shadcn-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.75rem;
}

.shadcn-breadcrumb a {
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.15s;
}

.shadcn-breadcrumb a:hover { color: hsl(var(--foreground)); }

.shadcn-breadcrumb-sep {
  opacity: 0.4;
  font-size: 0.7rem;
}

/* ── Stat Card (Shadcn flavour) ────────────────────────────────────────── */
.shadcn-stat-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-shadcn);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.shadcn-stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.04), transparent);
  pointer-events: none;
}

.shadcn-stat-card:hover {
  border-color: rgba(59, 130, 246, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.1);
}

.shadcn-stat-label {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.5rem;
}

.shadcn-stat-value {
  font-family: 'Oxanium', 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: hsl(var(--foreground));
  margin-bottom: 0.375rem;
}

.shadcn-stat-sub {
  font-size: 0.76rem;
  color: hsl(var(--muted-foreground));
}

.shadcn-stat-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.75rem;
  opacity: 0.1;
  color: hsl(var(--primary));
}

/* ── Skeleton wrapper helpers ──────────────────────────────────────────── */
/* Wrapper for displaying skeleton states inside panels */
.sk-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.sk-list      { display: flex; flex-direction: column; gap: 0.5rem; }
.sk-row       { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }

/* ── Notification skeleton specific fix ────────────────────────────────── */
#notifDropdownLoading .skeleton {
  background: rgba(148, 163, 184, 0.08);
}
html[data-theme="light"] #notifDropdownLoading .skeleton {
  background: rgba(15, 23, 42, 0.06);
}
