:root {
  --bg-color: #08090d;
  --card-bg: rgba(18, 20, 29, 0.75);
  --card-border: rgba(255, 255, 255, 0.08);
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --glow-color: rgba(59, 130, 246, 0.25);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --code-bg: #0d0e15;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- ANIMATED GRID BACKGROUND --- */
.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image:
          linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
          linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -2;
  animation: moveGrid 20s linear infinite;
}

@keyframes moveGrid {
  0% { background-position: 0 0; }
  100% { background-position: 40px 40px; }
}

.bg-glow {
  position: fixed;
  top: -20%;
  left: 30%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.18) 0%, rgba(59, 130, 246, 0.12) 40%, transparent 70%);
  filter: blur(80px);
  z-index: -1;
  animation: pulseGlow 8s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
  0% { transform: scale(1) translate(0, 0); }
  100% { transform: scale(1.3) translate(-40px, 40px); }
}

/* --- NAVBAR --- */
nav {
  height: 70px;
  border-bottom: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  background: rgba(8, 9, 13, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.5px;
}

.logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo:hover .logo-img {
  transform: rotate(5deg) scale(1.05);
}

.logo-badge {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #fff;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s;
}

.nav-links a:hover {
  color: #fff;
  text-shadow: 0 0 10px var(--accent-blue);
}

/* --- LANGUAGE SWITCHER --- */
.lang-switcher {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 2px;
  margin-left: 10px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  color: var(--text-main);
}

.lang-btn.active {
  background: var(--accent-blue);
  color: #fff;
}

/* --- WIKI CONTAINER --- */
.wiki-container {
  display: flex;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 40px 20px;
  gap: 30px;
}

/* --- SIDEBAR --- */
aside {
  width: 280px;
  flex-shrink: 0;
}

.sidebar-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(10px);
  position: sticky;
  top: 90px;
  transition: border-color 0.3s ease;
}

.sidebar-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.search-box {
  position: relative;
  margin-bottom: 25px;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 12px 12px 12px 40px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: #fff;
  outline: none;
  transition: all 0.3s ease;
}

.search-box input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 12px var(--glow-color);
}

.menu-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin: 15px 0 10px 10px;
  font-weight: 700;
}

.menu-list {
  list-style: none;
}

.menu-item {
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.25s ease;
  margin-bottom: 4px;
}

.menu-item:hover, .menu-item.active {
  background: rgba(59, 130, 246, 0.1);
  color: #fff;
  border-left: 3px solid var(--accent-blue);
  transform: translateX(4px);
}

/* --- MAIN CONTENT --- */
main {
  flex: 1;
}

.doc-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 35px;
  backdrop-filter: blur(10px);
  margin-bottom: 25px;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.doc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.doc-title {
  font-size: 1.8rem;
  font-weight: 800;
}

.doc-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tag {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* --- DOWNLOAD DROPDOWN --- */
.download-dropdown {
  position: relative;
  display: inline-block;
}

.download-btn {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.download-btn .arrow-icon {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.download-dropdown.active .arrow-icon {
  transform: rotate(180deg);
}

.download-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(13, 14, 21, 0.95);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  border-radius: 10px;
  width: 160px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 50;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  animation: fadeIn 0.2s ease;
}

.download-dropdown.active .download-menu {
  display: flex;
}

.download-item {
  color: var(--text-main);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease, color 0.2s ease;
}

.download-item:hover {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

/* --- PHOTO GALLERY --- */
.doc-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.gallery-item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.4);
  aspect-ratio: 16 / 9;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.gallery-item img:hover {
  transform: scale(1.03);
  filter: brightness(1.1);
}

.doc-desc {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 25px;
}

/* --- ACCORDION / COMMANDS --- */
.command-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.command-box:hover {
  border-color: rgba(59, 130, 246, 0.4);
}

.command-header {
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

.command-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.command-header i {
  transition: transform 0.3s ease;
}

.cmd-name {
  font-family: 'Fira Code', monospace;
  color: #60a5fa;
}

.command-body {
  padding: 0 20px 15px 20px;
  display: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px dashed var(--card-border);
  margin-top: 10px;
  padding-top: 15px;
  animation: fadeIn 0.2s ease;
}

/* --- FOOTER & STUDIO CREDIT ANIMATION --- */
footer {
  text-align: center;
  padding: 20px;
  border-top: 1px solid var(--card-border);
  margin-top: auto;
}

.studio-credit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.025em;
  color: var(--text-muted);
  position: relative;
  isolation: isolate;
  transition: color 0.25s ease, transform 0.25s ease;
}

.studio-credit::before {
  content: "";
  position: absolute;
  inset: -8px -12px;
  z-index: -1;
  border-radius: 9999px;
  background: linear-gradient(
          110deg,
          oklch(0.6 0.22 258 / 0),
          oklch(0.74 0.17 340 / 0.12),
          oklch(0.72 0.18 240 / 0)
  );
  background-size: 220% 100%;
  opacity: 0.75;
  animation: studio-credit-sheen 5s linear infinite;
}

.studio-credit:hover {
  color: white;
  transform: translateY(-1px);
}

.studio-credit-heart {
  display: inline-flex;
  transform-origin: center;
  animation: studio-heartbeat 1.9s ease-in-out infinite;
}

.studio-credit-name {
  background: linear-gradient(
          110deg,
          oklch(0.82 0.12 235),
          oklch(0.78 0.18 340),
          oklch(0.82 0.12 235)
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: text-shimmer 4s linear infinite;
}

@media (min-width: 640px) {
  .studio-credit {
    font-size: 0.75rem;
  }
}

/* Keyframes required by the new studio-credit styles */
@keyframes studio-credit-sheen {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes studio-heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

@keyframes text-shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* --- LIGHTBOX MODAL --- */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(8, 9, 13, 0.9);
  backdrop-filter: blur(8px);
}

.lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  object-fit: contain;
  animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: var(--text-muted);
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  z-index: 10000;
}

.lightbox-close:hover,
.lightbox-close:focus {
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
}