@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ==========================================================================
   CSS VARIABLES & DESIGN SYSTEM (HSL Based)
   ========================================================================== */
:root {
  /* Colors - Light Theme */
  --primary-h: 215;
  --primary-s: 52%;
  --primary-l: 24%; /* #1E3A5F */
  --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  
  --accent-h: 44;
  --accent-s: 100%;
  --accent-l: 48%; /* #F4B400 */
  --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));
  --accent-hover: hsl(var(--accent-h), var(--accent-s), 40%);
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-nav: rgba(255, 255, 255, 0.85);
  --bg-alt: #f1f5f9;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --border-color: #e2e8f0;
  --card-shadow: 0 10px 30px -10px rgba(30, 58, 95, 0.15);
  --glow-shadow: 0 0 20px rgba(244, 180, 0, 0.2);
  
  /* Fonts */
  --font-serif: 'Cinzel', 'Playfair Display', serif;
  --font-sans: 'Plus Jakarta Sans', 'Inter', sans-serif;
  
  /* Radii & Transitions */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-card: #121b2d;
  --bg-nav: rgba(9, 13, 22, 0.85);
  --bg-alt: #1a253c;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-inverse: #090d16;
  
  --border-color: #1e2e4a;
  --card-shadow: 0 15px 40px -15px rgba(0, 0, 0, 0.6);
  --glow-shadow: 0 0 25px rgba(244, 180, 0, 0.35);
  
  --primary-l: 35%; /* Lighter blue in dark mode for contrast */
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.5px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

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

button, input, select {
  font-family: inherit;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border: 2px solid var(--bg-main);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ==========================================================================
   UTILITY & LAYOUT
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
  position: relative;
}

.section-alt {
  background-color: var(--bg-alt);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem auto;
}

.section-tag {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 2px;
  display: inline-block;
  margin-bottom: 0.75rem;
  position: relative;
}

.section-tag::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background-color: var(--accent);
  margin: 0.5rem auto 0 auto;
}

.section-title {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 1rem;
  font-weight: 800;
  transition: color 0.4s ease;
}

[data-theme="dark"] .section-title {
  color: #ffffff;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  font-size: 0.95rem;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 4px 15px rgba(30, 58, 95, 0.2);
}

.btn-primary:hover {
  background-color: var(--accent);
  color: #1e293b;
  transform: translateY(-2px);
  box-shadow: var(--glow-shadow);
}

.btn-accent {
  background-color: var(--accent);
  color: #1e293b;
  box-shadow: var(--glow-shadow);
}

.btn-accent:hover {
  background-color: #ffffff;
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary);
  color: white;
  transform: translateY(-2px);
}

[data-theme="dark"] .btn-outline {
  color: var(--accent);
  border-color: var(--accent);
}

[data-theme="dark"] .btn-outline:hover {
  background-color: var(--accent);
  color: #1e293b;
}

/* ==========================================================================
   NAVIGATION & HEADER
   ========================================================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-smooth), background-color 0.4s ease;
}

header.scrolled {
  padding: 0.5rem 0;
  box-shadow: var(--card-shadow);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

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

.logo-icon {
  font-size: 1.8rem;
  color: var(--accent);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

[data-theme="dark"] .logo-title {
  color: #ffffff;
}

.logo-sub {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

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

.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background-color: var(--accent);
  transition: var(--transition-smooth);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.icon-btn:hover {
  background-color: var(--border-color);
  color: var(--accent);
}

.theme-toggle .fa-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .fa-sun {
  display: block;
  color: var(--accent);
}

[data-theme="dark"] .theme-toggle .fa-moon {
  display: none;
}

.mobile-menu-btn {
  display: none;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  color: white;
  padding-top: 80px;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.85)), 
              url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=1920&q=80') no-repeat center center;
  background-size: cover;
  z-index: 1;
  transform: scale(1.05);
  animation: zoomBg 20s infinite alternate ease-in-out;
}

@keyframes zoomBg {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
  background: linear-gradient(transparent, var(--bg-main));
  z-index: 2;
}

.hero .container {
  position: relative;
  z-index: 3;
}

.hero-content {
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(244, 180, 0, 0.15);
  border: 1px solid rgba(244, 180, 0, 0.4);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(4px);
  animation: fadeInUp 0.8s ease-out;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  animation: fadeInUp 1s ease-out;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.hero-title span {
  color: var(--accent);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2.5rem;
  max-width: 650px;
  animation: fadeInUp 1.2s ease-out;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeInUp 1.4s ease-out;
}

.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.scroll-indicator i {
  font-size: 1.2rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* ==========================================================================
   TENTANG KETAPANG & TIMELINE
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text h3 {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 1.2rem;
}

[data-theme="dark"] .about-text h3 {
  color: var(--accent);
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.stat-card {
  background-color: var(--bg-card);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  text-align: center;
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.about-visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  height: 400px;
  background: var(--bg-card);
}

.about-map-svg {
  width: 100%;
  height: 100%;
  padding: 2rem;
  fill: var(--border-color);
  stroke: var(--primary);
  stroke-width: 1.5;
  transition: var(--transition-smooth);
}

.about-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Timeline Interaktif */
.timeline-section {
  padding-top: 2rem;
}

.timeline-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.timeline-dot {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  padding: 0.6rem 1.2rem;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: var(--text-muted);
}

.timeline-dot.active, .timeline-dot:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: var(--card-shadow);
}

[data-theme="dark"] .timeline-dot.active, 
[data-theme="dark"] .timeline-dot:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #1e293b;
  box-shadow: var(--glow-shadow);
}

.timeline-container {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  min-height: 250px;
}

.timeline-content {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--card-shadow);
  display: none;
  animation: fadeIn 0.5s ease;
  position: relative;
}

.timeline-content.active {
  display: block;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.timeline-year {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-serif);
}

.timeline-era {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background-color: var(--bg-alt);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  color: var(--primary);
}

[data-theme="dark"] .timeline-era {
  color: #ffffff;
}

.timeline-body h4 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

[data-theme="dark"] .timeline-body h4 {
  color: #ffffff;
}

.timeline-body p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ==========================================================================
   KERAJAAN KETAPANG
   ========================================================================== */
.kingdom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.kingdom-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.kingdom-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
}

.kingdom-visual {
  height: 240px;
  overflow: hidden;
  position: relative;
}

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

.kingdom-card:hover .kingdom-visual img {
  transform: scale(1.08);
}

.kingdom-badge {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background-color: var(--primary);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.kingdom-body {
  padding: 2.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.kingdom-name {
  font-size: 1.8rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

[data-theme="dark"] .kingdom-name {
  color: #ffffff;
}

.kingdom-period {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.kingdom-desc {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.kingdom-meta {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kingdom-meta-item {
  display: flex;
  font-size: 0.9rem;
}

.kingdom-meta-label {
  font-weight: 700;
  width: 110px;
  color: var(--text-main);
}

.kingdom-meta-val {
  color: var(--text-muted);
}

.kingdom-footer {
  margin-top: 1.5rem;
}

/* ==========================================================================
   SITUS SEJARAH
   ========================================================================== */
.sites-filter {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: var(--text-muted);
}

.filter-btn.active, .filter-btn:hover {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--card-shadow);
}

[data-theme="dark"] .filter-btn.active, 
[data-theme="dark"] .filter-btn:hover {
  background-color: var(--accent);
  color: #1e293b;
  border-color: var(--accent);
  box-shadow: var(--glow-shadow);
}

.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2.5rem;
}

.site-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  animation: fadeInUp 0.6s ease;
}

.site-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 15px 35px -15px rgba(244, 180, 0, 0.15);
}

.site-img-container {
  height: 220px;
  overflow: hidden;
  position: relative;
}

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

.site-card:hover .site-img-container img {
  transform: scale(1.08);
}

.site-cat {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: rgba(30, 58, 95, 0.9);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

[data-theme="dark"] .site-cat {
  background-color: rgba(244, 180, 0, 0.95);
  color: #1e293b;
}

.site-card-body {
  padding: 1.8rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.site-name {
  font-size: 1.35rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

[data-theme="dark"] .site-name {
  color: #ffffff;
}

.site-loc {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.site-loc i {
  color: var(--accent);
}

.site-card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.site-card-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-more-btn {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.site-more-btn:hover {
  color: var(--accent);
}

[data-theme="dark"] .site-more-btn {
  color: var(--accent);
}

[data-theme="dark"] .site-more-btn:hover {
  color: white;
}

/* ==========================================================================
   TOKOH SEJARAH
   ========================================================================== */
.figures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 3rem;
}

.figure-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.figure-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
}

.figure-top {
  display: flex;
  background-color: var(--bg-alt);
  position: relative;
}

.figure-img {
  width: 140px;
  height: 180px;
  object-fit: cover;
  border-right: 1px solid var(--border-color);
  flex-shrink: 0;
}

.figure-intro {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.figure-name {
  font-size: 1.35rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

[data-theme="dark"] .figure-name {
  color: #ffffff;
}

.figure-role {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.figure-life {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.figure-body {
  padding: 2rem;
  flex-grow: 1;
}

.figure-bio {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.figure-achieve-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-theme="dark"] .figure-achieve-title {
  color: var(--accent);
}

.figure-achieve-list {
  list-style: none;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.figure-achieve-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
}

.figure-achieve-list li::before {
  content: '\f058';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  color: var(--accent);
  position: absolute;
  left: 0;
  top: 1px;
}

/* ==========================================================================
   GALERI SEJARAH
   ========================================================================== */
.gallery-grid {
  columns: 3 300px;
  column-gap: 1.5rem;
}

.gallery-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
  break-inside: avoid;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
}

.gallery-item:hover {
  transform: scale(1.02) translateY(-4px);
  border-color: var(--accent);
}

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

.gallery-item-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.9));
  padding: 1.5rem;
  color: white;
  opacity: 0;
  transition: var(--transition-smooth);
}

.gallery-item:hover .gallery-item-info {
  opacity: 1;
}

.gallery-item-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  font-family: var(--font-serif);
}

.gallery-item-cat {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 1px;
}

/* ==========================================================================
   VIDEO PEMBELAJARAN (Netflix Style)
   ========================================================================== */
.video-netflix-container {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 2.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  min-height: 500px;
}

.video-player-side {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
}

.video-screen-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  background-color: #000;
}

.video-screen-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-meta-detail {
  margin-top: 1.5rem;
}

.video-meta-title {
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-family: var(--font-serif);
}

[data-theme="dark"] .video-meta-title {
  color: #ffffff;
}

.video-meta-desc {
  color: var(--text-muted);
  font-size: 1rem;
}

.video-playlist-side {
  background-color: var(--bg-alt);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  max-height: 550px;
  overflow-y: auto;
}

.playlist-header {
  padding: 1.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--primary);
}

[data-theme="dark"] .playlist-header {
  color: #ffffff;
}

.playlist-count {
  font-size: 0.8rem;
  background-color: var(--primary);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}

[data-theme="dark"] .playlist-count {
  background-color: var(--accent);
  color: #1e293b;
}

.playlist-items {
  list-style: none;
}

.playlist-item {
  padding: 1.2rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  gap: 1rem;
  align-items: center;
}

.playlist-item:hover, .playlist-item.active {
  background-color: var(--bg-card);
}

.playlist-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1rem;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.playlist-item.active .playlist-item-icon {
  background-color: var(--accent);
  color: #1e293b;
  box-shadow: var(--glow-shadow);
}

.playlist-item-details {
  flex-grow: 1;
}

.playlist-item-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.2rem;
  line-height: 1.3;
}

.playlist-item-dur {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   KUIS INTERAKTIF (Gamified)
   ========================================================================== */
.quiz-widget {
  max-width: 750px;
  margin: 0 auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

.quiz-widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

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

.quiz-icon {
  font-size: 3.5rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.quiz-intro h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

[data-theme="dark"] .quiz-intro h3 {
  color: #ffffff;
}

.quiz-intro p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.quiz-progress-wrapper {
  flex-grow: 1;
  margin: 0 1.5rem;
  height: 10px;
  background-color: var(--border-color);
  border-radius: 5px;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  width: 0%;
  background-color: var(--accent);
  transition: width 0.4s ease;
}

.quiz-score-badge {
  font-weight: 700;
  font-size: 0.9rem;
  background-color: var(--bg-alt);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-theme="dark"] .quiz-score-badge {
  color: #ffffff;
}

.quiz-score-badge span {
  color: var(--accent);
  font-weight: 800;
}

.quiz-q-box {
  margin-bottom: 2.5rem;
}

.quiz-q-num {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.quiz-q-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}

.quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.quiz-option {
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  color: var(--text-main);
}

.quiz-option:hover {
  border-color: var(--primary);
  background-color: var(--bg-alt);
}

[data-theme="dark"] .quiz-option:hover {
  border-color: var(--accent);
}

.quiz-option-letter {
  width: 30px;
  height: 30px;
  background-color: var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.quiz-option:hover .quiz-option-letter {
  background-color: var(--primary);
  color: white;
}

[data-theme="dark"] .quiz-option:hover .quiz-option-letter {
  background-color: var(--accent);
  color: #1e293b;
}

/* Feedback Kuis */
.quiz-option.correct {
  border-color: #10b981;
  background-color: rgba(16, 185, 129, 0.05);
}

.quiz-option.correct .quiz-option-letter {
  background-color: #10b981;
  color: white;
}

.quiz-option.wrong {
  border-color: #ef4444;
  background-color: rgba(239, 68, 68, 0.05);
}

.quiz-option.wrong .quiz-option-letter {
  background-color: #ef4444;
  color: white;
}

.quiz-explanation {
  margin-top: 1.5rem;
  padding: 1.2rem;
  background-color: rgba(244, 180, 0, 0.08);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  display: none;
  animation: slideInDown 0.3s ease;
}

.quiz-explanation p {
  font-size: 0.95rem;
  color: var(--text-main);
}

.quiz-next-btn {
  margin-top: 2rem;
  float: right;
  display: none;
}

/* Kuis Selesai / Dashboard */
.quiz-result {
  text-align: center;
}

.quiz-result-score {
  font-size: 4rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.quiz-result-msg {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

[data-theme="dark"] .quiz-result-msg {
  color: #ffffff;
}

.badge-showcase {
  background-color: var(--bg-alt);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin: 1.5rem auto 2.5rem auto;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.quiz-badge {
  font-size: 4.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
  filter: drop-shadow(0 5px 15px rgba(244, 180, 0, 0.4));
}

.quiz-badge-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

[data-theme="dark"] .quiz-badge-title {
  color: #ffffff;
}

.quiz-badge-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   VIRTUAL TOUR (Simulated 360°)
   ========================================================================== */
.tour-viewport {
  width: 100%;
  height: 500px;
  background-color: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
}

.tour-panorama {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: background-image 0.6s ease;
  position: absolute;
  top: 0;
  left: 0;
}

.tour-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 30%, rgba(0,0,0,0.6) 80%);
  pointer-events: none;
}

.tour-header {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 40px;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 10;
}

.tour-header-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
}

.tour-header-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background-color: var(--accent);
  color: #1e293b;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.tour-header-badge i {
  animation: pulse 1s infinite;
}

.tour-controls {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 0.75rem;
  z-index: 10;
}

.tour-nav-btn {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tour-nav-btn:hover {
  background-color: var(--accent);
  color: #1e293b;
  border-color: var(--accent);
}

/* Tour Hotspots */
.tour-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 5;
}

.hotspot-trigger {
  width: 40px;
  height: 40px;
  background-color: var(--accent);
  border: 4px solid white;
  border-radius: 50%;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(244, 180, 0, 0.6);
  font-size: 1.1rem;
  animation: pulseGlow 2s infinite;
  transition: var(--transition-smooth);
}

@keyframes pulseGlow {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(244, 180, 0, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(244, 180, 0, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(244, 180, 0, 0); }
}

.hotspot-trigger:hover {
  background-color: white;
  color: var(--primary);
  border-color: var(--accent);
}

.hotspot-card {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 260px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: var(--card-shadow);
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.tour-hotspot:hover .hotspot-card {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hotspot-card h5 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.hotspot-card p {
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(255,255,255,0.8);
}

/* ==========================================================================
   PETA INTERAKTIF
   ========================================================================== */
.map-wrapper {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--card-shadow);
}

.map-container-box {
  height: 500px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

/* Custom styles for Leaflet Leaflet Popups to match dark theme */
.leaflet-popup-content-wrapper {
  background-color: var(--bg-card) !important;
  color: var(--text-main) !important;
  font-family: var(--font-sans) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--card-shadow) !important;
  border: 1px solid var(--border-color) !important;
}

.leaflet-popup-tip {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
}

.leaflet-popup-content {
  margin: 1rem !important;
  min-width: 200px;
}

.map-popup-title {
  font-family: var(--font-serif) !important;
  font-weight: 700 !important;
  font-size: 1.1rem !important;
  color: var(--primary) !important;
  margin-bottom: 0.5rem !important;
}

[data-theme="dark"] .map-popup-title {
  color: var(--accent) !important;
}

.map-popup-desc {
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
  line-height: 1.4 !important;
  margin-bottom: 0.8rem !important;
}

.map-popup-btn {
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  color: var(--accent) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

/* Custom Marker Styling */
.custom-map-marker {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 36px !important;
  height: 36px !important;
  background-color: var(--primary) !important;
  border: 3px solid #ffffff !important;
  border-radius: 50% 50% 50% 0 !important;
  transform: rotate(-45deg) !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
  transition: var(--transition-smooth) !important;
}

.custom-map-marker i {
  color: white !important;
  transform: rotate(45deg) !important;
  font-size: 0.95rem !important;
}

.custom-map-marker.active {
  background-color: var(--accent) !important;
  box-shadow: var(--glow-shadow) !important;
}

[data-theme="dark"] .leaflet-tile-container {
  filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

/* ==========================================================================
   MODAL DIALOGS & SEARCH BAR
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 800px;
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.9) translateY(20px);
  transition: var(--transition-smooth);
}

.modal-overlay.active .modal-box {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.8rem 2.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.6rem;
  color: var(--primary);
}

[data-theme="dark"] .modal-title {
  color: #ffffff;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--accent);
  transform: rotate(90deg);
}

.modal-body {
  padding: 2.5rem;
  overflow-y: auto;
  flex-grow: 1;
}

/* Search Modal Specific */
.search-input-wrapper {
  position: relative;
  margin-bottom: 2rem;
}

.search-input-wrapper i {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.2rem;
}

.search-input {
  width: 100%;
  padding: 1.2rem 1.5rem 1.2rem 3.5rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  background-color: var(--bg-alt);
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--bg-card);
  box-shadow: var(--glow-shadow);
}

.search-results-list {
  list-style: none;
  max-height: 400px;
  overflow-y: auto;
}

.search-result-item {
  padding: 1.2rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-fast);
  border-radius: var(--radius-sm);
}

.search-result-item:hover {
  background-color: var(--bg-alt);
}

.search-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.search-result-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
}

[data-theme="dark"] .search-result-title {
  color: #ffffff;
}

.search-result-type {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  background-color: rgba(244,180,0,0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.search-result-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Lightbox Specific */
.lightbox-img-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 380px;
  margin-bottom: 1.5rem;
}

.lightbox-img-wrapper img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

.lightbox-desc {
  color: var(--text-muted);
  line-height: 1.7;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  background-color: var(--primary);
  color: white;
  padding: 5rem 0 2rem 0;
  border-top: 5px solid var(--accent);
  transition: background-color 0.4s ease;
}

[data-theme="dark"] footer {
  background-color: #05080f;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-info-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.footer-info-logo i {
  font-size: 2rem;
  color: var(--accent);
}

.footer-info-logo h4 {
  font-size: 1.5rem;
  font-family: var(--font-serif);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.footer-desc {
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 2rem;
  font-size: 0.95rem;
  line-height: 1.7;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-btn {
  background-color: rgba(255,255,255,0.08);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition-smooth);
}

.social-btn:hover {
  background-color: var(--accent);
  color: #1e293b;
  transform: translateY(-3px);
  box-shadow: var(--glow-shadow);
}

.footer-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.8rem;
  position: relative;
  padding-bottom: 0.75rem;
}

.footer-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: var(--accent);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.footer-links li a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
}

.footer-links li a:hover {
  color: var(--accent);
  padding-left: 5px;
}

.footer-contact-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.2rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
}

.footer-contact-item i {
  color: var(--accent);
  margin-top: 0.25rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
}

/* ==========================================================================
   SCROLL ANIMATIONS & DYNAMIC STYLING
   ========================================================================== */
.fade-in-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1024px) {
  h1 { font-size: 2.8rem; }
  h2 { font-size: 2.2rem; }
  
  .about-grid, .kingdom-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .about-visual {
    height: 350px;
  }
  
  .video-netflix-container {
    grid-template-columns: 1fr;
  }
  
  .video-playlist-side {
    border-left: none;
    border-top: 1px solid var(--border-color);
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  header {
    padding: 0.5rem 0;
  }
  
  .nav-menu {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background-color: var(--bg-card);
    flex-direction: column;
    padding: 3rem 2rem;
    gap: 2rem;
    align-items: flex-start;
    transition: var(--transition-smooth);
    border-top: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .mobile-menu-btn {
    display: flex;
    font-size: 1.5rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .figure-top {
    flex-direction: column;
  }
  
  .figure-img {
    width: 100%;
    height: 250px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .quiz-widget {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }
  
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   CHATBOT INTERAKTIF (Floating Widget Styles)
   ========================================================================== */
.chatbot-toggle-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--accent);
  color: #1e293b;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  box-shadow: 0 5px 25px rgba(244, 180, 0, 0.4);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.chatbot-toggle-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: var(--glow-shadow);
}

.chatbot-toggle-btn.chat-active {
  background-color: var(--primary);
  color: white;
  transform: rotate(180deg);
  box-shadow: var(--card-shadow);
}

[data-theme="dark"] .chatbot-toggle-btn.chat-active {
  background-color: var(--accent);
  color: #1e293b;
  box-shadow: var(--glow-shadow);
}

.chatbot-window {
  position: fixed;
  bottom: 6.5rem;
  right: 2rem;
  width: 380px;
  height: 520px;
  max-height: calc(100vh - 9rem);
  max-width: calc(100vw - 4rem);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: var(--transition-smooth);
}

.chatbot-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chatbot-header {
  background-color: var(--primary);
  padding: 1.2rem 1.5rem;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.4s ease;
}

[data-theme="dark"] .chatbot-header {
  background-color: #0c1322;
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.chatbot-header-icon {
  font-size: 1.4rem;
  color: var(--accent);
  filter: drop-shadow(0 0 4px rgba(244,180,0,0.5));
}

.chatbot-header-info h4 {
  font-size: 1.05rem;
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
}

.chatbot-status {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chatbot-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
  box-shadow: 0 0 8px #10b981;
  animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

.chatbot-close-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chatbot-close-btn:hover {
  color: var(--accent);
  transform: scale(1.1);
}

.chatbot-messages {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  background-color: var(--bg-main);
  transition: background-color 0.4s ease;
}

.chat-msg {
  display: flex;
  gap: 0.75rem;
  max-width: 85%;
  animation: chatFadeIn 0.3s ease-out;
}

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

.chat-msg-user {
  align-self: flex-end;
  justify-content: flex-end;
}

.chat-msg-bot {
  align-self: flex-start;
}

.chat-bot-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-card);
  color: var(--accent);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  box-shadow: var(--card-shadow);
}

.chat-bubble {
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: var(--card-shadow);
}

.chat-msg-user .chat-bubble {
  background-color: var(--primary);
  color: white;
  border-top-right-radius: 4px;
}

[data-theme="dark"] .chat-msg-user .chat-bubble {
  background-color: var(--accent);
  color: #1e293b;
  font-weight: 600;
}

.chat-msg-bot .chat-bubble {
  background-color: var(--bg-card);
  color: var(--text-main);
  border-top-left-radius: 4px;
  border: 1px solid var(--border-color);
}

.chat-bubble strong {
  color: var(--primary);
}

[data-theme="dark"] .chat-bubble strong {
  color: var(--accent);
}

/* Typing Indicator Animation */
.typing-bubble {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.8rem 1.2rem;
}

.typing-bubble span {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  animation: typingDots 1.4s infinite ease-in-out both;
}

.typing-bubble span:nth-child(1) { animation-delay: -0.32s; }
.typing-bubble span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDots {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.chatbot-form {
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
  background-color: var(--bg-card);
  align-items: center;
}

.chatbot-form input {
  flex-grow: 1;
  padding: 0.8rem 1.2rem;
  border: 1px solid var(--border-color);
  border-radius: 30px;
  font-size: 0.9rem;
  background-color: var(--bg-alt);
  color: var(--text-main);
  outline: none;
  transition: var(--transition-smooth);
}

.chatbot-form input:focus {
  border-color: var(--accent);
  background-color: var(--bg-card);
  box-shadow: var(--glow-shadow);
}

.chatbot-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: var(--transition-smooth);
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(30, 58, 95, 0.2);
}

.chatbot-send-btn:hover {
  background-color: var(--accent);
  color: #1e293b;
  transform: scale(1.05);
  box-shadow: var(--glow-shadow);
}

[data-theme="dark"] .chatbot-send-btn {
  background-color: var(--accent);
  color: #1e293b;
}

[data-theme="dark"] .chatbot-send-btn:hover {
  background-color: white;
  color: var(--primary);
}

@media (max-width: 480px) {
  .chatbot-window {
    bottom: 5.5rem;
    right: 1rem;
    left: 1rem;
    width: auto;
    max-width: none;
    height: 450px;
  }
  .chatbot-toggle-btn {
    bottom: 1rem;
    right: 1rem;
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }
}
