/* ═══════════════════════════════════════════════════════
   global.css — shared across ALL pages
   punyahanif.id
═══════════════════════════════════════════════════════ */

/* ── CSS VARIABLES ── */
:root {
  --bg: #f8fafc;
  --text-main: #334155;
  --heading-color: #000000;
  --logo-color: #1c2f9b;
  --card-bg: #ffffff;
  --accent: #2563eb;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --nav-shape: rgba(0, 0, 0, 0.05);
  --lang-shape: rgba(0, 0, 0, 0.05);
  --theme-highlight: transparent;
  --radius: 20px;
  --transition: 0.3s ease;
}

body.dark {
  --bg: #0f172a;
  --text-main: #f1f5f9;
  --heading-color: #3b82f6;
  --logo-color: #f1f5f9;
  --card-bg: #1e293b;
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  --nav-shape: rgba(255, 255, 255, 0.1);
  --lang-shape: rgba(255, 255, 255, 0.1);
  --theme-highlight: #fde047;
}

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

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text-main);
  transition: background-color 0.4s ease, color 0.4s ease;
  min-height: 100vh;
  overflow-y: auto;
}

/* ── NAVBAR ── */
nav.global-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 40px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.nav-logo {
  font-size: 1.5rem;
  color: var(--logo-color);
  font-weight: bold;
  text-decoration: none;
}

.nav-group {
  background: var(--nav-shape);
  padding: 5px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nav-links {
  display: flex;
  position: relative;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  padding: 8px 25px;
  border-radius: 40px;
  font-weight: bold;
  font-size: 0.9rem;
  position: relative;
  z-index: 2;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.nav-links a.active {
  color: white !important;
}

body.dark #_nav_pill {
  background: var(--accent) !important;
}

/* ── NAV CONTROLS (theme + lang) ── */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switcher {
  background: var(--lang-shape);
  padding: 4px;
  border-radius: 30px;
  display: flex;
  gap: 2px;
}

.lang-switcher button,
.nav-controls button {
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 50px;
  font-weight: bold;
  transition: var(--transition);
}

.theme-btn {
  width: 38px;
  height: 38px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border-radius: 50% !important;
}

body.dark .theme-btn {
  background-color: var(--theme-highlight) !important;
  box-shadow: 0 0 12px rgba(253, 224, 71, 0.4);
}

/* ── ANIMATIONS ── */
.fade-slide { animation: slideSide 0.5s ease-out; }

@keyframes slideSide {
  from { opacity: 0; transform: translateX(15px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

/* Page enter — smooth fade up */
body {
  animation: pageEnter 0.3s cubic-bezier(0.25,1,0.5,1) both;
}

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

/* Page exit — fade out saat pindah halaman */
body.page-exit {
  animation: pageExit 0.22s ease-in forwards;
  pointer-events: none;
}

@keyframes pageExit {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}

/* ── MAIN WRAPPER ── */
.page-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  animation: slideUpFade 0.7s ease-out;
}

/* ── STATUS DOT ── */
.status-update {
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.7;
}

.dot {
  height: 10px;
  width: 10px;
  background-color: #22c55e;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  animation: pulse 2s infinite;
}

.dot.red { background-color: #ef4444; }

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

/* ── BUTTONS ── */
.btn {
  text-decoration: none;
  padding: 14px 35px;
  background: var(--accent);
  color: white;
  border-radius: 15px;
  font-weight: bold;
  transition: var(--transition);
  display: inline-block;
}

.btn:hover { transform: translateY(-3px); filter: brightness(1.1); }

/* ── RESPONSIVE NAVBAR ── */
@media (max-width: 768px) {
  nav.global-nav { flex-wrap: wrap; padding: 15px 20px; gap: 12px; }
  .nav-links a   { padding: 8px 15px; font-size: 0.8rem; }
}

/* ── SCRAMBLE OVERLAY ── */
.scramble-overlay {
  position: fixed;
  inset: 0;
  background: #0f172a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 9999;
}

.scramble-text {
  color: white;
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  font-family: monospace;
}

.scramble-line {
  height: 3px;
  width: 0;
  background: #2563eb;
  border-radius: 2px;
  transition: width 0.8s ease;
}

/* ── PAGE FOOTER ── */
.page-footer {
  margin-top: 120px;
  padding-bottom: 60px;
}
