/* =========================================================
   STAR v1.9 — Dark Glassmorphism Design System
   Premium Enterprise Aesthetic · Discovr Now
   ========================================================= */

:root {
  /* Core Palette */
  --bg-dark: #060911;
  --bg-card: rgba(15, 20, 35, 0.72);
  --bg-card-solid: #0f1423;
  --bg-card-hover: rgba(22, 30, 52, 0.88);
  --bg-elevated: rgba(20, 26, 46, 0.85);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(99, 149, 255, 0.2);

  /* Accent Colors */
  --accent-blue: #4f8fff;
  --accent-blue-deep: #2d6bea;
  --accent-purple: #9572ff;
  --accent-green: #22c984;
  --accent-green-deep: #0ea570;
  --accent-red: #f05252;
  --accent-red-deep: #d63636;
  --accent-amber: #f5a623;

  /* Text Hierarchy */
  --text-main: #eaf0f9;
  --text-secondary: #bbc5d7;
  --text-muted: #6b7a94;

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Radii */
  --radius-xl: 20px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.30), 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 8px 40px rgba(0, 0, 0, 0.45), 0 0 80px rgba(79, 143, 255, 0.04);
  --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.50), 0 0 40px rgba(79, 143, 255, 0.06);
  --shadow-btn: 0 2px 12px rgba(0, 0, 0, 0.30);
}

/* =========================================================
   Reset & Base
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(ellipse 80% 60% at 5% 5%, rgba(79, 143, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 95% 95%, rgba(149, 114, 255, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse 40% 40% at 50% 0%, rgba(79, 143, 255, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 20px;
}

::selection {
  background: rgba(79, 143, 255, 0.3);
  color: #fff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* =========================================================
   Layout Container
   ========================================================= */
.app-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 28px;
}

/* =========================================================
   Navbar / Header
   ========================================================= */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  padding: 16px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

/* Subtle top gradient border effect */
.navbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 143, 255, 0.35), rgba(149, 114, 255, 0.25), transparent);
  pointer-events: none;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
  transition: filter 0.3s ease;
}

.brand-logo-img:hover {
  filter: drop-shadow(0 2px 14px rgba(79, 143, 255, 0.3));
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 40%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text h1 span {
  color: var(--accent-blue);
  font-size: 12px;
  background: rgba(79, 143, 255, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
  vertical-align: middle;
  -webkit-text-fill-color: var(--accent-blue);
}

.logo-text p {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-metrics {
  display: flex;
  gap: 10px;
}

.metric-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.metric-pill:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-glow);
}

.metric-pill strong {
  color: var(--text-main);
  font-weight: 600;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.recording-dot {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green), 0 0 16px rgba(34, 201, 132, 0.3);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.25); opacity: 1; }
}

.header-actions {
  display: flex;
  gap: 10px;
}

/* =========================================================
   Control Bar & Filters
   ========================================================= */
.control-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-filter {
  display: flex;
  gap: 12px;
  flex: 1;
  min-width: 300px;
}

#search-input {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 11px 16px;
  color: var(--text-main);
  font-size: 13.5px;
  outline: none;
  flex: 1;
  transition: all 0.3s ease;
}

#search-input::placeholder {
  color: var(--text-muted);
}

#search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(79, 143, 255, 0.12), 0 0 20px rgba(79, 143, 255, 0.06);
}

.filter-tabs {
  display: flex;
  background: var(--bg-card);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 2px;
  position: relative;
}

.tab-glide-pill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(79, 143, 255, 0.25), rgba(149, 114, 255, 0.25));
  border: 1px solid rgba(79, 143, 255, 0.4);
  border-radius: 8px;
  transition: left 0.4s cubic-bezier(0.65, 0, 0.35, 1), width 0.4s cubic-bezier(0.65, 0, 0.35, 1);
  pointer-events: none;
  z-index: 0;
  will-change: transform, opacity;
  transform: translateZ(0);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  z-index: 1;
}

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

.tab-btn.active {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-deep));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(79, 143, 255, 0.25);
}

.filter-tabs:has(.tab-glide-pill) .tab-btn.active {
  background: transparent;
  box-shadow: none;
}

.global-actions {
  display: flex;
  gap: 10px;
}

/* =========================================================
   Buttons — Polished with gradients & micro-interactions
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 40px;
  white-space: nowrap;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn:hover::after {
  opacity: 1;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(145deg, var(--accent-blue), var(--accent-blue-deep));
  color: #fff;
  box-shadow: var(--shadow-btn), 0 0 20px rgba(79, 143, 255, 0.12);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(79, 143, 255, 0.30), 0 0 40px rgba(79, 143, 255, 0.08);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glow);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--text-main);
}

.btn-success {
  background: linear-gradient(145deg, var(--accent-green), var(--accent-green-deep));
  color: #fff;
  box-shadow: var(--shadow-btn), 0 0 20px rgba(34, 201, 132, 0.10);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(34, 201, 132, 0.25);
}

.btn-danger {
  background: linear-gradient(145deg, var(--accent-red), var(--accent-red-deep));
  color: #fff;
  box-shadow: var(--shadow-btn), 0 0 20px rgba(240, 82, 82, 0.10);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(240, 82, 82, 0.25);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
  min-height: 36px;
  border-radius: var(--radius-sm);
}

/* =========================================================
   Section Titles & Badges
   ========================================================= */
.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title h2 {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.badge {
  background: rgba(79, 143, 255, 0.10);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent-blue);
  border: 1px solid rgba(79, 143, 255, 0.12);
}

/* =========================================================
   Stations Grid
   ========================================================= */
.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

/* =========================================================
   Station Card — Glass Effect
   ========================================================= */
.station-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Top highlight line on cards */
.station-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  pointer-events: none;
}

.station-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.station-card.recording {
  border-left: 3px solid var(--accent-green);
}

.station-card.stopped {
  border-left: 3px solid var(--text-muted);
}

.station-card.error {
  border-left: 3px solid var(--accent-red);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.type-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}

.type-tag.radio {
  background: rgba(149, 114, 255, 0.14);
  color: #b8a1ff;
  border: 1px solid rgba(149, 114, 255, 0.12);
}

.type-tag.tv {
  background: rgba(79, 143, 255, 0.14);
  color: #80b3ff;
  border: 1px solid rgba(79, 143, 255, 0.12);
}

.type-tag.global {
  background: rgba(245, 166, 35, 0.14);
  color: #f5c970;
  border: 1px solid rgba(245, 166, 35, 0.12);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.status-badge.recording {
  background: rgba(34, 201, 132, 0.12);
  color: #4adb9f;
  border: 1px solid rgba(34, 201, 132, 0.15);
}

.status-badge.stopped {
  background: rgba(107, 122, 148, 0.12);
  color: #8fa3be;
  border: 1px solid rgba(107, 122, 148, 0.12);
}

.status-badge.error {
  background: rgba(240, 82, 82, 0.12);
  color: #ff8080;
  border: 1px solid rgba(240, 82, 82, 0.15);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--text-main);
  line-height: 1.3;
}

.card-slug {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  letter-spacing: 0.2px;
}

.card-url {
  font-size: 11.5px;
  color: var(--text-muted);
  word-break: break-all;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 8px;
}

/* =========================================================
   Modal — Premium Glass Overlay
   ========================================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 5, 10, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 999;
  padding: 16px;
  will-change: transform, opacity;
  transform: translateZ(0);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1) translateZ(0);
  opacity: 1;
}

.modal-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-glow), 0 0 100px rgba(79, 143, 255, 0.03);
  transform: translateY(12px) scale(0.97) translateZ(0);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  will-change: transform, opacity;
}

/* Gradient top edge on modals */
.modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 143, 255, 0.4), rgba(149, 114, 255, 0.3), transparent);
  pointer-events: none;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.close-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  line-height: 1;
}

.close-btn:hover {
  background: rgba(240, 82, 82, 0.12);
  border-color: rgba(240, 82, 82, 0.2);
  color: var(--accent-red);
}

/* =========================================================
   Forms — Refined Inputs
   ========================================================= */
.form-group {
  margin-bottom: 18px;
}

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

label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

input,
select {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 13.5px;
  outline: none;
  min-height: 42px;
  transition: all 0.25s ease;
}

input::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(79, 143, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236b7a94' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

select option {
  background: #111726;
  color: var(--text-main);
}

small {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

/* =========================================================
   Toast Notifications — Slide-in with glow
   ========================================================= */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.toast {
  background: var(--bg-elevated);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-blue);
  padding: 14px 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  font-size: 13.5px;
  color: var(--text-main);
  animation: toastIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  max-width: 380px;
}

.toast.success {
  border-left-color: var(--accent-green);
}

.toast.error {
  border-left-color: var(--accent-red);
}

.toast.info {
  border-left-color: var(--accent-blue);
}

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* =========================================================
   Loading State & Spinner
   ========================================================= */
.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.loading-state p {
  font-size: 13.5px;
  margin-top: 4px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid rgba(255, 255, 255, 0.06);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s infinite linear;
  margin: 0 auto 14px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================================================
   Skeleton Loaders — Boneyard Shimmer Effect
   ========================================================= */

/* Base bone element with shimmer sweep */
.skeleton-bone {
  background: rgba(255, 255, 255, 0.035);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  will-change: transform, opacity;
  transform: translateZ(0);
}

.skeleton-bone::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(255, 255, 255, 0.04) 40%,
    rgba(255, 255, 255, 0.07) 50%,
    rgba(255, 255, 255, 0.04) 60%,
    transparent 80%
  );
  animation: shimmer 1.6s infinite ease-in-out;
  transform: translateX(-100%);
}

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Fallback for older devices without backdrop-filter support (Automatic Light Mode) */
@supports not (backdrop-filter: blur(10px)) {
  .navbar,
  .station-card,
  .player-card,
  .recordings-panel,
  .catalog-card,
  .program-card,
  .modal-card,
  .modal-overlay,
  .toast,
  .login-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(13, 17, 29, 0.95) !important;
  }
}

/* Skeleton Card — Mimics station / catalog / program cards */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 180px;
}

.skeleton-card .sk-tag {
  width: 54px;
  height: 20px;
  border-radius: 5px;
}

.skeleton-card .sk-title {
  width: 70%;
  height: 18px;
  border-radius: 4px;
  margin-top: 4px;
}

.skeleton-card .sk-subtitle {
  width: 45%;
  height: 12px;
  border-radius: 4px;
}

.skeleton-card .sk-url {
  width: 100%;
  height: 32px;
  border-radius: var(--radius-sm);
  margin-top: 2px;
}

.skeleton-card .sk-divider {
  width: 100%;
  height: 1px;
  background: var(--border-color);
  margin-top: auto;
}

.skeleton-card .sk-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.skeleton-card .sk-btn {
  height: 34px;
  border-radius: var(--radius-sm);
  flex: 1;
}

/* Skeleton Row — Mimics table row structure */
.skeleton-row td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.skeleton-row .sk-cell {
  height: 14px;
  border-radius: 4px;
  display: block;
}

.skeleton-row .sk-cell-sm {
  height: 10px;
  border-radius: 3px;
  margin-top: 6px;
  width: 60%;
  display: block;
}

.skeleton-row .sk-cell-tag {
  width: 48px;
  height: 20px;
  border-radius: 5px;
  display: inline-block;
}

.skeleton-row .sk-cell-btn {
  height: 32px;
  width: 80px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* Skeleton Player — Mimics sidebar player structure */
.skeleton-player {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-player .sk-player-title {
  width: 65%;
  height: 18px;
  border-radius: 4px;
}

.skeleton-player .sk-player-subtitle {
  width: 80%;
  height: 12px;
  border-radius: 4px;
}

.skeleton-player .sk-player-screen {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.3);
}

.skeleton-player .sk-player-btn {
  width: 100%;
  height: 36px;
  border-radius: var(--radius-sm);
}

/* Content Fade-In Transition */
.content-fade-in {
  animation: contentReveal 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes contentReveal {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   Global Footer
   ========================================================= */
.global-footer {
  text-align: center;
  padding: 24px 0 14px 0;
  margin-top: 48px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12.5px;
  letter-spacing: 0.2px;
}

.global-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.global-footer a:hover {
  color: var(--accent-blue);
}

/* =========================================================
   Responsive — Mobile-First Optimization (<=768px)
   ========================================================= */
@media (max-width: 768px) {
  .app-container {
    padding: 12px 14px;
  }

  .navbar {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    text-align: center;
    border-radius: var(--radius-lg);
  }

  .navbar::before {
    left: 10%;
    right: 10%;
  }

  .logo-group {
    flex-direction: column;
    gap: 6px;
    align-items: center;
  }

  .logo-text h1 {
    font-size: 20px;
  }

  .nav-metrics {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    gap: 6px;
  }

  .metric-pill {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    gap: 8px;
  }

  .header-actions .btn {
    flex: 1;
    min-width: 90px;
    justify-content: center;
    min-height: 42px;
  }

  .control-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .search-filter {
    flex-direction: column;
    min-width: 100%;
  }

  .filter-tabs {
    flex-wrap: wrap;
    width: 100%;
  }

  .tab-btn {
    flex: 1;
    text-align: center;
    min-height: 42px;
    padding: 10px 8px;
    font-size: 12px;
  }

  .global-actions {
    width: 100%;
  }

  .global-actions .btn {
    flex: 1;
    justify-content: center;
    min-height: 42px;
  }

  .stations-grid {
    grid-template-columns: 1fr;
  }

  .portal-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .player-card {
    position: static;
    width: 100%;
    padding: 18px;
  }

  .modal-card {
    width: 94%;
    max-height: 88vh;
    padding: 24px 18px;
    border-radius: var(--radius-lg);
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .btn {
    min-height: 42px;
  }

  .btn-sm {
    min-height: 40px;
    padding: 8px 12px;
  }

  .file-table th,
  .file-table td {
    padding: 10px 8px;
    font-size: 12px;
    white-space: nowrap;
  }

  .catalog-grid,
  .programs-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* Tablet breakpoint refinement */
@media (min-width: 769px) and (max-width: 1024px) {
  .stations-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .nav-metrics {
    flex-wrap: wrap;
  }
}

/* =========================================================
   Changelog Modal & Version Trigger Styles
   ========================================================= */
.changelog-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}

.changelog-item {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.25s ease;
}

.changelog-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-glow);
  transform: translateX(2px);
}

.changelog-badge {
  background: rgba(79, 143, 255, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(79, 143, 255, 0.2);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.changelog-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.version-trigger {
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
  font-weight: 500;
}

.version-trigger:hover {
  color: var(--accent-blue);
}

/* Push Notification Permission Button States */
.btn-push-compact {
  padding: 6px 12px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.2px;
  white-space: nowrap;
  border-radius: var(--radius-sm) !important;
}

.btn-push-granted {
  border-color: rgba(34, 201, 132, 0.4) !important;
  color: var(--accent-green) !important;
  background: rgba(34, 201, 132, 0.08) !important;
  cursor: default;
}

.btn-push-denied {
  border-color: rgba(240, 82, 82, 0.4) !important;
  color: var(--accent-red) !important;
  background: rgba(240, 82, 82, 0.08) !important;
  cursor: pointer;
}

/* Discreet PWA Install Banner */
.pwa-portal-banner {
  background: linear-gradient(135deg, rgba(79, 143, 255, 0.12), rgba(149, 114, 255, 0.12));
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
