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

/* ============================================
   CEMARA — TACTICAL DESIGN SYSTEM 2026
   ============================================ */

:root {
  --bg-primary: #fbfdf7;
  --bg-secondary: #eef2e6;
  --bg-tertiary: #dce3d1;
  --text-primary: #1a1e16;
  --text-secondary: #4a5142;
  --border-color: rgba(0, 0, 0, 0.06);
  --glass-bg: #ffffff;
  --glass-border: rgba(0, 0, 0, 0.08);
  --cemara-500: #6b8543;
  --cemara-400: #88a360;
}

html.dark {
  --bg-primary: #030402; /* OLED Black */
  --bg-secondary: #080a06;
  --bg-tertiary: #0e120a;
  --text-primary: #f2f4f1;
  --text-secondary: #8c9684;
  --border-color: rgba(136, 163, 96, 0.12);
  --glass-bg: rgba(8, 10, 6, 0.8);
  --glass-border: rgba(136, 163, 96, 0.2);
  --glow-color: rgba(107, 133, 67, 0.3);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Mencegah navbar nutupin konten saat scroll ke anchor */
}

/* Atau untuk support lebih luas */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
/* Page Transition Animation */
.page-transition {
  animation: pageFadeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pageFadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-30px);
  }
}

/* Saat halaman baru loading */
.page-loading {
  animation: pageFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
/* === TEXTURE INJECTION === */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3%3Ffilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 9999;
}

.scanline {
  width: 100%;
  height: 2px;
  background: rgba(136, 163, 96, 0.05);
  position: fixed;
  z-index: 9998;
  pointer-events: none;
  animation: scanline 8s linear infinite;
}
@keyframes scanline {
  0% { transform: translateY(-100vh); }
  100% { transform: translateY(100vh); }
}

/* === BASE === */
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  transition: background-color 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Outfit', sans-serif;
}

/* === GLASS / SOLID PANELS === */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  position: relative;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.03);
}

.hud-corner::before, .hud-corner::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--cemara-500);
  border-style: solid;
  opacity: 0.5;
}
.hud-corner-tl::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.hud-corner-br::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

/* === UTILITY CLASSES === */
.bg-primary   { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-tertiary  { background-color: var(--bg-tertiary); }
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.border-custom  { border-color: var(--border-color); }

/* === ANIMATED HEX BACKGROUND === */
.tactical-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg-primary);
}

/* === NAVBAR SCROLL EFFECT === */
nav.scrolled {
  box-shadow: 0 4px 24px rgba(13, 156, 49, 0.342);
/* Transparan 70% (30% putih) */
  background-color: rgba(167, 194, 46, 0.3) !important;
  border-bottom: 0px solid var(--border-color);
  backdrop-filter: blur(4px);
}

/* === MOBILE MENU === */
#mobile-menu {
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#mobile-menu.open {
  transform: translateX(0);
}
#mobile-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#mobile-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* === FLOATING CTA === */
#floating-cta {
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#floating-cta.visible {
  transform: translateY(0);
  opacity: 1;
}

/* === CARD HOVER 2D === */
.card-hover {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
}
html.dark .card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
  border-color: rgba(136,163,96,0.3) !important;
}
html:not(.dark) .card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  border-color: rgba(107,133,67,0.4) !important;
}

/* === SCROLL REVEAL === */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* === COUNTER ANIMATION === */
.count-up {
  display: inline-block;
}

/* === STATUS PULSES === */
.pulse-red {
  animation: pulse-red 2s infinite;
}
@keyframes pulse-red {
  0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70%  { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.pulse-cemara {
  animation: pulse-cemara 2s infinite;
}
@keyframes pulse-cemara {
  0%   { box-shadow: 0 0 0 0 rgba(136, 163, 96, 0.4); }
  70%  { box-shadow: 0 0 0 6px rgba(136, 163, 96, 0); }
  100% { box-shadow: 0 0 0 0 rgba(136, 163, 96, 0); }
}

/* === PTT BUTTON === */
.ptt-button {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #526932, #2d381f);
  box-shadow:
    0 0 0 8px rgba(107,133,67,0.15),
    0 0 0 16px rgba(107,133,67,0.07),
    0 8px 32px rgba(0,0,0,0.5),
    inset 0 2px 4px rgba(255,255,255,0.15);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(136,163,96,0.4);
}
.ptt-button:hover {
  box-shadow:
    0 0 0 8px rgba(107,133,67,0.3),
    0 0 0 20px rgba(107,133,67,0.12),
    0 8px 32px rgba(0,0,0,0.5),
    0 0 40px rgba(107,133,67,0.3),
    inset 0 2px 4px rgba(255,255,255,0.2);
  transform: scale(1.05);
}
.ptt-button:active, .ptt-button.active {
  transform: scale(0.95);
  box-shadow:
    0 0 0 4px rgba(107,133,67,0.5),
    0 0 40px rgba(107,133,67,0.6),
    0 4px 16px rgba(0,0,0,0.5),
    inset 0 2px 8px rgba(0,0,0,0.4);
}

/* === BUTTON HOVER SOLID === */
.btn-solid-hover {
  transition: background-color 0.3s ease, transform 0.2s ease;
}
.btn-solid-hover:active {
  transform: scale(0.98);
}

/* === STATS CARD === */
.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #88a360, transparent);
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: #9ca38c; border-radius: 3px; }
html.dark ::-webkit-scrollbar-thumb { background: #3e4634; }
::-webkit-scrollbar-thumb:hover { background: #6b8543; }

/* === FORM INPUTS (Dashboard) === */
input, select, textarea {
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
}
input::placeholder, textarea::placeholder {
  color: var(--text-secondary);
}

/* === TABLE CELL TEXT === */
td, th {
  color: var(--text-primary);
}

/* === NAVBAR FORCE WHITE (always dark bg) === */
nav.sticky a,
nav.sticky span,
nav.sticky button {
  /* Navbar always has dark bg, keep white text */
}

/* === BENTO GRID PRIORITY === */
@media (min-width: 1024px) {
  #dashboard .glass-panel:nth-child(4) {
    grid-column: span 2;
    background: linear-gradient(135deg, var(--glass-bg), rgba(239, 68, 68, 0.05));
  }
}

/* === MAGNETIC HOVER SIMULATION === */
.magnetic-hover {
  transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}
.magnetic-hover:hover {
  transform: scale(1.02) translateY(-2px);
}

/* === LIGHT MODE OVERRIDES === */
html:not(.dark) body::before {
  opacity: 0.01;
}
html:not(.dark) .scanline {
  background: rgba(107, 133, 67, 0.02);
}

/* === LOGO VISIBILITY FIX (Light Mode) === */
/* Creates a tactical outline to make white text visible while keeping "M" yellow */
html:not(.dark) img[src*="cemara.png"] {
  filter: 
    drop-shadow(1px 0 0 rgba(0,0,0,0.8)) 
    drop-shadow(-1px 0 0 rgba(0,0,0,0.8)) 
    drop-shadow(0 1px 0 rgba(0,0,0,0.8)) 
    drop-shadow(0 -1px 0 rgba(0,0,0,0.8))
    drop-shadow(0 4px 10px rgba(107,133,67,0.2));
}
/* Tambahkan di style.css */

/* Navbar height variable */
:root {
  --navbar-height: 70px;
}

@media (max-width: 768px) {
  :root {
    --navbar-height: 60px;
  }
}

/* Hero section adjustment */
.hero-section {
  min-height: 100vh;
  padding-top: var(--navbar-height);
}

/* Atau langsung ke hero content */
@media (max-width: 640px) {
  .hero-content {
    margin-top: 2rem;
  }
  
  .hero-logo {
    width: 80px !important;
    height: 80px !important;
    margin-bottom: 1rem !important;
  }
  
  .hero-title {
    font-size: 2rem !important;
  }
  
  .hero-subtitle {
    font-size: 1rem !important;
  }
}
[data-i18n] {
  transition: opacity 0.2s ease;
}

body.lang-switching [data-i18n] {
  opacity: 0;
}
