@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Tajawal:wght@400;500;700&display=swap');

@font-face {
  font-family: 'Newfont';
  src: url('/assets/fonts/Newfont.otf') format('opentype');
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --bg-2: #ffffff;
  --ink: #142033;
  --text: #142033;
  --muted: #5f6f84;
  --text-secondary: #5f6f84;
  --accent: #1d73ff;
  --accent-2: #0ea5a4;
  --accent-3: #f97316;
  --accent-4: #f5c242;
  --surface-1: #ffffff;
  --surface-2: #f8fbff;
  --panel: rgba(255, 255, 255, 0.9);
  --border: rgba(43, 61, 84, 0.18);
  --shadow: 0 24px 60px rgba(20, 32, 51, 0.12);
  --shadow-soft: 0 10px 30px rgba(20, 32, 51, 0.08);
  --glow: 0 0 40px rgba(29, 115, 255, 0.18);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-display: "Poppins", "Cairo", "Helvetica Neue", sans-serif;
  --font-body: "Inter", "Tajawal", "Arial", sans-serif;
  --font-arabic: "Newfont", "Cairo", "Tajawal", "Tahoma", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

.u-hidden {
  display: none !important;
}

::selection {
  background: rgba(29, 115, 255, 0.2);
  color: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.7;
  background:
    radial-gradient(ellipse 1400px 900px at 10% 20%, rgba(29, 115, 255, 0.08), transparent 70%),
    radial-gradient(ellipse 1200px 800px at 90% 80%, rgba(14, 165, 164, 0.08), transparent 65%),
    radial-gradient(ellipse 1000px 700px at 50% -20%, rgba(249, 115, 22, 0.05), transparent 60%),
    linear-gradient(180deg, #fcfdff 0%, #f6f8fc 55%, #eff4fb 100%);
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(90deg, rgba(29, 115, 255, 0.02) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(180deg, rgba(14, 165, 164, 0.02) 0 1px, transparent 1px 80px);
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle 620px at 16% 24%, rgba(29, 115, 255, 0.06), transparent 50%),
    radial-gradient(circle 480px at 80% 72%, rgba(249, 115, 22, 0.04), transparent 50%);
  animation: breathe 10s ease-in-out infinite;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

@keyframes breathe {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.72; }
}

/* Arabic / RTL — site is Arabic-only */
html,
body,
.arabic {
  font-family: var(--font-arabic);
  direction: rtl;
  text-align: right;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Newfont", "Cairo", var(--font-display);
  font-weight: 700;
}

/* RTL Adjustments — applied globally */
.main-nav,
.nav {
  direction: rtl;
}

.dashboard-header,
.header-actions {
  flex-direction: row-reverse;
}

.block-item-header,
.activity-item,
.block-meta {
  flex-direction: row-reverse;
}

.columns,
.home-quick-links {
  direction: rtl;
}

/* Better line height for Arabic */
html {
  font-size: 15px;
  line-height: 1.65;
}

p,
li {
  line-height: 1.75;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a:hover {
  color: var(--accent-2);
  text-shadow: 0 0 10px rgba(29, 115, 255, 0.2);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(29, 115, 255, 0.45);
  outline-offset: 3px;
  box-shadow: 0 0 18px rgba(29, 115, 255, 0.24);
}

header {
  padding: 4rem 6vw 2.5rem;
  background:
    linear-gradient(135deg, rgba(14, 165, 164, 0.09) 0%, rgba(29, 115, 255, 0.06) 100%);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.header-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.lang-switcher {
  display: flex;
  gap: 0.5rem;
  background: white;
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.lang-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  background: transparent;
}

.lang-btn:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent);
}

/* User Menu & Auth Links */
.user-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.user-menu-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.user-menu-link:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--accent);
}

.user-logout-form {
  display: flex;
  margin: 0;
}

.user-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: white;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-logout-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #ef4444;
}

.auth-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-link {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s ease;
}

.auth-link:hover {
  color: var(--accent);
}

.auth-link--register {
  background: var(--accent);
  color: white;
  padding: 0.45rem 1.2rem;
}

.auth-link--register:hover {
  background: var(--accent-2);
  color: white;
}

/* Skip Link for Accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  right: 20px;
  background: var(--accent);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  z-index: 10000;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 20px;
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

/* Header Banner Image */
.header-banner {
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.header-banner-img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
}

/* Site Header */
.site-header {
  position: relative;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-brand {
  flex-shrink: 1;
  min-width: 0;
  max-width: 40%;
  overflow: hidden;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.25rem;
  transition: transform 0.3s ease;
  min-width: 0;
}

.logo-link:hover {
  transform: scale(1.05);
}

.logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
  align-items: center;
  justify-content: center;
}

.nav-link {
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  transition: transform 0.3s ease;
}

.nav-link:hover {
  color: var(--accent);
  background: rgba(59, 130, 246, 0.08);
}

.nav-link:hover::after {
  transform: translateX(-50%) scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.search-input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--ink);
  font-size: 0.95rem;
  min-width: 140px;
  width: 180px;
  min-height: 48px;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-btn {
  position: static;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.4rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.search-btn:hover {
  color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 4px;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger::before,
.hamburger::after {
  content: '';
  display: block;
}

.hamburger::before {
  transform: translateY(-6px);
}

.hamburger::after {
  transform: translateY(4px);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
  padding: 3rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-title {
  font-size: 2.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  margin: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

/* Breadcrumbs */
.breadcrumbs {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.breadcrumb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.breadcrumb-link {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

.breadcrumb-link:hover {
  color: var(--accent);
}

.breadcrumb-separator {
  color: var(--border);
  display: flex;
  align-items: center;
}

.breadcrumb-current {
  color: var(--ink);
  font-weight: 500;
}

.breadcrumb-item.active {
  color: var(--ink);
}

.breadcrumb-list {
  direction: rtl;
}

.breadcrumb-separator svg {
  transform: rotate(180deg);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .main-nav {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .main-nav.mobile-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-link {
    padding: 0.75rem 2rem;
    border-radius: 0;
    width: 100%;
  }
  
  .nav-link::after {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .search-input {
    min-width: 150px;
  }
  
  .search-input:focus {
    min-width: 200px;
  }
}

@media (max-width: 640px) {
  .header-container {
    padding: 0.75rem 1rem;
    gap: 1rem;
  }
  
  .logo-text {
    display: none;
  }
  
  .search-form {
    flex: 1;
  }
  
  .search-input {
    width: 100%;
    min-width: auto;
  }
  
  .lang-switcher {
    display: none;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
}

/* RTL Adjustments for Header — applied globally */
.header-container {
  direction: rtl;
}

.search-btn {
  right: auto;
  left: 0.5rem;
}

.search-input {
  padding: 0.6rem 2.5rem 0.6rem 1rem;
}

.header-top {
  justify-content: flex-start;
}

header::before,
header::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.6;
  z-index: 0;
  animation: float 10s ease-in-out infinite;
}

header::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15), transparent 70%);
  top: -250px;
  left: -150px;
  animation-delay: 0s;
}

header::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15), transparent 70%);
  top: -200px;
  right: -100px;
  animation-delay: -5s;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

header .container {
  position: relative;
  z-index: 1;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--ink);
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nav a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nav a:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 15px 40px rgba(0, 217, 255, 0.4),
    0 0 30px rgba(124, 58, 237, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  border-color: rgba(0, 217, 255, 0.5);
  text-shadow: 0 0 10px rgba(0, 217, 255, 0.8);
}

.nav a:hover::before {
  opacity: 0.15;
}

.banner {
  padding: 3rem 6vw;
  color: var(--ink);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(124, 58, 237, 0.5), rgba(236, 72, 153, 0.3)),
    linear-gradient(45deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
  backdrop-filter: blur(10px);
}

.banner .container {
  position: relative;
  z-index: 1;
}

.banner h2 {
  margin-top: 0;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 217, 255, 0.3);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-weight: 700;
  box-shadow:
    0 15px 35px rgba(0, 217, 255, 0.4),
    0 0 20px rgba(0, 217, 255, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.banner-cta:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow:
    0 20px 45px rgba(0, 217, 255, 0.5),
    0 0 40px rgba(124, 58, 237, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

main {
  padding: 2rem 4vw 3rem;
  animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

.columns.layout-3.site-shell {
  max-width: 100%;
}


.hero {
  display: grid;
  gap: 1.5rem;
}

.hero h1 {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.03em;
  margin: 0;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff, var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 10px 40px rgba(0, 217, 255, 0.3);
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.logo {
  height: 52px;
  width: auto;
  vertical-align: middle;
  margin-right: 0.8rem;
  filter: drop-shadow(0 8px 25px rgba(0, 217, 255, 0.5));
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 8px 25px rgba(0, 217, 255, 0.5)); }
  50% { filter: drop-shadow(0 8px 35px rgba(124, 58, 237, 0.7)); }
}

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

.panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  animation: rise 0.7s ease both;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.03), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.panel:hover::before {
  opacity: 1;
}

.panel:hover {
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.12),
    0 0 40px rgba(59, 130, 246, 0.15),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
}

form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-weight: 600;
}

input,
select,
textarea {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font: inherit;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 3px rgba(0, 217, 255, 0.2),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.code-textarea {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  direction: ltr;
  text-align: left;
  white-space: pre;
  tab-size: 2;
}

button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 217, 255, 0.3);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow:
    0 15px 35px rgba(0, 217, 255, 0.4),
    0 0 20px rgba(0, 217, 255, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

button::before,
.link-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2));
  opacity: 0;
  transition: opacity 0.3s ease;
}

button:hover,
.link-button:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    0 20px 45px rgba(0, 217, 255, 0.5),
    0 0 40px rgba(124, 58, 237, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

button:hover::before,
.link-button:hover::before {
  opacity: 1;
}

button:active,
.link-button:active {
  transform: translateY(0) scale(0.98);
}

.link-button {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.link-button:hover {
  background: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(0, 217, 255, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.notice {
  border: 1px solid rgba(0, 217, 255, 0.3);
  background:
    linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(124, 58, 237, 0.1));
  padding: 1rem 1.3rem;
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  box-shadow:
    0 8px 25px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.grid > * {
  animation: rise 0.7s ease both;
}

.grid > *:nth-child(1) { animation-delay: 0.1s; }
.grid > *:nth-child(2) { animation-delay: 0.2s; }
.grid > *:nth-child(3) { animation-delay: 0.3s; }
.grid > *:nth-child(4) { animation-delay: 0.4s; }
.grid > *:nth-child(5) { animation-delay: 0.5s; }
.grid > *:nth-child(6) { animation-delay: 0.6s; }
.grid > *:nth-child(7) { animation-delay: 0.7s; }
.grid > *:nth-child(8) { animation-delay: 0.8s; }

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.columns.layout-3 {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 280px;
  gap: 2.5rem;
  align-items: start;
}

.columns.layout-2 {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.columns.layout-1 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
}

.columns.layout-3 .main-column {
  min-width: 0;
  grid-column: 2;
}

.columns.layout-3 .sidebar-nav {
  grid-column: 1;
}

.columns.layout-3 .sidebar:not(.sidebar-nav) {
  grid-column: 3;
}

.column {
  display: grid;
  gap: 1.5rem;
}

.column.sidebar {
  min-height: 400px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.column.sidebar::-webkit-scrollbar {
  width: 6px;
}

.column.sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 217, 255, 0.3);
  border-radius: 3px;
}

.column.main-column {
  padding: 0 1rem;
  min-height: 400px;
  grid-template-columns: minmax(0, 1fr);
}

.block h3 {
  margin-top: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  background: linear-gradient(135deg, #ffffff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.block-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.block-list li {
  display: grid;
  gap: 0.35rem;
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.block-list li:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 217, 255, 0.3);
  transform: translateX(5px);
  box-shadow: 0 10px 30px rgba(0, 217, 255, 0.2);
}

/* Homepage block media cards with thumbnails */
.block-media-grid {
  display: grid;
  gap: 0.75rem;
}

.block-media-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.75rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  align-items: center;
}

.block-media-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(0, 217, 255, 0.3);
}

.block-media-card-thumb {
  position: relative;
  width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-2, #1a1a2e);
  display: block;
  flex-shrink: 0;
}

.block-media-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.block-media-card:hover .block-media-card-thumb img {
  transform: scale(1.05);
}

.block-media-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent, #00d9ff);
  opacity: 0.5;
}

.block-media-card-placeholder--audio {
  opacity: 0.7;
  background: linear-gradient(135deg, rgba(78, 140, 255, 0.08), rgba(0, 217, 255, 0.12));
}

.block-media-card-placeholder--audio svg {
  filter: drop-shadow(0 1px 2px rgba(0, 217, 255, 0.2));
}

.block-media-card-info {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.block-media-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.block-media-card-info small {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

@media (max-width: 600px) {
  .block-media-card {
    grid-template-columns: 90px 1fr;
  }

  .block-media-card-thumb {
    width: 90px;
  }
}

/* Sidebar variant: vertical card – thumbnail on top, title below */
.block-media-grid--sidebar {
  display: grid;
  gap: 0.75rem;
}

.block-media-card--sidebar {
  display: block;
  padding: 0;
  background: none;
  border: none;
}

.block-media-card--sidebar .block-media-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
}

.block-media-card--sidebar .block-media-card-info {
  padding: 0.35rem 0.15rem 0;
}

.block-media-card--sidebar .block-media-card-title {
  font-size: 0.85rem;
  -webkit-line-clamp: 2;
}

/* Sidebar search block */
.sidebar-search-form {
  width: 100%;
}

.sidebar-search-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.sidebar-search-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.sidebar-search-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 0.95rem;
  min-height: 44px;
  outline: none;
}

.sidebar-search-input::placeholder {
  color: var(--muted);
}

.sidebar-search-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  transition: color 0.2s ease;
}

.sidebar-search-btn:hover {
  color: var(--accent);
}

/* ── Sidebar persistent navigation menu ── */
.sidebar-main-menu {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-1);
}

.sidebar-menu-header {
  margin: 0;
  padding: 0.75rem 1rem;
  background: #3d7a42;
  color: #fff;
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.01em;
}

.sidebar-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-menu-list li + li {
  border-top: 1px solid var(--border);
}

.sidebar-menu-list a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-arabic);
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-menu-list a:hover {
  background: rgba(61, 122, 66, 0.08);
  color: #3d7a42;
}

.sidebar-menu-list li.active a {
  background: rgba(61, 122, 66, 0.12);
  color: #3d7a42;
  font-weight: 700;
}

.sidebar-menu-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
}

.sidebar-menu-label {
  flex: 1;
}

@media (max-width: 768px) {
  .sidebar-main-menu {
    display: none;
  }
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
}

.gallery img {
  width: 100%;
  border-radius: var(--radius-md);
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery img:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow:
    0 20px 50px rgba(0, 217, 255, 0.4),
    0 0 30px rgba(124, 58, 237, 0.3);
  border-color: rgba(0, 217, 255, 0.5);
}

.admin-columns .sortable {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
  min-height: 80px;
}

.sortable-item {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.3rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sortable-item:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  border-color: rgba(0, 217, 255, 0.4);
  box-shadow: 0 10px 30px rgba(0, 217, 255, 0.2);
  transform: translateY(-2px);
}

.sortable-item .actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  text-align: right;
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-table th {
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.admin-table tr:hover {
  background: rgba(0, 217, 255, 0.08);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.admin-action-form {
  display: inline;
}

.admin-pagination-panel {
  margin-top: 1.5rem;
}

.admin-login-field {
  margin-top: 0.75rem;
}

.admin-login-actions {
  margin-top: 1rem;
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  gap: 0.75rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid #ddd;
}

.login-divider span {
  color: #888;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #333;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.google-signin-btn:hover {
  background: #f7f7f7;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.admin-ratings-page .admin-ratings-review {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-comments-page .admin-comments-snippet {
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-ratings-page .stars-display {
  display: flex;
  gap: 2px;
}

.admin-ratings-page .stars-display .star {
  color: #ddd;
  font-size: 1.2rem;
}

.admin-ratings-page .stars-display .star.filled {
  color: #ffd700;
}

.admin-comments-page .admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.admin-comments-page .admin-tabs a {
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.admin-comments-page .admin-tabs a:hover {
  color: var(--accent);
}

.admin-comments-page .admin-tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 500;
}

.admin-ratings-page .link-btn,
.admin-comments-page .link-btn {
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.admin-ratings-page .link-btn:hover,
.admin-comments-page .link-btn:hover {
  text-decoration: none;
}

.admin-ratings-page .link-btn.danger,
.admin-comments-page .link-btn.danger {
  color: #dc3545;
}

.admin-downloads-page .admin-downloads-panel {
  margin-top: 2rem;
}

.admin-downloads-page .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.admin-downloads-page .stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.admin-downloads-page .stat-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.admin-downloads-page .stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.admin-downloads-page .chart-container {
  position: relative;
  height: 300px;
  margin-top: 1rem;
}

.admin-downloads-page .type-stats {
  display: grid;
  gap: 1rem;
}

.admin-downloads-page .type-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-2);
  border-radius: 4px;
}

.admin-downloads-page .type-label {
  font-weight: 500;
}

.admin-downloads-page .type-count {
  color: var(--accent);
  font-weight: bold;
}

.admin-analytics-page__charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-analytics-page__chart-shell {
  position: relative;
}

.admin-analytics-page__chart-shell--standard {
  height: 280px;
}

.admin-analytics-page__top-panel {
  margin-bottom: 1.5rem;
}

.admin-analytics-page__top-chart--compact {
  height: 200px;
}

.admin-analytics-page__top-chart--medium {
  height: 336px;
}

.admin-analytics-page__top-chart--large {
  height: 476px;
}

.admin-analytics-page__top-chart--xlarge {
  height: 600px;
}

@media (max-width: 960px) {
  .admin-analytics-page__charts {
    grid-template-columns: 1fr;
  }
}

.admin-collection-items-page .collection-items-manager {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.admin-collection-items-page .current-items,
.admin-collection-items-page .add-items {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
}

.admin-collection-items-page .current-items h3,
.admin-collection-items-page .add-items h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--ink);
}

.admin-collection-items-page .empty-state {
  color: var(--text-secondary);
  font-style: italic;
  padding: 2rem;
  text-align: center;
  background: #f9f9f9;
  border-radius: 4px;
}

.admin-collection-items-page .col-position {
  width: 60px;
}

.admin-collection-items-page .col-thumbnail,
.admin-collection-items-page .col-actions {
  width: 100px;
}

.admin-collection-items-page .item-position {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  border-radius: 50%;
  font-weight: bold;
}

.admin-collection-items-page .collection-item-thumb-img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.admin-collection-items-page .collection-item-thumb-placeholder {
  width: 80px;
  height: 60px;
  background: #f0f0f0;
  border-radius: 4px;
}

.admin-collection-items-page .form-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.admin-collection-items-page .media-select-group {
  flex: 3;
}

.admin-collection-items-page .position-group {
  flex: 1;
}

.admin-collection-items-page .submit-group {
  flex: 0;
  align-self: flex-end;
}

.admin-collection-items-page .help-text {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #e7f3ff;
  border-right: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 0.9rem;
}

.admin-collection-items-page .link-btn {
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.admin-collection-items-page .link-btn.danger {
  color: #dc3545;
}

.admin-collection-items-page .link-btn:hover {
  text-decoration: none;
}

.admin-audit-logs-page .filters-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.admin-audit-logs-page .filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  align-items: end;
}

.admin-audit-logs-page .filter-search {
  grid-column: span 2;
}

.admin-audit-logs-page .filter-actions {
  display: flex;
  gap: 10px;
}

.admin-audit-logs-page .action-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.admin-audit-logs-page .action-create {
  background: #d4edda;
  color: #155724;
}

.admin-audit-logs-page .action-update {
  background: #d1ecf1;
  color: #0c5460;
}

.admin-audit-logs-page .action-delete {
  background: #f8d7da;
  color: #721c24;
}

.admin-audit-logs-page .action-login_success {
  background: #d1ecf1;
  color: #0c5460;
}

.admin-audit-logs-page .action-login_failed {
  background: #f8d7da;
  color: #721c24;
}

.admin-audit-logs-page .action-logout {
  background: #e2e3e5;
  color: #383d41;
}

.admin-audit-logs-page .entity-badge {
  font-family: monospace;
  font-size: 13px;
  color: #495057;
}

.admin-audit-logs-page .user-badge {
  font-weight: 600;
  color: var(--accent);
}

.admin-audit-logs-page .ip-address {
  font-family: monospace;
  font-size: 12px;
  color: #6c757d;
}

.admin-audit-logs-page .description-cell {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-audit-logs-page .timestamp {
  font-size: 13px;
  color: #6c757d;
}

@media (max-width: 768px) {
  .admin-audit-logs-page .filter-search {
    grid-column: span 1;
  }
}

/* Blocks Manager Styles */
.blocks-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.05));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.blocks-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  color: var(--ink);
}

.header-description {
  margin: 0;
  opacity: 0.7;
  font-size: 0.95rem;
}

.success-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.08));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #065f46;
}

.success-icon {
  font-size: 1.5rem;
}

.blocks-form {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.blocks-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.blocks-column {
  background: rgba(148, 163, 184, 0.03);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  min-height: 400px;
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.column-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--ink);
}

.block-count {
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.blocks-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 200px;
}

.empty-column-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  opacity: 0.4;
  pointer-events: none;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.empty-column-message p {
  margin: 0.5rem 0 0.25rem 0;
  font-weight: 600;
}

.empty-column-message small {
  font-style: italic;
}

.block-item {
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  cursor: move;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.block-item:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.block-item.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.block-item-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.drag-handle {
  font-size: 1.25rem;
  color: var(--muted);
  cursor: grab;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.block-item-info {
  flex: 1;
}

.block-title {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.block-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.block-type-badge {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.block-status {
  font-size: 0.8rem;
  font-weight: 600;
}

.status-active {
  color: #10b981;
}

.status-inactive {
  color: var(--muted);
}

.block-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.action-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  background: white;
  cursor: pointer;
}

.action-edit {
  color: var(--accent);
  border-color: var(--accent);
}

.action-edit:hover {
  background: var(--accent);
  color: white;
}

.action-delete {
  color: #ef4444;
  border-color: #ef4444;
}

.action-delete:hover {
  background: #ef4444;
  color: white;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  padding-top: 2rem;
  border-top: 2px dashed var(--border);
}

.btn-save {
  padding: 1rem 3rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
}

.btn-cancel {
  padding: 1rem 2rem;
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--border);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-cancel:hover {
  background: rgba(100, 116, 139, 0.05);
  border-color: var(--muted);
}

.help-panel {
  margin-top: 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.03), rgba(59, 130, 246, 0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.help-panel h3 {
  margin: 0 0 1.5rem 0;
  font-size: 1.25rem;
  color: var(--ink);
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.tip-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tip-card h4 {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  color: var(--accent);
}

.tip-card pre {
  margin: 0;
  padding: 0.75rem;
  background: rgba(148, 163, 184, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  overflow-x: auto;
}

.help-note {
  background: rgba(59, 130, 246, 0.08);
  border-right: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin: 0;
  font-size: 0.95rem;
}

@media (max-width: 1024px) {
  .blocks-columns {
    grid-template-columns: 1fr;
  }
}

.pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}

.pagination.pagination-block {
  margin: 2rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

.pagination.pagination-block .pagination-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pagination.pagination-block .pagination-list {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.pagination.pagination-block .pagination-link {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s ease;
}

.pagination.pagination-block .pagination-link:hover {
  background: var(--surface-2);
  border-color: rgba(29, 115, 255, 0.45);
}

.pagination.pagination-block .pagination-link.is-current {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}

.pagination.pagination-block .pagination-ellipsis {
  padding: 0.5rem;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .pagination.pagination-block {
    flex-direction: column;
    gap: 1rem;
  }

  .pagination.pagination-block .pagination-list {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Advanced Search Page */
.search-page {
  max-width: 1200px;
  margin: 0 auto;
}

.search-header {
  text-align: center;
  margin-bottom: 2rem;
}

.search-results-count {
  color: var(--muted);
  margin-top: 0.5rem;
}

/* Top Searches Section */
.top-searches-section {
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.top-searches-section h3 {
  margin: 0 0 1.5rem;
  font-size: 1.25rem;
}

.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.search-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.search-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.search-count {
  background: var(--accent);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.search-form-advanced {
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.search-input-wrapper {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-input-main {
  flex: 1;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--ink);
  transition: all 0.3s ease;
}

.search-input-main:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-submit-btn {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.search-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.search-filters-panel {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.filters-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: #143a5f;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.filters-toggle::-webkit-details-marker {
  display: none;
}

.filter-count {
  background: var(--accent);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}

.filter-select,
.filter-input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.filter-select:focus,
.filter-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filters-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.btn-apply-filters {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-apply-filters:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}

.btn-clear-filters {
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
}

.btn-clear-filters:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.search-result-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.search-result-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.result-thumbnail {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--bg);
}

.result-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duration-badge {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.result-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.result-type {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.result-category,
.result-date {
  color: var(--muted);
}

.result-separator {
  color: var(--border);
}

.result-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.4;
}

.result-title a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.result-title a:hover {
  color: var(--accent);
}

.result-summary {
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.result-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.no-results,
.search-empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.no-results-icon,
.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.no-results h3,
.search-empty-state h3 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.search-tips {
  margin-top: 2rem;
  text-align: right;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  background: var(--bg);
  padding: 1.5rem;
  border-radius: var(--radius-md);
}

.search-tips ul {
  margin: 0.5rem 0 0;
  padding-left: 1.5rem;
}

/* Search Suggestions */
.search-suggestions {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 2px dashed var(--border);
}

.search-suggestions h4 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--accent);
}

.suggestion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.suggestion-tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.suggestion-tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.search-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.pagination-btn {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all 0.2s ease;
}

.pagination-btn:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}

.pagination-info {
  color: var(--muted);
  font-weight: 600;
}

@media (max-width: 768px) {
  .search-result-item {
    grid-template-columns: 1fr;
  }
  
  .result-thumbnail {
    max-width: 100%;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
  }
  
  .search-input-wrapper {
    flex-direction: column;
  }
}

.search-results,
.filters-grid {
  direction: rtl;
}

.embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-md);
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(0, 217, 255, 0.2);
}

video,
audio {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.5),
    0 0 20px rgba(0, 217, 255, 0.2);
}

.media-image {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(124, 58, 237, 0.2);
}

.external-card {
  display: grid;
  gap: 1.2rem;
  padding: 1.5rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.external-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(0, 217, 255, 0.3);
  border-color: rgba(0, 217, 255, 0.3);
}

.article-body {
  display: grid;
  gap: 1.3rem;
  line-height: 1.8;
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
  overflow: hidden;
}

.article-body img,
.article-body table,
.article-body pre,
.article-body iframe,
.article-body video {
  max-width: 100%;
  height: auto;
}

.article-body * {
  max-width: 100%;
}

/* Article Meta (reading time + share) */
.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.article-meta-item svg {
  opacity: 0.7;
}

.article-share-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-article-share {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-article-share:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-article-share[data-platform="twitter"]:hover {
  background: #1DA1F2;
  border-color: #1DA1F2;
}

.btn-article-share[data-platform="facebook"]:hover {
  background: #1877F2;
  border-color: #1877F2;
}

.btn-article-share[data-platform="linkedin"]:hover {
  background: #0A66C2;
  border-color: #0A66C2;
}

/* Article Table of Contents */
.article-toc {
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(124, 58, 237, 0.05));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
}

.article-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.article-toc-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--ink);
  font-weight: 600;
}

.toc-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.toc-toggle:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.toc-toggle svg {
  transition: transform 0.2s ease;
}

.toc-toggle.collapsed svg {
  transform: rotate(-180deg);
}

.article-toc-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: all 0.3s ease;
  max-height: 500px;
  overflow: hidden;
}

.article-toc-list.collapsed {
  max-height: 0;
  opacity: 0;
}

.toc-item {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border-right: 2px solid transparent;
}

.toc-item:hover {
  background: var(--bg);
  color: var(--ink);
  border-right-color: var(--accent);
  padding-right: 1rem;
}

.toc-item.active {
  background: var(--bg);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

.toc-level-2 {
  padding-left: 0.75rem;
}

.toc-level-3 {
  padding-left: 1.5rem;
  font-size: 0.85rem;
}

/* Related Content Section */
.related-content {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border);
}

.related-content h3 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.related-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  border-color: var(--accent);
}

.related-card-image {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: var(--bg);
}

.related-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.related-card:hover .related-card-image img {
  transform: scale(1.1);
}

.related-card-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.related-card-content h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.related-card-content p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
}

.related-card-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(124, 58, 237, 0.15));
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

@media (max-width: 768px) {
  .article-meta {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .article-share-buttons {
    width: 100%;
    justify-content: center;
  }
  
  .related-grid {
    grid-template-columns: 1fr;
  }
}

/* Chapters Section */
.chapters-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.chapters-section summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.chapters-section summary::-webkit-details-marker {
  display: none;
}

.chapters-section summary h3 {
  display: inline;
}

.chapters-section h3 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  color: var(--ink);
}

.chapters-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chapter-item {
  margin: 0;
}

.chapter-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--ink);
  text-align: right;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.chapter-button:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateX(4px);
}

.chapter-button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.chapter-time {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 70px;
  color: inherit;
}

.chapter-title {
  flex: 1;
  font-weight: 500;
  color: inherit;
}

/* Admin Chapters Section */
.chapters-section.admin-chapters {
  background: var(--bg);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-top: 1.5rem;
}

.chapters-section h3 {
  margin: 0 0 0.5rem;
}

.help-text {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

#chapters-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.chapter-item {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.chapter-time,
.chapter-title {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.95rem;
}

.chapter-time {
  width: 150px;
}

.chapter-title {
  flex: 1;
}

.btn-remove-chapter {
  padding: 0.6rem 1rem;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-remove-chapter:hover {
  background: #dc2626;
  transform: scale(1.05);
}

.btn-add-chapter {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-add-chapter:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .chapter-item {
    grid-template-columns: 1fr;
  }
  
  .chapter-time {
    width: 100%;
  }
  
  .chapter-button {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

.chapter-button:hover {
  transform: translateX(-4px);
}

/* Media Controls (Share button) */
.media-controls {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.btn-share-timestamp {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-share-timestamp:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-share-timestamp:active {
  transform: translateY(0);
}

.btn-share-timestamp svg {
  flex-shrink: 0;
}

.share-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: #10b981;
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
  animation: slideInUp 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  z-index: 1000;
}

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

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .media-controls {
    flex-direction: column;
  }
  
  .btn-share-timestamp {
    width: 100%;
    justify-content: center;
  }
  
  .share-notification {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    text-align: center;
  }
}

/* Plyr Audio Player with Custom Controls */
.audio-player-wrapper {
  position: relative;
}

.audio-custom-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.btn-skip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-skip:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: scale(1.05);
}

.btn-skip svg {
  flex-shrink: 0;
}

/* Plyr customization to match site theme */
.plyr {
  --plyr-color-main: var(--accent);
  --plyr-video-control-background-hover: var(--accent);
  --plyr-video-control-color-hover: white;
}

.plyr--audio .plyr__controls {
  background: var(--bg-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 1rem;
}

.plyr--video .plyr__controls {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
}

.plyr__control--overlaid {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  padding: 1.5rem;
}

.plyr__control--overlaid:hover {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  transform: scale(1.1);
}

.plyr__control {
  color: var(--ink);
}

.plyr--audio .plyr__control:hover,
.plyr--audio .plyr__control[aria-expanded="true"] {
  background: var(--accent);
  color: white;
}

.plyr__menu__container {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.plyr__menu__container .plyr__control {
  color: var(--ink);
}

.plyr__menu__container .plyr__control:hover,
.plyr__menu__container .plyr__control[role="menuitemradio"][aria-checked="true"] {
  background: var(--accent);
  color: white;
}

@media (max-width: 768px) {
  .audio-custom-controls {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .btn-skip {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }
}

/* Mini Player */
.mini-player {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.98), rgba(31, 41, 55, 0.98));
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  z-index: 999;
  animation: slideInUp 0.3s ease;
}

.mini-icon-hidden {
  display: none;
}

.mini-player-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  gap: 1.5rem;
}

.mini-player-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.mini-player-info:hover {
  opacity: 0.8;
}

.mini-player-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mini-player-details {
  flex: 1;
  min-width: 0;
}

.mini-player-title {
  font-weight: 600;
  color: white;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.mini-player-time {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Courier New', monospace;
}

.mini-player-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mini-control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
  overflow: visible;
  font-weight: normal;
  font-size: inherit;
}

.mini-control-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1);
}

.mini-play-btn {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
}

.mini-play-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.mini-player-progress {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
}

.mini-player-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
  width: 0%;
}

@media (max-width: 768px) {
  .mini-player-content {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }
  
  .mini-player-thumb {
    width: 50px;
    height: 50px;
  }
  
  .mini-player-title {
    font-size: 0.85rem;
  }
  
  .mini-player-time {
    font-size: 0.75rem;
  }
  
  .mini-control-btn {
    width: 36px;
    height: 36px;
  }
  
  .mini-play-btn {
    width: 44px;
    height: 44px;
  }
  
  .mini-player-controls {
    gap: 0.25rem;
  }
}

/* PDF Viewer */
.pdf-viewer-container {
  position: relative;
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.pdf-viewer-container:fullscreen {
  background: #1a1a1a;
}

.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(31, 41, 55, 0.95));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  gap: 1rem;
  flex-wrap: wrap;
}

.pdf-toolbar-left,
.pdf-toolbar-center,
.pdf-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pdf-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.pdf-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.25);
  border-color: var(--accent);
  color: white;
  transform: translateY(-2px);
}

.pdf-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pdf-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.pdf-btn-download {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: var(--accent);
  color: white;
}

.pdf-btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.pdf-page-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.75rem;
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: 'Courier New', monospace;
}

.pdf-zoom-level {
  padding: 0 0.5rem;
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 60px;
  text-align: center;
}

.pdf-viewer-canvas-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem;
  background: linear-gradient(135deg, #1e1e1e, #2d2d2d);
  min-height: 600px;
  overflow: auto;
  max-height: 80vh;
}

.pdf-viewer-container:fullscreen .pdf-viewer-canvas-container {
  max-height: calc(100vh - 80px);
  padding: 1rem;
}

#pdf-canvas {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-sm);
  background: white;
  max-width: 100%;
  height: auto;
}

.pdf-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 2rem;
  color: var(--muted);
}

.pdf-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Image Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lightbox-image-main {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  transition: transform 0.3s ease;
  cursor: grab;
}

.lightbox-image-main:active {
  cursor: grabbing;
}

.lightbox-caption {
  color: white;
  font-size: 1rem;
  text-align: center;
  padding: 0.75rem 1.5rem;
  background: rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-md);
  max-width: 600px;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10001;
}

.lightbox-close:hover {
  background: rgba(239, 68, 68, 0.9);
  border-color: #ef4444;
  transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10001;
}

.lightbox-prev {
  left: 2rem;
}

.lightbox-next {
  right: 2rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
}

.lightbox-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1);
}

.lightbox-zoom-level {
  color: white;
  font-size: 0.95rem;
  font-weight: 500;
  min-width: 60px;
  text-align: center;
  font-family: 'Courier New', monospace;
}

@media (max-width: 768px) {
  .lightbox-prev,
  .lightbox-next {
    width: 50px;
    height: 50px;
  }
  
  .lightbox-prev {
    left: 1rem;
  }
  
  .lightbox-next {
    right: 1rem;
  }
  
  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
  }
  
  .lightbox-controls {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  
  .lightbox-btn {
    width: 36px;
    height: 36px;
  }
  
  .lightbox-caption {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }
}

@media (max-width: 768px) {
  .pdf-toolbar {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  
  .pdf-toolbar-left,
  .pdf-toolbar-center,
  .pdf-toolbar-right {
    gap: 0.25rem;
  }
  
  .pdf-btn {
    width: 36px;
    height: 36px;
  }
  
  .pdf-page-info {
    font-size: 0.85rem;
    padding: 0 0.5rem;
  }
  
  .pdf-zoom-level {
    font-size: 0.8rem;
    min-width: 50px;
  }
  
  .pdf-viewer-canvas-container {
    padding: 1rem;
    min-height: 400px;
  }
}

@media (max-width: 640px) {
  .pdf-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .pdf-toolbar-left,
  .pdf-toolbar-center,
  .pdf-toolbar-right {
    justify-content: center;
  }
}

/* Transcript Section */
.transcript-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.transcript-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.transcript-header h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--ink);
}

.transcript-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.transcript-search-input {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.9rem;
  min-width: 200px;
  transition: all 0.2s ease;
}

.transcript-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-toggle-transcript {
  padding: 0.6rem 1.2rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-toggle-transcript:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}

.transcript-content {
  margin-top: 1rem;
}

.transcript-segments {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 500px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.transcript-segment {
  display: flex;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.transcript-segment:hover {
  background: rgba(59, 130, 246, 0.05);
}

.transcript-segment.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(139, 92, 246, 0.1));
  border-right: 3px solid var(--accent);
  padding-right: calc(0.75rem - 3px);
}

.transcript-segment.highlight {
  background: rgba(250, 204, 21, 0.15);
  border-right: 3px solid #facc15;
  padding-right: calc(0.75rem - 3px);
}

.transcript-timestamp {
  flex-shrink: 0;
  padding: 0.4rem 0.8rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.transcript-timestamp:hover {
  background: var(--accent);
  color: white;
  transform: scale(1.05);
}

.transcript-text {
  flex: 1;
  margin: 0;
  line-height: 1.6;
  color: var(--ink);
  font-size: 0.95rem;
}

.no-search-results {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 2px dashed var(--border);
  margin-top: 1rem;
}

/* Admin Transcript Section */
.transcript-section.admin-transcript {
  background: var(--bg);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-top: 1.5rem;
}

#transcript-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.transcript-item {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 0.75rem;
  align-items: start;
}

.transcript-time {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.95rem;
  width: 150px;
}

.transcript-text {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
}

.transcript-time:focus,
.transcript-text:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-remove-transcript {
  padding: 0.6rem 1rem;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-remove-transcript:hover {
  background: #dc2626;
  transform: scale(1.05);
}

.btn-add-transcript {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-add-transcript:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .transcript-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .transcript-controls {
    flex-direction: column;
  }
  
  .transcript-search-input {
    width: 100%;
    min-width: 0;
  }
  
  .transcript-item {
    grid-template-columns: 1fr;
  }
  
  .transcript-time {
    width: 100%;
  }
  
  .transcript-segment {
    flex-direction: column;
    gap: 0.5rem;
  }
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin-top: 2rem;
  margin-bottom: 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.article-body blockquote {
  margin: 0;
  padding: 1.3rem 1.5rem;
  border-right: 4px solid var(--accent);
  background:
    linear-gradient(135deg, rgba(0, 217, 255, 0.1), rgba(124, 58, 237, 0.05));
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.search-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.custom-html iframe {
  width: 100%;
  border: 0;
  border-radius: var(--radius-md);
  aspect-ratio: 16 / 9;
}

small {
  color: var(--muted);
  font-size: 0.9rem;
}

h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 6px;
  border: 2px solid rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--accent-3), var(--accent));
  box-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

/* Selection styling for code blocks and special elements */
code, pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.9em;
}

@media (max-width: 1400px) {
  .columns.layout-3 {
    grid-template-columns: 240px minmax(0, 1fr) 240px;
    gap: 2rem;
  }

  .columns.layout-2 {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 2rem;
  }
}

@media (max-width: 1100px) {
  .columns.layout-3 {
    grid-template-columns: 200px minmax(0, 1fr) 200px;
    gap: 1.5rem;
  }

  .columns.layout-2 {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .columns.layout-3,
  .columns.layout-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .columns.layout-3 .main-column,
  .columns.layout-2 .main-column {
    order: -1;
    grid-column: 1;
  }

  .columns.layout-3 .sidebar-nav,
  .columns.layout-3 .sidebar:not(.sidebar-nav),
  .columns.layout-2 .sidebar {
    grid-column: 1;
  }

  .column.sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  header {
    padding: 2.5rem 6vw 1.5rem;
  }

  .nav a {
    width: 100%;
    justify-content: center;
  }

  .banner {
    padding: 2rem 6vw;
  }

  main {
    padding: 2rem 6vw 3rem;
  }
}

/* Homepage and listing components */
.home-flow {
  display: grid;
  gap: 2.5rem;
}

.ds-surface {
  background: linear-gradient(160deg, var(--surface-1), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.ds-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.ds-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

.ds-empty,
.empty-message {
  text-align: center;
  padding: 1.8rem;
  opacity: 0.72;
  font-style: italic;
  margin: 0;
}

.home-welcome {
  text-align: right;
  margin-bottom: 0;
}

.home-welcome .ds-title {
  margin-bottom: 0.85rem;
}

.home-welcome .ds-subtitle {
  max-width: 54ch;
}

.home-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.home-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.72rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(29, 115, 255, 0.25);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.93rem;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 20px rgba(20, 32, 51, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.home-link-pill:hover {
  transform: translateY(-2px);
  border-color: var(--accent-2);
  box-shadow: 0 12px 24px rgba(20, 32, 51, 0.14);
}

.home-link-pill:focus-visible {
  outline-offset: 2px;
}

.ds-section,
.content-section {
  margin-bottom: 2.75rem;
  display: grid;
  gap: 1.25rem;
}

.ds-section-title,
.section-header {
  font-size: clamp(1.25rem, 2.3vw, 1.9rem);
  font-weight: 700;
  margin: 0;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--border);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ds-section-grid,
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.ds-card,
.section-block {
  background: linear-gradient(165deg, #ffffff 0%, #f9fbff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 2vw, 2rem);
  box-shadow: 0 6px 26px rgba(20, 32, 51, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ds-card:hover,
.section-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 38px rgba(20, 32, 51, 0.12);
  border-color: rgba(29, 115, 255, 0.42);
}

.ds-card-title,
.block-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1.1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}

.custom-blocks-section {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 2px dashed var(--border);
}

.custom-blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 1.5rem;
}

.custom-block-wrapper .panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--ink);
}

.empty-state p {
  opacity: 0.75;
}

.media-toolbar {
  display: grid;
  gap: 1rem;
}

.media-toolbar-head {
  display: grid;
  gap: 0.35rem;
}

.media-kicker {
  margin: 0;
  color: var(--text-secondary);
}

/* ---- Subcategory navigation ---- */
.subcategory-nav {
  margin-bottom: 0.5rem;
}

.subcategory-nav-label {
  font-size: 0.9em;
  color: var(--text-secondary);
}

.subcategory-nav-list {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.subcategory-nav-list li a {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  text-decoration: none;
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}

.subcategory-nav-list li a:hover {
  filter: saturate(1.15) brightness(1.05);
  box-shadow: 0 4px 12px rgba(20, 32, 51, 0.2);
}

/* Category Card Grid (for browsing series/topics) */
.category-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.category-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.category-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-2);
}

.category-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.category-card:hover .category-card-thumb img {
  transform: scale(1.05);
}

.category-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--bg-2);
}

.category-card-info {
  padding: 0.75rem 1rem;
  text-align: right;
}

.category-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-card-count {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
  display: block;
}

.media-filter-form {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(29, 115, 255, 0.28);
  background: rgba(29, 115, 255, 0.04);
}

.media-filter-label {
  min-width: 180px;
  font-size: 0.9rem;
}

.media-filter-form button {
  min-width: 120px;
}

.media-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.media-card {
  display: grid;
  gap: 0;
  align-content: start;
  height: 100%;
  overflow: hidden;
}

.media-card-thumbnail {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  overflow: hidden;
  background: var(--bg-2, #1a1a2e);
}

.media-card-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.media-card:hover .media-card-thumbnail img {
  transform: scale(1.05);
}

.media-card-body {
  display: grid;
  gap: 0.72rem;
  padding: 0.9rem;
  align-content: start;
}

.media-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.35;
}

.media-card-meta {
  margin: 0;
  color: var(--text-secondary);
}

.media-card-summary {
  margin: 0;
  color: var(--ink);
  opacity: 0.86;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-card-link-wrap {
  margin: auto 0 0 0;
}

.media-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  font-weight: 600;
}

.media-card-link:hover {
  color: var(--accent-2);
}

@media (max-width: 900px) {
  .section-grid,
  .ds-section-grid {
    grid-template-columns: 1fr;
  }

  .media-filter-form {
    align-items: stretch;
  }
}

@media (max-width: 768px) {
  .home-quick-links {
    gap: 0.65rem;
  }

  .home-link-pill {
    width: 100%;
    justify-content: center;
  }

  .media-grid,
  .custom-blocks-grid {
    grid-template-columns: 1fr;
  }

  .media-filter-label {
    width: 100%;
  }
}

/* Notifications and Auth utility pages */
.notifications-page {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1rem;
}

.notifications-page .notifications-mark-all-form {
  display: inline;
}

.notifications-page .notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 0.8rem;
}

.notifications-page .notifications-list {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.notifications-page .notification-item {
  display: flex;
  align-items: start;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s ease;
}

.notifications-page .notification-item:last-child {
  border-bottom: none;
}

.notifications-page .notification-item:hover {
  background: var(--bg);
}

.notifications-page .notification-item.unread {
  background: rgba(29, 115, 255, 0.06);
}

.notifications-page .notification-unread-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 0.5rem;
}

.notifications-page .notification-content {
  flex: 1;
  min-width: 0;
}

.notifications-page .notification-content p {
  margin: 0 0 0.5rem;
}

.notifications-page .notification-time {
  color: var(--text-secondary);
  font-size: 0.875rem;
  white-space: nowrap;
}

.notification-prefs-page .form-section {
  margin-bottom: 2rem;
}

.notification-prefs-page .form-section h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.notification-prefs-page .form-group-checkbox {
  margin-bottom: 1.5rem;
}

.notification-prefs-page .checkbox-label,
.auth-login-page .checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
}

.notification-prefs-page .checkbox-label {
  font-weight: 500;
}

.auth-login-page .checkbox-label {
  font-weight: 400;
}

.notification-prefs-page .checkbox-label input[type="checkbox"],
.auth-login-page .checkbox-label input[type="checkbox"] {
  cursor: pointer;
}

.notification-prefs-page .checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.notification-prefs-page .checkbox-help {
  margin: 0.25rem 0 0 2rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.notification-prefs-page .prefs-back-link {
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .notifications-page .notifications-header {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Admin Dashboard Styles */
.admin-dashboard {
  max-width: 1400px;
  margin: 0 auto;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(59, 130, 246, 0.06));
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.dashboard-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
  color: var(--ink);
}

.user-info {
  margin: 0;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.user-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
}

.btn-icon {
  font-size: 1.1rem;
}

.logout-form {
  margin: 0;
}

.btn-secondary {
  background: rgba(100, 116, 139, 0.1);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(100, 116, 139, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-primary { border-top: 3px solid var(--accent); }
.stat-secondary { border-top: 3px solid var(--accent-2); }
.stat-accent { border-top: 3px solid var(--accent-3); }
.stat-success { border-top: 3px solid #10b981; }

.stat-icon {
  font-size: 3rem;
  line-height: 1;
  opacity: 0.9;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
  color: #0f3d8a;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem 1.5rem;
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.action-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.action-primary:hover { border-color: var(--accent); background: rgba(59, 130, 246, 0.03); }
.action-secondary:hover { border-color: var(--accent-2); background: rgba(139, 92, 246, 0.03); }
.action-accent:hover { border-color: var(--accent-3); background: rgba(236, 72, 153, 0.03); }
.action-success:hover { border-color: #10b981; background: rgba(16, 185, 129, 0.03); }

.action-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.action-text {
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
}

/* Activity List */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.activity-item:hover {
  background: rgba(59, 130, 246, 0.02);
  border-color: var(--accent);
  transform: translateX(5px);
}

.activity-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--ink);
}

.activity-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.activity-type {
  font-weight: 500;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-style: italic;
}

/* Quick Links */
.quick-links-section {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.03), rgba(139, 92, 246, 0.02));
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.quick-link:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.dashboard-grid {
  display: grid;
  gap: 3rem;
}

.dashboard-section {
  animation: rise 0.7s ease both;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1.5rem 0;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.dashboard-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.75rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.dashboard-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.dashboard-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 10px 40px rgba(59, 130, 246, 0.15);
}

.dashboard-card:hover::before {
  opacity: 1;
}

.card-icon {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.2));
}

.card-content h4 {
  margin: 0 0 0.35rem 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}

.card-content p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.4;
}

/* Collections Grid */
.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.collection-empty-panel {
  margin-top: 1.5rem;
}

.collection-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.collection-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  border-color: var(--accent);
}

.collection-card-image {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: var(--bg);
}

.collection-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.collection-card:hover .collection-card-image img {
  transform: scale(1.1);
}

.collection-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.4rem 0.9rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.collection-card-content {
  padding: 1.5rem;
  flex: 1;
}

.collection-card-content h3 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}

.collection-card-content p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Collection Header */
.collection-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.collection-header-image {
  flex-shrink: 0;
  width: 280px;
  height: 280px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.collection-header-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collection-header-content {
  flex: 1;
}

.collection-badge-large {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.collection-description {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
  margin: 1rem 0;
}

.collection-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 1rem;
}

/* Collection Items */
.collection-items {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.collection-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.collection-item:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.collection-item.completed {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.05));
  border-color: rgba(16, 185, 129, 0.3);
}

.collection-item-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
}

.collection-item.completed .collection-item-number {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #10b981;
  color: white;
}

.collection-item-content {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  text-decoration: none;
  color: inherit;
}

.collection-item-thumb {
  position: relative;
  width: 180px;
  height: 100px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
}

.collection-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collection-item-progress-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.5);
}

.collection-item-progress-bar {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
  appearance: none;
  background: transparent;
}

.collection-item-progress-bar::-webkit-progress-bar {
  background: transparent;
}

.collection-item-progress-bar::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}

.collection-item-progress-bar::-moz-progress-bar {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}

.collection-item-checkmark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background: rgba(16, 185, 129, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.collection-item-details {
  flex: 1;
}

.collection-item-details h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

.collection-item-details p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

.collection-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.collection-item-type {
  padding: 0.25rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 500;
}

@media (max-width: 1024px) {
  .collection-header {
    flex-direction: column;
  }
  
  .collection-header-image {
    width: 100%;
    height: 300px;
  }
}

@media (max-width: 768px) {
  .collections-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .collection-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .collection-item-content {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  
  .collection-item-thumb {
    width: 100%;
    height: 180px;
  }
}

/* Featured Hero Section */
.featured-hero {
  margin: -2rem -2rem 2rem;
  padding: 0;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0;
  background: var(--bg-2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.featured-hero-main {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.featured-hero-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

.featured-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.9) 100%);
  z-index: 1;
}

.featured-hero-content {
  position: relative;
  z-index: 2;
  padding: 3rem;
  color: white;
}

.featured-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
}

.featured-hero-content h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: 1.2;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.featured-hero-content p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 0 0 2rem;
  max-width: 600px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.featured-hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-hero-primary,
.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.btn-hero-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.6);
}

.btn-hero-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.featured-hero-thumbnails {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg);
}

.featured-thumb-card {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  text-decoration: none;
  color: white;
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--border);
}

.featured-thumb-card:last-child {
  border-bottom: none;
}

.featured-thumb-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.featured-thumb-card:hover img {
  transform: scale(1.1);
}

.featured-thumb-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.8) 100%);
  z-index: 1;
  transition: opacity 0.3s ease;
}

.featured-thumb-card:hover::before {
  background: linear-gradient(180deg, rgba(59,130,246,0.3) 0%, rgba(0,0,0,0.9) 100%);
}

.featured-thumb-content {
  position: relative;
  z-index: 2;
  padding: 1.5rem;
}

.featured-thumb-type {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  backdrop-filter: blur(5px);
}

.featured-thumb-content h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

@media (max-width: 1024px) {
  .featured-hero {
    grid-template-columns: 1fr;
  }
  
  .featured-hero-main {
    min-height: 400px;
  }
  
  .featured-hero-content h2 {
    font-size: 2rem;
  }
  
  .featured-hero-thumbnails {
    flex-direction: row;
  }
  
  .featured-thumb-card {
    min-height: 200px;
    border-bottom: none;
    border-right: 1px solid var(--border);
  }
  
  .featured-thumb-card:last-child {
    border-right: none;
  }
}

@media (max-width: 768px) {
  .featured-hero {
    margin: -1rem -1rem 1.5rem;
  }
  
  .featured-hero-content {
    padding: 2rem 1.5rem;
  }
  
  .featured-hero-content h2 {
    font-size: 1.5rem;
  }
  
  .featured-hero-content p {
    font-size: 0.95rem;
  }
  
  .btn-hero-primary,
  .btn-hero-secondary {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .featured-hero-thumbnails {
    flex-direction: column;
  }
  
  .featured-thumb-card {
    min-height: 150px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

/* ============================================
   Infinite Scroll
   ============================================ */
.infinite-scroll-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.btn-load-more {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    border: 1px solid rgba(29, 115, 255, 0.25);
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-load-more:hover {
    transform: translateY(-2px);
    filter: saturate(1.1);
    box-shadow: 0 10px 25px rgba(20, 32, 51, 0.24);
}

.scroll-loading,
.scroll-end {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.scroll-end span {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    color: #6c757d;
}

#scroll-sentinel {
    height: 1px;
    visibility: hidden;
}

/* ============================================
   Comments Section
   ============================================ */
.comments-section {
    margin-top: 2rem;
}

.comments-section h3 {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    border: 1px solid;
}

.alert-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.comment-form-container {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-2);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.comment-form-container h4 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.comment-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-form .form-group {
    display: flex;
    flex-direction: column;
}

.comment-form label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.comment-form input,
.comment-form textarea {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.comment-form textarea {
    resize: vertical;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.comment-form small {
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.no-comments {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    background: var(--bg-2);
    border-radius: 8px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment {
    padding: 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: box-shadow 0.2s;
}

.comment:target {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
    animation: highlight 0.6s ease;
}

@keyframes highlight {
    0%, 100% { background: var(--bg); }
    50% { background: #e7f3ff; }
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
}

.comment-meta {
    display: flex;
    flex-direction: column;
}

.comment-author {
    font-weight: 600;
    color: var(--text);
}

.comment-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.comment-body {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    color: var(--text);
}

.comment-body p {
    margin: 0 0 0.5rem 0;
}

.comment-body code {
    background: var(--bg-2);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.comment-body pre {
    background: var(--bg-2);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
}

.comment-actions {
    display: flex;
    gap: 1rem;
}

.btn-reply {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.btn-reply:hover {
    text-decoration: none;
}

.reply-form-container {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-2);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.reply-form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.comment-replies {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (max-width: 768px) {
    .comment-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .comment {
        margin-left: 0 !important;
    }
}

/* ============================================
   Favorites
   ============================================ */
.btn-favorite {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.btn-favorite:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
}

.btn-favorite.active {
    border-color: #e74c3c;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.btn-favorite svg {
    transition: transform 0.2s ease;
}

.btn-favorite:hover svg {
    transform: scale(1.1);
}

.btn-favorite:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.media-detail-overview {
    display: grid;
    gap: 1rem;
}

.media-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.media-detail-header h2 {
    margin: 0;
}

.media-detail-title {
    font-size: clamp(1.35rem, 2.5vw, 2.1rem);
}

.media-detail-kicker {
    margin: 0.35rem 0 0;
    color: var(--text-secondary);
}

.media-detail-summary {
    margin: 0;
    color: var(--ink);
    opacity: 0.86;
}

.media-detail-tags {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.media-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(29, 115, 255, 0.25);
    background: rgba(29, 115, 255, 0.05);
    color: var(--ink);
    font-weight: 500;
    font-size: 0.86rem;
}

.media-tag:hover {
    border-color: var(--accent);
    color: var(--accent-2);
}

.media-detail-content {
    margin-top: 1.5rem;
    min-width: 0;
    overflow: hidden;
}

.media-detail-external-link {
    margin-top: 1rem;
}

.media-detail-clickable-image {
    cursor: zoom-in;
}

.media-detail-backlink {
    margin: 0 0 0.5rem;
}

.media-detail-backlink a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.media-detail-backlink a:hover {
    color: var(--accent);
}

.pdf-load-error {
    color: #ef4444;
}

.comment-depth-0 {
    margin-left: 0;
}

.comment-depth-1 {
    margin-left: 2rem;
}

.comment-depth-2 {
    margin-left: 4rem;
}

.comment-depth-3 {
    margin-left: 6rem;
}

.favorite-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 8px;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateY(1rem);
    transition: all 0.3s ease;
    z-index: 10000;
}

.favorite-notification.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .media-detail-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-favorite {
        justify-content: center;
    }
    
    .favorite-notification {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}

/* ============================================
   Adjacent (Prev/Next) Navigation
   ============================================ */
.media-adjacent {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.media-adjacent-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-1);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.media-adjacent-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(29, 115, 255, 0.1);
  color: var(--ink);
}

.media-adjacent-spacer {
  visibility: hidden;
}

.media-adjacent-thumb {
  width: 72px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}

.media-adjacent-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--muted);
}

.media-adjacent-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.media-adjacent-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.media-adjacent-title {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-adjacent-next .media-adjacent-text {
  text-align: left;
}

@media (max-width: 600px) {
  .media-adjacent {
    grid-template-columns: 1fr;
  }
  .media-adjacent-spacer {
    display: none;
  }
}

/* ============================================
   Favorites Page
   ============================================ */
.favorites-page .empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.favorites-page .empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.favorites-page .empty-state h3 {
    margin-bottom: 0.5rem;
}

.favorites-page .empty-state p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.favorites-page .media-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.favorites-page .favorite-card-removing {
    opacity: 0;
    transform: scale(0.9);
}

.favorites-page .media-card-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    overflow: hidden;
    background: var(--bg-2);
}

.favorites-page .media-card-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.favorites-page .media-card-overlay {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
}

.favorites-page .media-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}

.favorites-page .media-card-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.favorites-page .media-card-content h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.favorites-page .media-card-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.favorites-page .media-card-content p {
    flex: 1;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.favorites-page .media-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.favorites-page .favorites-pagination-panel {
    margin-top: 2rem;
}

/* ============================================
   Playlists Index
   ============================================ */
.playlists-page .playlists-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 1rem;
}

.playlists-page .playlists-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.playlists-page .playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.playlists-page .playlist-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s ease;
}

.playlists-page .playlist-card:hover {
    transform: translateY(-2px);
}

.playlists-page .playlist-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.playlists-page .playlist-card h3 {
    margin: 0;
    font-size: 1.25rem;
}

.playlists-page .playlist-card h3 a {
    text-decoration: none;
    color: var(--text);
}

.playlists-page .playlist-card h3 a:hover {
    color: var(--accent);
}

.playlists-page .playlist-visibility,
.playlist-detail-page .playlist-meta-info [class^="badge-"] {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.playlists-page .badge-public,
.playlist-detail-page .badge-public {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.playlists-page .badge-private,
.playlist-detail-page .badge-private {
    background: rgba(100, 116, 139, 0.14);
    color: #475569;
}

.playlists-page .badge-unlisted,
.playlist-detail-page .badge-unlisted {
    background: rgba(249, 115, 22, 0.12);
    color: #c2410c;
}

.playlists-page .playlist-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.playlists-page .playlist-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.playlists-page .playlist-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ============================================
   Playlist Detail
   ============================================ */
.playlist-detail-page .playlist-detail-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1rem;
}

.playlist-detail-page .playlist-header-section {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    margin-bottom: 2rem;
}

.playlist-detail-page .playlist-description-text {
    color: var(--text-secondary);
    margin: 1rem 0;
}

.playlist-detail-page .playlist-meta-info {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.playlist-detail-page .playlist-items-list {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.playlist-detail-page .playlist-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.playlist-detail-page .playlist-item:last-child {
    border-bottom: none;
}

.playlist-detail-page .playlist-item:hover {
    background: var(--bg);
}

.playlist-detail-page .playlist-item-index {
    flex-shrink: 0;
    width: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
}

.playlist-detail-page .playlist-item-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.playlist-detail-page .playlist-item-info {
    flex: 1;
    min-width: 0;
}

.playlist-detail-page .playlist-item-info h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.playlist-detail-page .playlist-item-info a {
    text-decoration: none;
    color: var(--text);
}

.playlist-detail-page .playlist-item-info a:hover {
    color: var(--accent);
}

.playlist-detail-page .playlist-item-meta {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.playlist-detail-page .playlist-item-meta [class^="badge-"] {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
}

.playlist-detail-page .badge-video {
    background: rgba(29, 115, 255, 0.12);
    color: #1d73ff;
}

.playlist-detail-page .badge-audio {
    background: rgba(14, 165, 164, 0.14);
    color: #0f766e;
}

.playlist-detail-page .badge-document,
.playlist-detail-page .badge-article {
    background: rgba(249, 115, 22, 0.14);
    color: #c2410c;
}

.playlist-detail-page .badge-image {
    background: rgba(217, 70, 239, 0.12);
    color: #a21caf;
}

.playlist-detail-page .btn-icon {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;
}

.playlist-detail-page .btn-icon:hover {
    background: var(--bg);
    color: var(--text);
}

.playlist-detail-page .btn-icon.btn-danger:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================
   Playlist Create
   ============================================ */
.playlist-create-page .playlist-create-cancel {
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .playlists-page .playlists-header {
        flex-direction: column;
        align-items: stretch;
    }

    .playlist-detail-page .playlist-header-section {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================
   Ratings & Reviews
   ============================================ */
.ratings-section {
    margin-top: 2rem;
}

.rating-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.rating-summary {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.rating-average {
    text-align: center;
}

.rating-value {
    font-size: 3rem;
    font-weight: bold;
    color: var(--accent);
}

.stars-display {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 0.5rem 0;
}

.stars-display .star {
    font-size: 1.5rem;
    color: #ddd;
}

.stars-display .star.filled {
    color: #ffd700;
}

.rating-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.rating-distribution {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.distribution-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.distribution-label {
    min-width: 40px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.distribution-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-2);
    border-radius: 4px;
    overflow: hidden;
}

.distribution-fill {
    width: 0;
    height: 100%;
    background: #ffd700;
    transition: width 0.3s ease;
}

.distribution-count {
    min-width: 30px;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.rating-form-container {
    padding: 1.5rem;
    background: var(--bg-2);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.rating-form-container h4 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.user-rating-notice {
    padding: 0.75rem;
    background: #e7f3ff;
    border-right: 3px solid var(--accent);
    border-radius: 4px;
    margin-bottom: 1rem;
    color: #004085;
}

.star-rating-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 1rem;
}

.star-rating-input input {
    display: none;
}

.star-rating-input label {
    font-size: 2.5rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s ease;
}

.star-rating-input label:hover,
.star-rating-input label:hover ~ label,
.star-rating-input input:checked ~ label {
    color: #ffd700;
}

.reviews-list {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
}

.reviews-list h4 {
    margin-bottom: 1.5rem;
}

.review-item {
    padding: 1.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.review-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.review-meta {
    display: flex;
    flex-direction: column;
}

.review-stars {
    display: flex;
    gap: 2px;
}

.review-stars .star {
    font-size: 1rem;
    color: #ddd;
}

.review-stars .star.filled {
    color: #ffd700;
}

.review-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.review-body {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--text);
}

.review-actions {
    display: flex;
    gap: 1rem;
}

.btn-helpful {
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-helpful:hover {
    background: var(--bg-2);
    border-color: var(--accent);
}

.btn-helpful.voted {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    cursor: default;
}

@media (max-width: 768px) {
    .rating-overview {
        grid-template-columns: 1fr;
    }
    
    .rating-value {
        font-size: 2.5rem;
    }
    
    .star-rating-input label {
        font-size: 2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =============================================================================
   AUTHENTICATION PAGES
   Styles for register, login, forgot-password, reset-password pages
   ============================================================================= */

/* Auth Container & Card (shared across register, login, forgot, reset pages) */
.auth-container {
    max-width: 450px;
    margin: 3rem auto;
    padding: 1rem;
}

.auth-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
}

.auth-card h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
}

.auth-subtitle {
    color: var(--text-secondary);
    margin: 0 0 2rem;
}

/* Auth Forms */
.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.auth-form small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Alert Messages (used in all auth forms) */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

/* Auth Footer & Links */
.btn-block {
    width: 100%;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: #0b57d0;
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    color: #0846ab;
    text-decoration: underline;
}

/* Auth Actions (reset-password-invalid page) */
.auth-actions {
    margin-top: 2rem;
}

/* =============================================================================
   PROFILE PAGE
   ============================================================================= */

.profile-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1rem;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 2rem;
}

.profile-avatar {
    flex-shrink: 0;
}

.profile-avatar img,
.avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), #6366f1);
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

.profile-info h1 {
    margin: 0 0 0.5rem;
}

.profile-email {
    color: var(--text-secondary);
    margin: 0 0 0.5rem;
}

.profile-content {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

/* Profile Tabs */
.profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.tab-btn {
    padding: 1rem 2rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text);
    background: var(--bg-2);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

/* Profile Forms */
.profile-form .form-group {
    margin-bottom: 1.5rem;
}

.profile-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.profile-form input,
.profile-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
}

.profile-form textarea {
    resize: vertical;
}

/* Profile Settings */
.profile-settings-section {
    margin-top: 2rem;
}

/* Profile Badges & Buttons */
.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
}

/* CAPTCHA widget container */
.captcha-container {
    margin: 1rem 0;
}

/* Panel header flex layout (webhook admin, etc.) */
.panel-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Inline form (used for action buttons in table rows) */
.inline-form {
    display: inline-block;
}

/* Stats row (webhook delivery stats, etc.) */
.stats-row {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 120px;
    padding: 1rem;
    background: var(--bg-color, #1a1a2e);
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* Response preview in delivery history */
.response-preview {
    max-height: 200px;
    overflow: auto;
    padding: 0.5rem;
    background: var(--bg-color, #0f0f23);
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Checkbox label for form fields */
.checkbox-label {
    display: block;
    padding: 0.25rem 0;
    cursor: pointer;
}

/* Form hint text */
.hint {
    opacity: 0.7;
    font-size: 0.875rem;
}

/* Form row with multiple columns */
.form-row {
    display: flex;
    gap: 1rem;
}

.form-row label {
    flex: 1;
}

/* Form info block (e.g., webhook secret display) */
.form-info {
    background: var(--bg-color, #1a1a2e);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Form actions (submit + cancel) */
.form-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Actions cell in admin tables */
.actions-cell {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

/* Content versioning diff view */
.diff-meta {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.diff-revision-info {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-color, #1a1a2e);
    border-radius: 8px;
    font-size: 0.9rem;
}

.diff-field {
    margin: 1.5rem 0;
}

.diff-field-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.diff-side-by-side {
    display: flex;
    gap: 1rem;
}

.diff-column {
    flex: 1;
    min-width: 0;
}

.diff-column-header {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 4px 4px 0 0;
}

.diff-old .diff-column-header {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.diff-new .diff-column-header {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.diff-content {
    padding: 0.75rem;
    background: var(--bg-color, #0f0f23);
    border-radius: 0 0 4px 4px;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.85rem;
    max-height: 400px;
    overflow: auto;
    margin: 0;
}

.diff-unchanged {
    opacity: 0.6;
    border-radius: 4px;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
}

.badge-secondary {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
}

/* Version diff form */
.version-diff-form .admin-table input[type="radio"] {
    cursor: pointer;
}

/* Site Footer */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(246, 248, 252, 0.9));
  backdrop-filter: blur(10px);
}

.site-footer-inner {
  display: grid;
  gap: 1rem;
  padding: 2rem 0 2.5rem;
}

.site-footer-brand strong {
  display: block;
  margin-bottom: 0.25rem;
}

.site-footer-brand p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 60ch;
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.site-footer-nav a {
  font-weight: 600;
  color: var(--ink);
}

.site-footer-nav a:hover {
  color: var(--accent);
}

.site-footer-meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

a.site-footer-visitors,
.site-footer-visitors {
  margin: 1rem 0;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  text-decoration: none;
  color: inherit;
}

a.site-footer-visitors:hover {
  opacity: 0.8;
}

.visitor-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.visitor-count {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}

.visitor-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.visitor-separator {
  color: var(--text-secondary);
  opacity: 0.4;
}

.visitor-icon {
  font-size: 0.9rem;
}

/* Branded Error Pages */
.error-page {
  max-width: 760px;
  margin: 2rem auto;
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.92));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.error-page-code {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 9vw, 5rem);
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.error-page h1 {
  margin: 0.75rem 0 1rem;
}

.error-page-message {
  margin: 0 auto;
  max-width: 55ch;
  color: var(--text-secondary);
}

.error-page-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Admin Shell Layout */
.admin-shell-body {
  background: linear-gradient(180deg, #f4f7fc 0%, #eef3fb 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-shell-header {
  padding: 0;
  overflow: visible;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.admin-shell-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.admin-shell-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--ink);
}

.admin-shell-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.admin-shell-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-shell-nav a {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.admin-shell-nav a:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent);
}

.admin-shell-account {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-shell-user {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.admin-shell-logout-form {
  margin: 0;
}

.admin-shell-logout-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-shell-logout-btn:hover {
  background: rgba(15, 23, 42, 0.06);
}

.admin-shell-main {
  flex: 1;
  padding: 1.75rem 0 2.5rem;
}

.admin-shell-content {
  width: min(1200px, 100% - 2rem);
}

.admin-shell-footer {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
}

.admin-shell-footer-inner {
  padding: 0.8rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .admin-shell-header-inner,
  .admin-shell-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-shell-content {
    width: min(1200px, 100% - 1rem);
  }
}

@media (max-width: 768px) {
  .site-footer-inner {
    padding: 1.5rem 0 2rem;
  }

  .error-page {
    padding: 1.75rem;
  }
}

/* =========================================
   Lazy-loading blur-up effect
   ========================================= */
img[data-src] {
    filter: blur(10px);
    transition: filter 0.3s ease-out;
}

img[data-src].loaded {
    filter: blur(0);
}

img[data-src].error {
    filter: none;
    opacity: 0.5;
}

img[data-src]:not([src]) {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 200px;
}

/* =========================================
   Visitor Countries Sidebar Block
   ========================================= */
.visitor-countries-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
}

.visitor-country-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

.visitor-country-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.visitor-country-item .country-flag {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.visitor-country-item .country-name {
  flex: 1;
  font-size: 0.88rem;
  color: var(--ink);
}

.visitor-country-item .country-visitors {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.visitor-countries-more {
  display: block;
  text-align: center;
  margin-top: 0.75rem;
  padding: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.visitor-countries-more:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* =========================================
   Footer Stats Grid
   ========================================= */
.site-footer-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.footer-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
  min-width: 90px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease, border-color 0.2s ease;
}

a.footer-stat-card:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: var(--accent);
}

.footer-stat-icon {
  font-size: 1.25rem;
}

.footer-stat-value {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.footer-stat-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .site-footer-stats {
    gap: 0.5rem;
  }
  .footer-stat-card {
    min-width: 75px;
    padding: 0.6rem 0.75rem;
  }
}
