/* Reset dasar */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Loading Screen */
.loader {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.8s ease;
  color: #e63946;
  font-family: 'Orbitron', monospace;
  font-size: 1.8rem;
  text-shadow: 0 0 15px rgba(230, 57, 70, 0.7);
}

.loader .spinner {
  width: 80px;
  height: 80px;
  border: 8px solid rgba(230, 57, 70, 0.3);
  border-top: 8px solid #e63946;
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
  margin-bottom: 1.5rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Body */
body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: linear-gradient(180deg, #0a0a0a, #1a1a2e);
  color: #e0e0e0;
  line-height: 1.7;
  min-height: 100vh;
  padding-top: 70px; /* jarak aman sesuai tinggi header */
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(17, 17, 17, 0.92);
  padding: 0.8rem 1.5rem;
  z-index: 1000;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #e63946;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

header h1 {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  color: #e63946;
  letter-spacing: 2px;
  margin: 0;
  text-shadow: 0 0 10px rgba(230, 57, 70, 0.6);
}

header p {
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  color: #bbb;
  margin: 0;
  font-style: italic;
}

/* Hamburger */
.hamburger {
  display: none !important;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
  border: 1px solid rgba(230, 57, 70, 0.35);
  background: rgba(0, 0, 0, 0.45);
  border-radius: 8px;
  padding: 10px;
  width: 46px;
  height: 46px;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease, background 0.3s ease;
}

.hamburger:hover,
.hamburger:focus-visible {
  transform: scale(1.05);
  background: rgba(230, 57, 70, 0.25);
  outline: none;
}

.hamburger span {
  width: 26px;
  height: 3px;
  background: #e63946;
  border-radius: 4px;
  transition: all 0.3s ease;
  display: block;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Nav horizontal (PC) */
.main-nav ul {
  display: flex;
  gap: 1.2rem;
  list-style: none;
}

.main-nav ul li a {
  color: #f0f0f0;
  text-decoration: none;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: all 0.3s;
  font-size: 0.95rem;
}

.main-nav ul li a:hover {
  background: rgba(230, 57, 70, 0.3);
  color: #e63946;
}

.active-link {
  background: rgba(230, 57, 70, 0.45);
  color: #fff;
  box-shadow: 0 0 12px rgba(230, 57, 70, 0.7);
}

.skip-link {
  position: absolute;
  top: -999px;
  left: 0;
  background: #e63946;
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 1100;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 80px;
}

.branch-card {
  border: 2px solid rgba(0, 255, 224, 0.22);
}

.branch-btn {
  display: inline-block;
  margin: 0.6rem 1rem 1.2rem;
  background-color: #00ffe0;
  color: #0a0a0a;
  text-decoration: none;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.branch-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* Chat Kabebasan */
.chat-container {
  background: rgba(10,10,20,0.8);
  border: 2px solid rgba(0,255,224,0.4);
  border-radius: 14px;
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.chat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.chat-meta input {
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: #111;
  color: #fff;
}

.chat-meta button {
  background: #e63946;
  border: none;
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
}

.messages {
  background: rgba(0,0,0,0.5);
  min-height: 280px;
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid rgba(0,255,224,0.25);
  border-radius: 8px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
}

.chat-message {
  margin: 0.3rem 0;
  color: #d8d8d8;
}

.chat-user {
  color: #00ffe0;
  font-weight: 700;
}

.chat-message small {
  color: #8e8e8e;
  font-size: 0.7rem;
  margin-left: 0.4rem;
}

.chat-form {
  display: flex;
  gap: 0.6rem;
}

.chat-form input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.2);
  background: #111;
  color: #fff;
  border-radius: 8px;
}

.chat-form button {
  background: #00ffe0;
  border: none;
  color: #111;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
}

/* Clock */
#clock {
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem;
  color: #00ffe0;
  text-shadow: 0 0 10px #00ffe0;
  white-space: nowrap;
}

/* Main */
main {
  padding: 2rem 1rem;
}

/* Section */
section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* Gallery Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  padding: 1rem;
}

.karya {
  background: rgba(34, 34, 34, 0.85);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.4s ease;
  cursor: pointer;
  border: 1px solid rgba(230, 57, 70, 0.25);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.karya img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.karya h3 {
  padding: 1rem 1rem 0.5rem;
  color: #e63946;
  font-size: 1.3rem;
  margin: 0;
}

.karya p {
  padding: 0 1rem 1.2rem;
  color: #ccc;
  font-size: 0.95rem;
  margin: 0;
  flex-grow: 1;
}

.karya:hover {
  transform: translateY(-12px);
  box-shadow: 0 15px 40px rgba(230, 57, 70, 0.45);
  border-color: #e63946;
}

.karya:hover img { transform: scale(1.08); }

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1rem;
  background: #111;
  border-top: 3px solid #e63946;
  margin-top: 4rem;
  color: #888;
}

/* ============================================= */
/*   KHUSUS MOBILE / HP                          */
/* ============================================= */
@media (max-width: 768px) {
  body { 
    padding-top: 85px; /* pas untuk header mobile */
  }

  header {
    padding: 0.8rem 1rem;
    min-height: 70px;
    height: auto;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
  }

  .header-left {
    text-align: center;
  }

  /* Hamburger muncul */
  .hamburger { 
    display: flex !important; 
  }

  /* Nav horizontal disembunyikan */
  .main-nav { 
    display: none !important; 
  }

  /* Sidebar default tersembunyi */
  .sidebar {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(110%);
    width: min(86vw, 320px);
    height: 100%;
    background: #000;
    padding: 80px 20px 40px;
    transition: transform 0.35s cubic-bezier(0.5, 0, 0.2, 1);
    z-index: 9999;
    box-shadow: -5px 0 28px rgba(0, 0, 0, 0.6);
    border-left: 1px solid rgba(230, 57, 70, 0.35);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  /* Sidebar aktif muncul */
  .sidebar.active { 
    right: 0; 
  }

  .close-sidebar {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: #e63946;
    cursor: pointer;
  }

  .sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .sidebar ul li {
    margin: 1.2rem 0;
  }

  .sidebar ul li a { 
    font-size: 1.4rem; 
    color: #f0f0f0;
    text-decoration: none;
    transition: color 0.3s;
  }

  .sidebar ul li a:hover {
    color: #e63946;
  }

  main { 
    padding: 1.5rem 1rem; 
  }

  .grid { 
    grid-template-columns: 1fr; 
    gap: 1.8rem; 
  }

  .karya img { 
    height: 200px; 
  }
}

/* Login Section */
.login-section {
  max-width: 400px;
  margin: 2rem auto;
  padding: 2rem;
  background: rgba(17, 17, 17, 0.9);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  border: 1px solid #e63946;
}

.login-section h2 {
  text-align: center;
  color: #e63946;
  margin-bottom: 1.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #e0e0e0;
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid #e63946;
  border-radius: 5px;
  color: #e0e0e0;
  font-size: 1rem;
}

.form-group input:focus {
  outline: none;
  border-color: #ff6b6b;
  box-shadow: 0 0 5px rgba(230, 57, 70, 0.5);
}

button {
  padding: 0.75rem;
  background: #e63946;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 0.5rem;
  transition: background 0.3s;
}

button:hover {
  background: #ff6b6b;
}

#register-btn {
  background: #333;
}

#register-btn:hover {
  background: #555;
}

#login-message {
  text-align: center;
  margin-top: 1rem;
  color: #ff6b6b;
}

/* Blog Styles */
.blog-hero {
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.1), rgba(0, 184, 255, 0.1));
  border-radius: 15px;
  margin-bottom: 2rem;
  border: 1px solid rgba(230, 57, 70, 0.3);
}

.blog-hero h2 {
  color: #e63946;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 10px rgba(230, 57, 70, 0.5);
}

.blog-hero p {
  color: #bbb;
  font-size: 1.1rem;
}

.stats-section {
  margin-bottom: 2rem;
}

.search-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.search-filter input, .search-filter select {
  padding: 0.75rem;
  border: 1px solid #e63946;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  font-size: 1rem;
  min-width: 200px;
}

.search-filter input:focus, .search-filter select:focus {
  outline: none;
  border-color: #ff6b6b;
  box-shadow: 0 0 5px rgba(230, 57, 70, 0.5);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.blog-card {
  background: rgba(17, 17, 17, 0.9);
  border: 1px solid rgba(230, 57, 70, 0.3);
  border-radius: 15px;
  padding: 1.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
  overflow: hidden;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(230, 57, 70, 0.3);
}

.blog-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.blog-card h3 {
  color: #7cd7ff;
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.blog-card .badge {
  display: inline-block;
  background: #00a4ff;
  color: #fff;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.blog-card small {
  color: #99b7d8;
  display: block;
  margin-bottom: 1rem;
}

.blog-card p {
  color: #d2e7ff;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.blog-card a {
  color: #99d7ff;
  text-decoration: none;
  font-weight: bold;
}

.blog-card a:hover {
  text-decoration: underline;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination button {
  padding: 0.5rem 1rem;
  background: rgba(230, 57, 70, 0.2);
  border: 1px solid #e63946;
  color: #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.pagination button:hover, .pagination button.active {
  background: #e63946;
  color: #fff;
}

/* ==========================================
   ELEMENTS MENAKJUBKAN: ANIMASI KERETA API
   ========================================== */

/* Scene kereta api di background halaman */
.railway-scene {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* Rel kereta yang bergerak */
.railway-tracks {
  position: absolute;
  bottom: 20px;
  left: 0;
  width: 100%;
  height: 10px;
  background: linear-gradient(to right, #666 0%, #999 50%, #666 100%);
  background-size: 40px 10px;
  animation: trackMove 2s linear infinite;
}

@keyframes trackMove {
  0% { background-position: 0 0; }
  100% { background-position: 40px 0; }
}

/* Kereta api yang melintas - lokomotif uap imut */
.train {
  position: absolute;
  bottom: 20px;
  left: -220px;
  width: 220px;
  height: 90px;
  background: linear-gradient(135deg, #383838, #4f4f4f);
  border-radius: 12px 12px 8px 8px;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.8);
  animation: trainPass 8s linear infinite;
  z-index: 1;
  border: 2px solid rgba(255, 215, 0, 0.5);
}

.train::before {
  content: '';
  position: absolute;
  top: -22px;
  left: 18px;
  width: 18px;
  height: 40px;
  background: linear-gradient(180deg, #8f5a2c, #612f10);
  border-radius: 8px 8px 5px 5px;
  box-shadow: 0 0 16px rgba(255, 205, 80, 0.8);
}

.train::after {
  content: '';
  position: absolute;
  top: -10px;
  left: 48px;
  width: 40px;
  height: 24px;
  background: #ffd166;
  border-radius: 6px;
  border: 2px solid #f4a261;
  box-shadow: 0 0 10px rgba(255, 218, 145, 0.7);
}

.train .body {
  position: absolute;
  top: 14px;
  left: 20px;
  width: 180px;
  height: 58px;
  background: linear-gradient(135deg, #222, #444);
  border-radius: 10px;
  border: 2px solid #ffd166;
}

.train .face {
  position: absolute;
  top: 24px;
  left: 120px;
  width: 40px;
  height: 40px;
  background: #fee9d8;
  border-radius: 50%;
  border: 2px solid #f4a261;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.2);
}

.train .face::before,
.train .face::after {
  content: '';
  position: absolute;
  top: 14px;
  width: 6px;
  height: 6px;
  background: #333;
  border-radius: 50%;
}

.train .face::before { left: 10px; }
.train .face::after { right: 10px; }

.train .face .smile {
  position: absolute;
  left: 8px;
  bottom: 10px;
  width: 24px;
  height: 12px;
  border-bottom: 2px solid #333;
  border-radius: 0 0 16px 16px;
}

.train-wheel {
  position: absolute;
  bottom: -8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle, #333 45%, #111 60%, #000 100%);
  border: 3px solid #777;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.6);
}

.train-wheel:nth-child(1) { left: 20px; }
.train-wheel:nth-child(2) { left: 70px; }
.train-wheel:nth-child(3) { left: 120px; }
.train-wheel:nth-child(4) { left: 170px; }

.train-wheel::after {
  content: '';
  position: absolute;
  top: 7px;
  left: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ddd;
}

@keyframes trainPass {
  0% { left: -220px; }
  10% { left: 6%; }
  90% { left: 86%; }
  100% { left: 110vw; }
}


@keyframes trainPass {
  0% { left: -200px; }
  10% { left: 10%; }
  90% { left: 90%; }
  100% { left: 110vw; }
}

/* Asap kereta */
.smoke {
  position: absolute;
  bottom: 90px;
  left: 50%;
  width: 20px;
  height: 20px;
  background: rgba(200, 200, 200, 0.6);
  border-radius: 50%;
  animation: smokeRise 3s ease-out infinite;
  opacity: 0;
}

.smoke:nth-child(2) { animation-delay: 0.5s; left: 52%; }
.smoke:nth-child(3) { animation-delay: 1s; left: 48%; }

@keyframes smokeRise {
  0% { opacity: 0; transform: scale(0.5) translateY(0); }
  20% { opacity: 0.8; transform: scale(1) translateY(-20px); }
  100% { opacity: 0; transform: scale(1.5) translateY(-60px); }
}

/* Partikel bintang untuk efek futuristik */
.stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  animation: twinkle 2s infinite;
}

.star:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.star:nth-child(2) { top: 20%; left: 70%; animation-delay: 0.5s; }
.star:nth-child(3) { top: 30%; left: 40%; animation-delay: 1s; }
.star:nth-child(4) { top: 50%; left: 80%; animation-delay: 1.5s; }
.star:nth-child(5) { top: 70%; left: 10%; animation-delay: 2s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Tambahkan scene ke body */
body::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
  background: linear-gradient(to top, rgba(10, 10, 10, 0.8), transparent);
  z-index: -1;
}