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

:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #111128;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-gold: #f59e0b;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 40px rgba(139, 92, 246, 0.2);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-height: 70px;
  --font-heading: 'Orbitron', sans-serif;
  --font-body: 'Inter', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('../images/background/bgrnd_1.png') center / cover no-repeat;
  opacity: 0.06;
  pointer-events: none;
  z-index: -1;
}

a {
  color: var(--accent-purple);
  text-decoration: none;
  transition: color 0.2s;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
  background: rgba(10, 10, 26, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.3s;
}

.navbar.scrolled {
  background: rgba(10, 10, 26, 0.95);
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-purple);
  border-radius: 1px;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  position: relative;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.hero-tagline {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 2.5rem;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* ===== Scroll Arrow ===== */
.scroll-arrow {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-secondary);
  opacity: 0.6;
  transition: opacity 0.3s;
}

.scroll-arrow:hover {
  opacity: 1;
  color: var(--text-primary);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
  color: #fff;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  color: #fff;
  box-shadow: 0 6px 30px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-card);
}

.btn-gold {
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  color: #000;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.btn-gold:hover {
  color: #000;
  box-shadow: 0 6px 30px rgba(245, 158, 11, 0.6);
}

/* ===== Sections ===== */
.section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  text-align: center;
  margin-bottom: 3rem;
  letter-spacing: 1px;
}

/* ===== Feature Cards ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 2rem;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  background: var(--bg-card-hover);
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  color: var(--accent-purple);
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.feature-card-image {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  object-fit: cover;
}

.feature-card-image-placeholder {
  width: 100%;
  height: 180px;
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.features-more {
  text-align: center;
  margin-top: 2.5rem;
}

/* ===== Server Info Panel ===== */
.server-info {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.info-item {
  text-align: center;
}

.info-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 1.5px;
  margin-bottom: 0.3rem;
}

.info-value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-gold);
}

/* ===== Download CTA ===== */
.download-section {
  text-align: center;
  padding: 4rem 2rem;
}

.download-section p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

/* ===== Community Section ===== */
.community-section {
  text-align: center;
}

.community-section p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1.5rem;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 2rem;
}

/* ===== Gallery ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

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

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  font-size: 0.9rem;
}

.gallery-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  background: var(--bg-card);
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 1rem;
  gap: 0.5rem;
}

.gallery-placeholder span {
  font-size: 0.85rem;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-sm);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.5rem;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  padding: 1rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  text-align: center;
  width: 100%;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ===== Registration Form ===== */
.register-container {
  max-width: 480px;
  margin: 0 auto;
  padding-top: calc(var(--nav-height) + 3rem);
}

.register-form {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 2.5rem;
}

.register-form h1 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.register-form .subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent-purple);
}

.form-group input.error {
  border-color: #ef4444;
}

.form-error {
  color: #ef4444;
  font-size: 0.8rem;
  margin-top: 0.3rem;
  display: none;
}

.form-error.visible {
  display: block;
}

.form-submit {
  width: 100%;
  margin-top: 0.5rem;
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.form-message {
  text-align: center;
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  display: none;
}

.form-message.success {
  display: block;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.form-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.password-strength {
  height: 3px;
  border-radius: 2px;
  margin-top: 0.4rem;
  background: var(--border-subtle);
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}

/* ===== Section Subtitle ===== */
.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-top: -2rem;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* ===== Rates Table ===== */
.rates-table-wrap {
  max-width: 440px;
  margin: 0 auto;
}

.rates-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
}

.rates-table th,
.rates-table td {
  padding: 0.75rem 1.25rem;
  text-align: center;
}

.rates-table thead th {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.rates-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
}

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

.rates-table tbody td:first-child {
  color: var(--text-secondary);
}

.rates-table tbody td:last-child {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--accent-gold);
}

/* ===== Info Cards ===== */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.info-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}

.info-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.info-card ul {
  list-style: none;
  padding: 0;
}

.info-card ul li {
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0.25rem 0;
}

.info-card-label {
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== Page Header (for sub-pages) ===== */
.page-header {
  padding-top: calc(var(--nav-height) + 3rem);
  padding-bottom: 2rem;
  text-align: center;
}

.page-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Guides ===== */
.guides-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  min-height: 400px;
}

.guides-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.guide-dropdown {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  display: none;
}

.guide-dropdown:focus {
  outline: none;
  border-color: var(--accent-purple);
}

.guide-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.guide-list a {
  display: block;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

.guide-list a:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.guide-list a.active {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-left: 2px solid var(--accent-purple);
}

.guides-content {
  min-width: 0;
}

.guide-viewer {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 2rem;
  min-height: 400px;
}

.guide-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--text-secondary);
  gap: 1rem;
  text-align: center;
}

.guide-loading,
.guide-error {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.guide-error {
  color: #ef4444;
}

/* Guide markdown content */
.guide-md h1 { font-family: var(--font-heading); font-size: 1.6rem; margin-bottom: 1rem; letter-spacing: 0.5px; }
.guide-md h2 { font-family: var(--font-heading); font-size: 1.3rem; margin: 1.5rem 0 0.75rem; letter-spacing: 0.5px; }
.guide-md h3 { font-family: var(--font-heading); font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }
.guide-md h4 { font-size: 1rem; font-weight: 600; margin: 1rem 0 0.5rem; }
.guide-md p { color: var(--text-secondary); margin-bottom: 0.75rem; line-height: 1.7; }
.guide-md ul { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.guide-md li { color: var(--text-secondary); margin-bottom: 0.3rem; }
.guide-md a { color: var(--accent-purple); }
.guide-md a:hover { color: var(--accent-blue); }
.guide-md hr { border: none; border-top: 1px solid var(--border-subtle); margin: 1.5rem 0; }
.guide-md img { max-width: 100%; border-radius: var(--radius-sm); margin: 1rem 0; }
.guide-md code { background: rgba(139, 92, 246, 0.1); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.9em; }
.guide-md pre { background: var(--bg-primary); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 1rem; overflow-x: auto; margin-bottom: 1rem; }
.guide-md pre code { background: none; padding: 0; }
.guide-md strong { color: var(--text-primary); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 26, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .section {
    padding: 3rem 1.25rem;
  }

  .server-info {
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .register-form {
    padding: 1.5rem;
  }

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

  .guides-container {
    grid-template-columns: 1fr;
  }

  .guide-dropdown {
    display: block;
  }

  .guide-list {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

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

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