/* ==========================================================
   Valheim Server Landing Page – Custom Styles
   Dark nordic theme with earthy tones
   ========================================================== */

/* ---------- CSS Variables ---------- */
:root {
  --color-bg:        #0e0e12;
  --color-bg-alt:    #14141a;
  --color-surface:   #1a1a24;
  --color-border:    #2a2a36;
  --color-text:      #d4cfc6;
  --color-text-muted:#8a8578;
  --color-heading:   #e8dcc8;
  --color-accent:    #c8a84e;
  --color-accent-dim:#a08230;
  --color-online:    #4caf50;
  --color-offline:   #f44336;
  --font-display:    'MedievalSharp', 'Georgia', 'Times New Roman', serif;
  --font-body:       'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-heading);
  font-weight: 400;
}

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

a:hover {
  color: var(--color-heading);
}

/* ---------- Scroll Reveal ---------- */
.reveal-hidden {
  opacity: 0;
  transform: translateY(30px);
  min-height: 200px;
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  min-height: auto;
}

/* ---------- Section Spacing ---------- */
.section-padding {
  padding: 5rem 0;
}

.section-title {
  font-size: 2.25rem;
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

.section-divider {
  width: 60px;
  height: 3px;
  background: var(--color-accent);
  margin: 0 auto 3rem;
  border: none;
  border-radius: 2px;
}

/* ========================================
   HERO SECTION
   ======================================== */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background-color: var(--color-bg);
}

/* Parallax background layer */
.hero-bg {
  position: absolute;
  inset: -60px;
  background: url('../img/hero-bg.png') center/cover no-repeat;
  will-change: transform;
  z-index: 0;
}

/* Gradient overlay for text readability */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      180deg,
      rgba(14, 14, 18, 0.2) 0%,
      rgba(14, 14, 18, 0.45) 40%,
      rgba(14, 14, 18, 0.75) 70%,
      rgba(14, 14, 18, 1) 100%
    );
  pointer-events: none;
}

/* Animated mist wisps */
.hero-mist {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hero-mist::before,
.hero-mist::after {
  content: '';
  position: absolute;
  bottom: -10%;
  width: 200%;
  height: 50%;
  background: radial-gradient(ellipse at center, rgba(200, 190, 170, 0.08) 0%, transparent 70%);
  animation: mistDrift 20s ease-in-out infinite alternate;
}

.hero-mist::after {
  bottom: -5%;
  height: 40%;
  background: radial-gradient(ellipse at center, rgba(200, 190, 170, 0.05) 0%, transparent 60%);
  animation-duration: 28s;
  animation-direction: alternate-reverse;
}

@keyframes mistDrift {
  0%   { transform: translateX(-15%) scaleY(1); }
  100% { transform: translateX(10%) scaleY(1.15); }
}

/* Particle canvas */
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 750px;
  padding: 2rem 1.5rem;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--color-heading);
  margin-bottom: 0.75rem;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.7), 0 1px 6px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
}

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-style: italic;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(4px);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.online {
  background-color: var(--color-online);
  box-shadow: 0 0 8px var(--color-online);
  animation: pulse 2s infinite;
}

.status-dot.offline {
  background-color: var(--color-offline);
  box-shadow: 0 0 8px var(--color-offline);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Hero Buttons */
.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-valheim {
  background: var(--color-accent);
  color: #1a1a24;
  border: none;
  padding: 0.65rem 1.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 6px;
  transition: background 0.2s, transform 0.15s;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-valheim:hover {
  background: var(--color-heading);
  color: #1a1a24;
  transform: translateY(-2px);
}

.btn-valheim-outline {
  background: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
  padding: 0.65rem 1.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-valheim-outline:hover {
  background: var(--color-accent);
  color: #1a1a24;
  transform: translateY(-2px);
}

/* Hero scroll-down button */
.hero-scroll-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-top: 2.5rem;
  border: 2px solid var(--color-accent-dim);
  border-radius: 50%;
  color: var(--color-accent);
  font-size: 1.3rem;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
  animation: bounce 2s infinite;
}

.hero-scroll-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-heading);
  transform: translateY(3px);
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ========================================
   ABOUT SECTION
   ======================================== */
#about {
  background: var(--color-bg-alt);
}

.about-text {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.1rem;
  text-align: center;
  line-height: 1.85;
  color: var(--color-text);
}

/* ========================================
   FEATURES SECTION
   ======================================== */
#features {
  background: var(--color-bg);
}

.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 2rem 1.5rem;
  text-align: center;
  height: 100%;
  transition: transform 0.25s, border-color 0.25s;
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-accent-dim);
}

.feature-icon {
  font-size: 2.25rem;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.feature-card p {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* ========================================
   HOW TO JOIN SECTION
   ======================================== */
#join {
  background: var(--color-bg-alt);
}

/* Server IP display box */
.server-ip-box {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 3rem;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  color: var(--color-accent);
  cursor: pointer;
  transition: border-color 0.2s;
}

.server-ip-box:hover {
  border-color: var(--color-accent);
}

.server-ip-box .bi-clipboard {
  font-size: 1rem;
  color: var(--color-text-muted);
  transition: color 0.2s;
}

.server-ip-box:hover .bi-clipboard {
  color: var(--color-accent);
}

/* Step cards */
.step-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1.5rem;
  height: 100%;
  transition: transform 0.25s;
}

.step-card:hover {
  transform: translateY(-4px);
}

.step-number {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #1a1a24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  font-family: var(--font-body);
}

.step-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
}

.step-card p {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* ========================================
   GALLERY SECTION – Bootstrap Carousel
   ======================================== */
#gallery {
  background: var(--color-bg);
}

/* Flex row: [<] [carousel] [>] */
.gallery-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  max-width: 1000px;
  margin: 0 auto;
}

.gallery-carousel {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

/* Ensure only the active slide is visible */
.gallery-carousel .carousel-inner {
  overflow: hidden;
}

.gallery-carousel .carousel-item {
  display: none;
}

.gallery-carousel .carousel-item.active {
  display: block;
}

.gallery-slide {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  aspect-ratio: 16 / 9;
  background: var(--color-surface);
}

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

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(transparent, rgba(14, 14, 18, 0.85));
  color: var(--color-heading);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Valheim-styled prev/next buttons */
.gallery-btn {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  background: var(--color-surface);
  border: 2px solid var(--color-accent-dim);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

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

.gallery-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(200, 168, 78, 0.35);
}

.gallery-btn i {
  font-size: 1.35rem;
  color: var(--color-accent);
  transition: color 0.2s;
}

.gallery-btn:hover i {
  color: #1a1a24;
}

/* Valheim-styled indicators */
.gallery-indicators {
  position: relative;
  bottom: auto;
  margin-top: 1.25rem;
  margin-bottom: 0;
  padding: 0;
  gap: 0.4rem;
  display: flex;
  justify-content: center;
}

.gallery-indicators button {
  width: 32px;
  height: 4px;
  border: none;
  border-radius: 2px;
  background-color: var(--color-border);
  opacity: 1;
  transition: background-color 0.25s, width 0.25s;
}

.gallery-indicators button.active {
  background-color: var(--color-accent);
  width: 48px;
}

/* Responsive: stack buttons below on small screens */
@media (max-width: 576px) {
  .gallery-wrapper {
    flex-direction: column;
    gap: 1rem;
  }

  .gallery-wrapper > .gallery-btn {
    order: 0;
  }

  .gallery-wrapper > .gallery-carousel {
    order: -1;
    width: 100%;
  }

  .gallery-wrapper > .gallery-btn-prev,
  .gallery-wrapper > .gallery-btn-next {
    display: none;
  }

  /* Show overlay buttons on mobile instead */
  .gallery-carousel {
    position: relative;
  }

  .gallery-carousel::before,
  .gallery-carousel::after {
    display: none;
  }
}

/* ========================================
   FOOTER
   ======================================== */
#footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0;
  text-align: center;
}

.footer-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--color-heading);
  margin-bottom: 0.75rem;
}

.footer-discord {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  transition: color 0.2s;
}

.footer-discord:hover {
  color: var(--color-accent);
}

.footer-copy {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ========================================
   COPY TOAST
   ======================================== */
.copy-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-accent);
  color: #1a1a24;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 1000;
}

.copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {
  .section-padding {
    padding: 3.5rem 0;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .step-card {
    padding: 1.25rem;
  }
}

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

  .btn-valheim,
  .btn-valheim-outline {
    width: 100%;
    max-width: 260px;
    justify-content: center;
  }
}
