/* ==========================================================================
   KAENG LONG JAN RUN 4 - Premium Sports Theme CSS
   ========================================================================== */

/* 1. Design Tokens & Variables */
:root {
  --bg-dark: #0a0f1d;
  --bg-card: #151f38;
  --bg-card-hover: #1c2a4a;
  --border-color: #24355a;

  --primary: #ff6a00; /* Neon Orange */
  --primary-hover: #ff8533;
  --secondary: #e11d48; /* Crimson */
  --accent: #22c55e; /* Lime Green for CTA */
  --accent-hover: #16a34a;

  --text-white: #ffffff;
  --text-muted: #94a3b8;
  --text-dark: #0f172a;

  --font-primary:
    "Prompt", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 16px;
  --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);

  --header-height: 70px;
}

/* 2. Global Resets */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-white);
  font-family: var(--font-primary);
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: 0;
}

/* Helper Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.highlight {
  color: var(--primary);
}

.highlight-green {
  color: var(--accent);
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* 3. Header Styling */
.app-header {
  height: var(--header-height);
  background-color: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
  display: block;
}

.header-btn {
  background-color: var(--accent);
  color: var(--text-white);
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

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

/* 4. Hero Section */
.hero-section {
  position: relative;
  padding-top: calc(var(--header-height) + 80px);
  padding-bottom: 60px;
  min-height: 80vh;
  display: flex;
  align-items: center;
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 106, 0, 0.15),
      transparent 60%
    ),
    radial-gradient(
      circle at bottom left,
      rgba(225, 29, 72, 0.1),
      transparent 60%
    );
  text-align: center;
  overflow: hidden;
}

.hero-video-container {
  width: 90%;
  max-width: 640px;
  margin-top: 30px;
  border-radius: var(--border-radius);
  overflow: hidden;
  border: 2px solid var(--border-color);
  box-shadow: var(--box-shadow);
  background-color: #000;
  display: block;
}

.hero-video-player {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.15;
  pointer-events: none;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--text-white);
  padding: 6px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(255, 106, 0, 0.4);
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.hero-subtitle {
  font-size: 1.3rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 30px;
}

/* Countdown Timer */
.countdown-container {
  background: rgba(21, 31, 56, 0.6);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
  border-radius: var(--border-radius);
  padding: 20px;
  width: 100%;
  max-width: 450px;
  margin-bottom: 35px;
  box-shadow: var(--box-shadow);
}

.countdown-title {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 300;
}

.countdown-timer {
  display: flex;
  justify-content: space-around;
}

.time-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.time-val {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(255, 106, 0, 0.4);
}

.time-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 9999px;
  transition: var(--transition-smooth);
  cursor: pointer;
  border: none;
  outline: none;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #16a34a);
  color: var(--text-white);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.4);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(34, 197, 94, 0.5);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-white);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
  transform: translateY(-2px);
}

.hero-cta-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 90%;
  max-width: 450px;
  margin-bottom: 20px;
}

.hero-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Pulse Animation */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.pulse-btn {
  animation: pulse 2s infinite;
}

/* 5. Section General Layout */
section {
  padding: 60px 0;
  border-bottom: 1px solid var(--border-color);
}

.section-title-wrap {
  text-align: center;
  margin-bottom: 40px;
}

.section-title {
  font-size: 1.55rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-divider {
  height: 4px;
  width: 60px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  margin: 0 auto 16px auto;
  border-radius: 2px;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto;
}

/* 6. Categories Cards Grid */
.categories-grid {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.category-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition-smooth);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.category-card:hover {
  transform: translateY(-4px);
  background-color: var(--bg-card-hover);
  border-color: var(--primary);
}

.card-img-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: #000;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

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

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: var(--transition-smooth);
}

.category-card:hover .card-overlay {
  opacity: 1;
}

.zoom-icon {
  background-color: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-white);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.card-body {
  padding: 24px;
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dist-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.dist-funrun {
  background-color: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.dist-mini {
  background-color: rgba(255, 106, 0, 0.15);
  color: #ff9d5c;
  border: 1px solid rgba(255, 106, 0, 0.3);
}

.dist-half {
  background-color: rgba(225, 29, 72, 0.15);
  color: #fda4af;
  border: 1px solid rgba(225, 29, 72, 0.3);
}

.price-tag {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.card-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Gallery Section (Shirt, Medal, Trophy mockups) */
.gallery-section {
  padding: 60px 0;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(21, 31, 56, 0.2);
}

.gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.gallery-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: var(--transition-smooth);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.gallery-card:hover {
  transform: translateY(-4px);
  background-color: var(--bg-card-hover);
  border-color: var(--primary);
}

.gallery-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: #000;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

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

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: var(--transition-smooth);
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-body {
  padding: 20px;
  text-align: center;
}

.gallery-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-white);
}

/* 7. Tabs Section (Race Maps & Details) */
.tabs-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px;
  box-shadow: var(--box-shadow);
}

.tab-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.tab-btn {
  background-color: rgba(10, 15, 29, 0.5);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 12px 8px;
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tab-btn:hover {
  color: var(--text-white);
  background-color: var(--border-color);
}

.tab-btn.active {
  background-color: var(--primary);
  color: var(--text-white);
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.3);
}

.tab-contents {
  position: relative;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease-in-out forwards;
}

.tab-pane.active {
  display: block;
}

.tab-media {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: pointer;
  background-color: #000;
  margin-bottom: 16px;
}

.tab-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: var(--transition-smooth);
}

.tab-media:hover .tab-img {
  opacity: 0.95;
  transform: scale(1.02);
}

.tab-img-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: var(--text-white);
  text-align: center;
  padding: 12px 10px;
  font-size: 0.8rem;
  font-weight: 500;
}

.tab-desc {
  padding: 4px;
}

.tab-desc h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--primary);
}

.tab-desc p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

/* 8. Registration Steps (Vertical Stack on Mobile) */
.process-section {
  background-color: rgba(21, 31, 56, 0.4);
}

.process-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  margin-bottom: 30px;
}

.step-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  text-align: center;
  width: 100%;
  max-width: 320px;
  position: relative;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.step-num {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--text-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 auto 16px auto;
  box-shadow: 0 4px 10px rgba(255, 106, 0, 0.3);
}

.step-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.step-arrow {
  color: var(--primary);
  transform: rotate(90deg); /* Arrow points down on mobile */
  opacity: 0.7;
}

.process-cta {
  text-align: center;
  margin-top: 20px;
}

/* 9. Accordion Section (FAQ) */
.faq-accordion {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.faq-trigger {
  width: 100%;
  background-color: transparent;
  border: none;
  outline: none;
  padding: 20px;
  text-align: left;
  color: var(--text-white);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

.faq-trigger:hover {
  background-color: var(--bg-card-hover);
}

.faq-icon {
  font-size: 1.25rem;
  color: var(--primary);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background-color: rgba(10, 15, 29, 0.4);
  border-top: 0 solid var(--border-color);
}

.faq-item.active .faq-panel {
  border-top-width: 1px;
}

.faq-panel p {
  padding: 20px 20px 10px 20px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.faq-media {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: pointer;
  background-color: #000;
  margin: 0 20px 20px 20px;
  max-width: 480px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.faq-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  transition: var(--transition-smooth);
}

.faq-media:hover .faq-img {
  opacity: 0.9;
  transform: scale(1.02);
}

.faq-img-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  color: var(--text-white);
  text-align: center;
  padding: 8px 10px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* 10. Footer Section */
.app-footer {
  background-color: #050810;
  padding: 40px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: 8px;
}

.footer-contact a {
  color: var(--primary);
}

.footer-contact a:hover {
  text-decoration: underline;
}

.footer-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 20px auto;
  max-width: 300px;
}

.copyright {
  font-size: 0.75rem;
}

/* 11. Sticky Bottom CTA Bar for Mobile */
.sticky-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  padding: 10px 16px;
  z-index: 999;
}

.sticky-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #16a34a);
  color: var(--text-white);
  padding: 14px 20px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
  position: relative;
  overflow: hidden;
}

.sticky-btn span {
  z-index: 2;
}

.line-btn-icon {
  margin-right: 8px;
  z-index: 2;
}

/* Glow Pulse Indicator */
.pulse-indicator {
  position: absolute;
  right: 20px;
  width: 8px;
  height: 8px;
  background-color: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px #fff;
  animation: stickyPulse 1.5s infinite;
  z-index: 2;
}

@keyframes stickyPulse {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.3);
    opacity: 1;
  }
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
}

/* 12. Fullscreen Lightbox Modal */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(5, 8, 16, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 20px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--text-white);
  font-size: 2.5rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  transition: var(--transition-smooth);
}

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

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-caption {
  margin-top: 16px;
  color: var(--text-white);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
}

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

/* ==========================================================================
   13. Responsive Media Queries (Desktop Layout)
   ========================================================================== */
@media (min-width: 768px) {
  /* Header adjustments */
  .logo-img {
    height: 48px;
  }

  /* Hero adjustments */
  .hero-section {
    padding-top: calc(var(--header-height) + 100px);
    padding-bottom: 90px;
  }

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

  .hero-subtitle {
    font-size: 1.85rem;
  }

  .hero-desc {
    font-size: 1.05rem;
  }

  .hero-cta-group {
    flex-direction: row;
    max-width: 680px;
    width: 90%;
  }

  .btn {
    flex: 1;
  }

  .countdown-container {
    max-width: 550px;
    padding: 30px;
  }

  .time-val {
    font-size: 3rem;
  }

  .time-lbl {
    font-size: 0.875rem;
  }

  /* Categories Grid to columns */
  .categories-grid {
    flex-direction: row;
  }

  .category-card {
    flex: 1;
  }

  /* Gallery Grid to columns */
  .gallery-grid {
    flex-direction: row;
  }

  .gallery-card {
    flex: 1;
  }

  /* Tabs Section */
  .tab-buttons {
    grid-template-columns: repeat(4, 1fr);
  }

  .tab-pane {
    display: none;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    align-items: center;
  }

  .tab-pane.active {
    display: grid;
  }

  .tab-media {
    margin-bottom: 0;
  }

  /* Process steps columns */
  .process-steps {
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
  }

  .step-card {
    flex: 1;
  }

  .step-arrow {
    transform: rotate(0deg); /* Arrow points right on desktop */
    display: flex;
    align-items: center;
  }

  /* Sticky Bottom Bar - Hidden on desktop */
  .sticky-bottom-bar {
    display: none;
  }

  body {
    padding-bottom: 0; /* Remove padding */
  }

  .section-title {
    font-size: 1.95rem;
  }
}
