.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
:root {
  --bg: #0f0d16;
  --bg-2: #151325;
  --card: #1a162a;
  --accent: #a78bff;
  --accent-2: #6f5bff;
  --text: #f4f2ff;
  --muted: #a9a3c7;
  --glow: 0 0 18px rgba(167, 139, 255, 0.28), 0 0 40px rgba(111, 91, 255, 0.25);
  --stroke: rgba(255, 255, 255, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(900px 500px at 20% -10%, rgba(167, 139, 255, 0.14), transparent 60%),
              radial-gradient(900px 500px at 90% 10%, rgba(111, 91, 255, 0.16), transparent 55%),
              linear-gradient(180deg, #0f0d16 0%, #121024 100%);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  
  /* Custom Cursor - Sci-Fi Arrow */
  cursor: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z' fill='%231a162a' stroke='%23a78bff' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 2 2, auto;
}

/* Hover State Cursor */
a, button, .clickable, input[type="submit"], input[type="button"], .card-link, .tab-button, .button, .sidebar-link, [style*="cursor: pointer"] {
  cursor: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 3L10.07 19.97L12.58 12.58L19.97 10.07L3 3Z' fill='%23a78bff' stroke='%23ffffff' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 2 2, pointer !important;
}

.bg-media {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.bg-media img,
.bg-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: var(--bg-media-opacity, 0.5);
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(900px 500px at 20% -10%, rgba(167, 139, 255, 0.35), transparent 60%),
              radial-gradient(900px 500px at 90% 10%, rgba(111, 91, 255, 0.35), transparent 55%),
              rgba(10, 9, 16, 0.7);
  z-index: 1;
  pointer-events: none;
}

.bubbles {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.has-bg-media .bubbles {
  display: none;
}

.has-bg-media {
  background: #0f0d16;
}

.bubble {
  position: absolute;
  bottom: -120px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(167, 139, 255, 0.25), rgba(111, 91, 255, 0.05) 70%);
  border-radius: 50%;
  filter: blur(2px);
  animation: floatUp 16s linear infinite;
  opacity: 0.6;
}

.bubble:nth-child(2) {
  left: 20%;
  width: 220px;
  height: 220px;
  animation-duration: 20s;
  animation-delay: -8s;
}

.bubble:nth-child(3) {
  left: 45%;
  width: 90px;
  height: 90px;
  animation-duration: 14s;
  animation-delay: -12s;
}

.bubble:nth-child(4) {
  left: 70%;
  width: 180px;
  height: 180px;
  animation-duration: 18s;
  animation-delay: -4s;
}

.bubble:nth-child(5) {
  left: 85%;
  width: 120px;
  height: 120px;
  animation-duration: 15s;
  animation-delay: -10s;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) translateX(0) scale(1);
  }
  50% {
    transform: translateY(-60vh) translateX(30px) scale(1.08);
  }
  100% {
    transform: translateY(-120vh) translateX(-20px) scale(1.12);
  }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 80px;
  position: relative;
  z-index: 2;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
}

.logo {
  font-weight: 700;
  letter-spacing: 1px;
  font-size: var(--logo-size, 20px);
  color: var(--text);
  text-decoration: none;
  text-transform: uppercase;
}

.logo-image {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.logo-image img {
  height: var(--logo-size, 28px);
  width: auto;
  display: block;
}

.sidebar-logo-link {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.5rem;
  display: flex;
  justify-content: center;
}

.sidebar-logo-image {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.sidebar-link-action {
  cursor: pointer;
  margin-bottom: 5px;
}

.is-hidden { display: none; }

.bubble-left-8 { left: 8%; }

.nav-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.container-narrow { max-width: 900px; }
.container-center { text-align: center; }

.sidebar-social-item:hover {
  background: rgba(167,139,255,0.15);
  color: #fff;
  transform: translateX(4px);
}

.sidebar-social-item i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.footer-links-wrap { margin-bottom: 24px; }
.footer-links-row {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  font-size: 1.1em;
}
.footer-links-grouped {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
  text-align: left;
  align-items: flex-start;
}
.footer-copy {
  opacity: 0.6;
  font-size: 0.9em;
}

/* Page template */
.page-hero {
  margin-top: 24px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  padding: 40px;
}
.page-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}
.page-hero-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.page-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.2));
}
.page-hero-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #111, #222);
}
.page-hero-content {
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}
.page-hero-title {
  font-size: 42px;
  font-weight: 800;
  margin: 0;
  line-height: 1.1;
}
.page-hero-subtitle {
  font-size: 18px;
  color: #ccc;
  margin-top: 10px;
  font-weight: 500;
}
.page-header {
  margin-top: 30px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 15px;
}
.page-header-title {
  font-size: 32px;
  margin: 0;
}
.page-body {
  margin-top: 30px;
  line-height: 1.8;
  color: #ddd;
  font-size: 16px;
}
.page-content img { max-width: 100%; height: auto; border-radius: 6px; margin: 10px 0; }
.page-content p { margin-bottom: 1em; }
.page-content h2 { margin-top: 1.5em; margin-bottom: 0.5em; font-size: 1.8em; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 5px; }
.page-content h3 { margin-top: 1.5em; margin-bottom: 0.5em; font-size: 1.4em; color: #eee; }
.page-content a { color: #4dabf7; text-decoration: none; }
.page-content a:hover { text-decoration: underline; }
.page-content ul, .page-content ol { margin-left: 20px; margin-bottom: 1em; }
.page-content blockquote { border-left: 4px solid #4dabf7; padding-left: 15px; margin-left: 0; color: #aaa; font-style: italic; }
.page-content pre { background: rgba(0,0,0,0.3); padding: 15px; border-radius: 6px; overflow-x: auto; }
.page-content video { max-width: 100%; border-radius: 6px; margin: 10px 0; }

.page-not-found { margin-top: 24px; }
.page-not-found-title { font-size: 28px; }
.page-not-found-text { margin-top: 12px; line-height: 1.7; color: #c9d7ee; }

/* Index page */
.game-detail-section { margin-top: 8px; }
.game-title { font-size: 34px; margin-bottom: 16px; }
.tabs-spaced { margin-top: 8px; }
.detail-text { line-height: 1.7; color: #c9d7ee; }
.update-link-row { margin-top: 8px; }
.update-link-icon { vertical-align: middle; }
.updates-empty { color: #aaa; }
.more-games-section { margin-top: 28px; }
.hero-carousel-spaced { margin-bottom: 40px; }

.lazy-media-black {
  width: 100%;
  height: 100%;
  background: #000;
}
.lazy-media-dark {
  width: 100%;
  height: 100%;
  background: #111;
}
.lazy-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}
.lazy-media-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  align-items: center;
  margin-top: 32px;
}

.hero-card {
  background: linear-gradient(135deg, rgba(167, 139, 255, 0.08), rgba(111, 91, 255, 0.08));
  border: 1px solid rgba(167, 139, 255, 0.2);
  padding: 28px;
  border-radius: 18px;
  box-shadow: var(--glow);
}

.hero-card h1 {
  font-size: 36px;
  line-height: 1.1;
  margin-bottom: 16px;
  word-break: break-word; /* Fix overflow for long titles */
}

.hero-card p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(142, 247, 196, 0.15);
  border: 1px solid rgba(142, 247, 196, 0.35);
  margin-bottom: 16px;
  color: var(--text);
}

.cta {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 12px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #05080f;
  text-decoration: none;
  font-weight: 700;
  box-shadow: var(--glow);
}

.section-title {
  margin: 52px 0 20px;
  font-size: 22px;
  letter-spacing: 0.5px;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 12px 30px rgba(8, 12, 24, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px);
  border-color: rgba(167, 139, 255, 0.25);
  box-shadow: 0 20px 45px rgba(9, 9, 22, 0.65), var(--glow);
}

.card-link {
  cursor: pointer;
}

.card h3 {
  font-size: 18px;
  margin: 12px 0 8px;
}

.card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
  flex-grow: 1; /* Pushes button to bottom */
}

.media {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #0b0e16;
  border: 1px solid var(--stroke);
  aspect-ratio: 16/9; /* Enforce consistent ratio */
}

.media img,
.media iframe {
  width: 100%;
  height: 100%; /* Uses aspect-ratio */
  display: block;
  object-fit: cover;
}

.detail {
  margin-top: 24px;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.detail.full-width {
  grid-template-columns: 1fr;
}

.detail .panel {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 24px;
}

.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  aspect-ratio: 16/9; /* Fix carousel jumping vertically */
}

.carousel-track {
  display: flex;
  transition: transform 0.35s ease;
  height: 100%;
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  background: #0b0e16;
}

.carousel-slide img,
.carousel-slide iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  display: flex;
  gap: 8px;
  justify-content: center;
  z-index: 10;
  pointer-events: none; /* Let clicks pass through container */
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  pointer-events: auto; /* Re-enable clicks on dots */
}

.carousel-dot:hover {
  background: rgba(255,255,255,0.6);
}

.carousel-dot.active {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  transform: scale(1.2);
}

/* Hero Carousel Styles */
.hero-carousel {
  aspect-ratio: 21/9; /* Wider for hero */
  margin-top: 20px;
  border: none;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.hero-slide {
  position: relative;
}

.hero-image-wrapper {
  width: 100%;
  height: 100%;
}

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

.hero-image-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #0b0e16 0%, transparent 80%);
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 2;
  align-items: flex-start;
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  text-shadow: 0 4px 20px rgba(0,0,0,0.8);
  margin: 0;
  background: linear-gradient(135deg, #fff 0%, #a78bff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 16px;
  color: #e0e0e0;
  max-width: 600px;
  line-height: 1.6;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

.button-primary {
  background: var(--accent);
  color: #fff;
  border: none;
}
.button-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px rgba(167, 139, 255, 0.4);
}

.button-outline {
  background: rgba(255,255,255,0.1);
  color: #fff;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
}
.button-outline:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}

.tabs {
  display: grid;
  gap: 10px;
}

.tab-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.tab-button {
  padding: 10px 14px;
  background: rgba(20, 18, 34, 0.6);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.tab-button.active {
  border-color: rgba(167, 139, 255, 0.5);
  box-shadow: var(--glow);
}

.tab-panel {
  display: none;
  padding: 12px 4px 4px;
}

.tab-panel.open {
  display: block;
}

.small-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Use minmax for responsive small grid */
  justify-content: center;
}

.thumb-card {
  padding: 8px;
  /* width: 220px; Removed fixed width */
}

.thumb-card .media {
    height: 140px;
    aspect-ratio: auto; /* Override strict ratio for thumbnails */
}

.thumb-card .media img,
.thumb-card .media iframe {
  height: 100%;
  object-fit: cover;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 12, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500; /* Higher z-index */
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  box-shadow: var(--glow);
}

.tag {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(142, 247, 196, 0.15);
  border: 1px solid rgba(142, 247, 196, 0.35);
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.footer {
  margin-top: 80px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(167, 139, 255, 0.25);
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.button:hover {
  border-color: rgba(167, 139, 255, 0.5);
  box-shadow: var(--glow);
}

/* Primary Button variant for forms */
.button.primary {
  background: var(--accent);
  color: #0b0e16;
  border-color: var(--accent);
  font-weight: 700;
}
.button.primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: 0 0 15px rgba(167, 139, 255, 0.4);
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(167, 139, 255, 0.35);
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  background: rgba(15, 18, 26, 0.7);
  transition: all 0.2s ease;
}

.admin-link:hover {
  border-color: rgba(167, 139, 255, 0.6);
  box-shadow: var(--glow);
}

/* Forms */
label { display: block; margin-bottom: 20px; font-weight: 500; font-size: 14px; color: var(--muted); }
label:focus-within { color: var(--accent); }

input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: 8px;
  margin-top: 8px;
  font-family: inherit;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(167, 139, 255, 0.1);
}

/* File Input Styling */
input[type="file"] {
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    width: 100%;
    margin-top: 8px;
    color: var(--text);
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    margin-right: 15px;
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(167, 139, 255, 0.15);
    border: 1px solid rgba(167, 139, 255, 0.3);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

input[type="file"]::file-selector-button:hover {
    background: rgba(167, 139, 255, 0.25);
}

select {
   appearance: none;
   background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9a3c7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
   background-repeat: no-repeat;
   background-position: right 1rem center;
   background-size: 1em;
   padding-right: 2.5rem;
}
option {
    background: #1a162a;
    color: var(--text);
}

.checkbox-label, .radio-label {
    display: inline-flex; 
    align-items: center; 
    gap: 10px; 
    cursor: pointer;
    margin-right: 15px;
    color: var(--text);
}
.checkbox-label input, .radio-label input { 
    width: 18px; 
    height: 18px; 
    margin: 0; 
    cursor: pointer;
    accent-color: var(--accent);
}

.alert {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  position: relative;
}
.alert.error { background: rgba(255, 68, 68, 0.15); border: 1px solid rgba(255, 68, 68, 0.4); color: #ffcccc; }
.alert.success { background: rgba(68, 255, 68, 0.15); border: 1px solid rgba(68, 255, 68, 0.4); color: #ccffcc; }

.form-stack { max-width: 600px; }

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

/* Media Selector Grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin-top: 10px;
    /* Limit height to ~2 rows (Approx. 130px per item row + gap) */
    max-height: 280px; 
    overflow-y: auto;
    padding: 12px;
    background: rgba(10, 10, 15, 0.3);
    border-radius: 12px;
    border: 1px solid var(--stroke);
    
    /* Scrollbar Styling */
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

/* Contact page */
.contact-section {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}
.contact-title {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.5em;
}
.contact-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 30px;
}
.contact-lead {
  text-align: center;
  margin-bottom: 30px;
  color: #aaa;
}
.contact-link { color: #a78bff; }
.contact-group { margin-bottom: 20px; }
.contact-group.contact-group-large { margin-bottom: 30px; }
.contact-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}
.contact-input,
.contact-textarea {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.2);
  color: #fff;
  font-family: inherit;
}
.contact-textarea { resize: vertical; }
.contact-help { color: #888; }
.contact-actions { text-align: right; }
.contact-submit {
  padding: 12px 30px;
  font-size: 1.1em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.contact-alert {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
}
.contact-alert-success {
  background: rgba(76, 175, 80, 0.15);
  border: 1px solid rgba(76, 175, 80, 0.5);
  color: #81c784;
}
.contact-alert-error {
  background: rgba(244, 67, 54, 0.15);
  border: 1px solid rgba(244, 67, 54, 0.5);
  color: #e57373;
}
.spinner {
  display: none;
  animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.media-grid::-webkit-scrollbar {
    width: 6px;
}
.media-grid::-webkit-scrollbar-track {
    background: transparent;
}
.media-grid::-webkit-scrollbar-thumb {
    background-color: var(--accent);
    border-radius: 20px;
}

.media-option {
    position: relative;
    cursor: pointer;
    display: block;
}

.media-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.media-card {
    border: 2px solid transparent;
    border-radius: 8px;
    background: var(--card);
    padding: 4px;
    transition: all 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.media-card img, .media-card video {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    background: #000;
}

.media-card .filename {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.media-option:hover .media-card {
    border-color: rgba(167, 139, 255, 0.4);
    background: rgba(167, 139, 255, 0.1);
}

.media-option input:checked + .media-card {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(167, 139, 255, 0.3);
    background: rgba(167, 139, 255, 0.15);
}

.media-option input:checked + .media-card .filename {
    color: white;
}

/* Sidebar Layout */
@media (min-width: 900px) {
    .with-sidebar {
        margin-left: 80px; 
        transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 80px;
        background: #14111f; /* Distinct from body bg */
        border-right: 1px solid rgba(255, 255, 255, 0.08); /* Subtle border */
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5); /* Prominent shadow */
        display: flex;
        flex-direction: column;
        align-items: stretch; /* Stretch items to fill width */
        padding: 24px 0;
        z-index: 100;
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, box-shadow 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* Expand on hover */
    .sidebar:hover {
        width: 260px;
        background: #181524;
        box-shadow: 8px 0 50px rgba(0, 0, 0, 0.7);
    }
    
    .sidebar-logo {
        margin-bottom: 30px;
        display: flex;
        justify-content: center; /* keep logo centered */
        flex-shrink: 0;
    }
    
    .sidebar-menu {
        flex: 1;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 0 12px;
    }
    
    .sidebar-link {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 12px;
        color: var(--muted);
        text-decoration: none;
        border-radius: 12px;
        transition: all 0.2s;
        white-space: nowrap;
        overflow: hidden;
    }
    
    .sidebar-link:hover {
        background: rgba(167, 139, 255, 0.1);
        color: var(--text);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    
    .sidebar-link i, .sidebar-link img.icon {
        width: 24px;
        height: 24px;
        font-size: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        /* Ensure icon stays roughly in the center of the collapsed 80px */
        margin-left: 4px; 
    }
    
    .sidebar-link span {
        opacity: 0;
        transform: translateX(-10px);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .sidebar:hover .sidebar-link span {
        opacity: 1;
        transform: translateX(0);
        transition-delay: 0.1s;
    }
    
    .sidebar-socials {
        width: 100%;
        padding: 20px 12px;
        border-top: 1px solid rgba(255,255,255,0.08);
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: auto;
    }
}

@media (max-width: 899px) {
    .sidebar { display: none; } /* Hide on mobile for now, or move to bottom nav */
}

@media (min-width: 900px) {
    .with-sidebar .nav .logo, 
    .with-sidebar .nav .logo-image {
        display: none;
    }
    .with-sidebar .nav {
        justify-content: flex-end;
    }
}


.sidebar-link.active {
    background: rgba(167, 139, 255, 0.15);
    color: var(--text);
    border-right: 3px solid var(--accent);
}


/* Pro Login Styles */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: rgba(15, 13, 22, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    border-radius: 24px;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.login-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(167, 139, 255, 0.1) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}
.login-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: 20px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    color: #000;
}
.input-with-icon {
    position: relative;
    margin-bottom: 20px;
}
.input-with-icon i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    transition: color 0.3s;
}
.input-with-icon input {
    padding-left: 48px;
    transition: all 0.3s;
}
.input-with-icon input:focus {
    background: rgba(255,255,255,0.05);
    border-color: var(--accent);
}
.input-with-icon input:focus + i {
    color: var(--accent);
}

/* Sidebar Search */
.sidebar:focus-within {
    width: 260px;
    background: #181524;
    box-shadow: 8px 0 50px rgba(0, 0, 0, 0.7);
}
.sidebar-search {
    width: 100%;
    padding: 0 12px;
    margin-bottom: 10px;
    position: relative;
}
.search-wrapper {
    background: rgba(255,255,255,0.05); /* slightly lighter than sidebar */
    border-radius: 12px;
    display: flex;
    align-items: center;
    height: 44px;
    transition: background 0.2s, border-color 0.2s;
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box; /* Ensure border is accounted for */
    border: 1px solid rgba(255, 255, 255, 0.1); /* Visible border */
}
.search-wrapper:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255, 255, 255, 0.2);
}
.search-icon {
    min-width: 56px; /* Match collapsed sidebar width roughly */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}
.search-input {
    background: transparent;
    border: none;
    color: var(--text);
    width: 100%;
    height: 100%;
    padding-right: 12px;
    outline: none;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s;
}
.sidebar:hover .search-input,
.sidebar:focus-within .search-input {
    opacity: 1;
    transform: translateX(0);
}
.sidebar:hover .sidebar-link span,
.sidebar:focus-within .sidebar-link span {
    opacity: 1;
    transform: translateX(0);
    transition-delay: 0.1s;
}


/* Pro Sidebar Search Popover */
.search-results-popover {
    position: fixed;
    left: 260px; /* Positioned right of the expanded sidebar */
    top: 80px;   /* Aligned with search bar roughly */
    width: 300px;
    max-height: 400px;
    overflow-y: auto;
    background: rgba(20, 18, 30, 0.95);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
    z-index: 9999;
    padding: 12px;
    animation: fadeIn 0.15s ease-out;
}

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

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
    margin-bottom: 4px;
}

.search-result-item:hover {
    background: rgba(255,255,255,0.08);
}

.search-result-thumb {
    width: 48px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    background: #000;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-cat {
    font-size: 11px;
    color: var(--muted);
}


/* Nested Sidebar Menu (Flyout/Hover Style) */
.sidebar-item-has-children {
    display: flex;
    flex-direction: column;
    position: relative;
    /* overflow: visible; - Crucial for flyout to show outside */
}

.sidebar-parent-header {
    display: flex; 
    align-items: center;
    gap: 16px;
    padding: 12px;
    color: var(--muted);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    width: 100%;
}

.sidebar-parent-header:hover {
    background: rgba(167, 139, 255, 0.1);
    color: var(--text);
}

.sidebar-parent-header span {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sidebar:hover .sidebar-parent-header span,
.sidebar:focus-within .sidebar-parent-header span {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-parent-header i {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide toggle icon for flyout style (optional, or keep it as indicator) */
.sidebar-toggle-icon {
    display: none; 
}

/* Flyout Submenu logic */
.sidebar-submenu {
    display: none;
    position: absolute;
    left: 100%; /* Position to the right */
    top: 0;
    width: 220px; /* Fixed width for flyout */
    background: #181524; /* Match sidebar bg or slightly lighter */
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    border-radius: 12px;
    padding: 8px;
    flex-direction: column;
    gap: 4px;
    z-index: 1000;
    margin-left: 10px; /* Spacing from sidebar */
}

/* Invisible bridge to prevent menu from closing when moving mouse across the gap */
.sidebar-submenu::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -20px; /* Extends left to bridge the margin-left gap */
    width: 20px; 
    background: transparent;
    z-index: -1;
}

/* Show on hover of parent LI/container */
.sidebar-item-has-children:hover > .sidebar-submenu {
    display: flex;
}

/* Nested Submenus (Level 2+) */
.sidebar-submenu .sidebar-submenu {
    left: 100%;
    top: 0;
    margin-left: 5px;
    padding-left: 8px; 
    border-left: none;
}

/* Links inside flyout */
.sidebar-sublink {
    padding: 8px 12px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    border-radius: 8px;
    transition: color 0.2s;
    background: transparent;
    display: block;
    white-space: nowrap;
    opacity: 1; /* Always visible inside open flyout */
}

.sidebar-sublink:hover {
    color: var(--text);
    background: rgba(167, 139, 255, 0.15);
}

.sidebar-sublink::before {
    display: none; 
}

/* Ensure sidebar allows overflow for flyouts */
.sidebar {
    overflow: visible !important; 
}


/* ----------------
   Footer Links 
   ---------------- */
.footer-link {
  color: var(--text);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 6px 12px;
  border-radius: 8px;
  position: relative;
  z-index: 1;
}

.footer-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(167, 139, 255, 0.2), rgba(111, 91, 255, 0.1));
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.3s ease;
  z-index: -1;
}

.footer-link:hover {
  color: #fff;
  text-shadow: 0 0 12px rgba(167, 139, 255, 0.8);
  transform: translateY(-2px);
}

.footer-link:hover::before {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 0 20px rgba(167, 139, 255, 0.15);
}

/* Like Button */
.like-button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  transition: all 0.2s;
}
.like-button:hover {
  background: rgba(231, 76, 60, 0.1);
  border-color: #e74c3c;
  color: #e74c3c;
}
.like-button.liked .heart-icon {
  fill: #e74c3c;
  stroke: #e74c3c;
}
.like-button.liked {
  border-color: #e74c3c;
  color: #e74c3c;
}

/* Updates Timeline */
.updates-timeline {
  border-left: 2px solid rgba(255,255,255,0.1);
  padding-left: 20px;
  margin-left: 10px;
}
.update-item {
  position: relative;
  margin-bottom: 20px;
}
.update-item::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 6px;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
}
.update-date {
  font-size: 0.85em;
  color: var(--accent);
  margin-bottom: 4px;
  font-weight: 600;
}
.update-desc {
  color: #c9d7ee;
  line-height: 1.5;
}

/* Latest Badge */
.badge-latest {
  background: var(--accent);
  color: #1a162a;
  font-size: 0.75em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
  font-weight: 800;
  letter-spacing: 0.5px;
  vertical-align: text-bottom;
  box-shadow: 0 0 8px rgba(167, 139, 255, 0.4);
}

/* Scrollable Updates Timeline */
.updates-timeline {
  max-height: 1000px;
  overflow-y: auto;
  padding-right: 15px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(255, 255, 255, 0.1);
}

/* Custom Scrollbar for Webkit */
.updates-timeline::-webkit-scrollbar {
  width: 6px;
}
.updates-timeline::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}
.updates-timeline::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

/* Admin Updates List Scrollbar */
#updates-list::-webkit-scrollbar {
  width: 6px;
}
#updates-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}
#updates-list::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) rgba(255, 255, 255, 0.05);
}
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.page-selector {
  width: 150px;
  padding: 5px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--accent);
  color: var(--text);
  border-radius: 4px;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 0.9em;
}

.page-selector:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 5px rgba(167, 139, 255, 0.5);
}

.page-selector option {
  background: #151325;
  color: #f4f2ff;
  padding: 10px;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
}

/* Advanced Lightbox Styles */
.lightbox {
    display: none; /* hidden by default */
    position: fixed;
    z-index: 10000;
    top: 0; 
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    user-select: none;
}
.lightbox.open {
    display: flex;
    opacity: 1;
}
.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    transition: transform 0.1s ease-out;
    cursor: grab;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(167, 139, 255, 0.8);
    border-color: var(--accent);
}
.lightbox-close {
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
}
.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 30px;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.footer-column {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 120px;
  align-items: center;
}

.footer-column:not(.footer-group-dropup) {
  align-items: flex-start;
  padding-top: 4px;
}

.footer-group-title {
  color: #fff;
  margin: 0;
  padding: 2px 10px;
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 2px solid transparent;
}

.footer-group-title:hover {
  text-shadow: 0 0 10px rgba(167, 139, 255, 0.8);
  color: #a78bff;
}

.footer-group-dropup .footer-group-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(15, 15, 20, 0.95);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(167, 139, 255, 0.2);
  padding: 15px;
  border-radius: 8px;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  pointer-events: none;
}

.footer-group-dropup:hover .footer-group-content {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(-5px);
}

.footer-group-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: rgba(15, 15, 20, 0.95) transparent transparent transparent;
}

.footer-group-content::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 20px;
  background: transparent;
}

.footer-link-item {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95em;
  transition: all 0.2s;
  white-space: nowrap;
  display: block;
  text-align: center;
}

.footer-link-item.social-item {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-link-item:hover {
  color: #fff;
  text-shadow: 0 0 10px rgba(167, 139, 255, 0.8);
  transform: scale(1.05);
}

.error-card {
  margin-top: 80px;
}

.error-title {
  font-size: 48px;
  margin-bottom: 16px;
}

.error-subtitle {
  font-size: 24px;
  color: #fff;
}

.error-text {
  margin-top: 16px;
  line-height: 1.7;
  color: #c9d7ee;
}

.error-actions {
  margin-top: 32px;
}

