/* ============================================================
   PORTAL SISTEM INFORMASI PRAMUKA SMP
   Main Stylesheet - Pramuka Theme (Hijau Tua + Emas + Cokelat)
   ============================================================ */

:root {
  --primary: #1b4d3e;
  --secondary: #d4af37;
  --accent: #8b4513;
  --bg-light: #f9f7f3;
  --text-dark: #2c2c2c;
  --shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* ============================================================
   BASE & HARDWARE ACCELERATION (Mencegah Flicker / Kedap-kedip)
   ============================================================ */
html { 
  scroll-behavior: smooth; 
}

body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-dark);
  background: var(--bg-light);
  overflow-x: hidden;
  /* Mencegah pergeseran tata letak browser */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { 
  color: var(--primary); 
  text-decoration: none; 
}

a:hover { 
  color: var(--accent); 
}

/* Mencegah kedipan pada elemen bermuatan animasi / transisi */
.fade-in-up,
.news-card,
.event-card,
.prestasi-card,
.gallery-item,
.gallery-item img,
.btn {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* ============================================================
   RUNNING TEXT BAR & MARQUEE ANIMATION
   ============================================================ */
.running-text-bar {
  display: flex;
  align-items: center;
  overflow: hidden;
  font-size: 0.83rem;
  font-weight: 500;
  height: 32px;
  position: relative;
  contain: layout paint;
}

.rt-label {
  white-space: nowrap;
  padding: 0 14px;
  background: rgba(0,0,0,0.25);
  height: 100%;
  display: flex;
  align-items: center;
  font-weight: 700;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  z-index: 2;
}

.rt-wrapper {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}

.rt-track {
  display: inline-block;
  white-space: nowrap;
  animation: marquee-scroll 25s linear infinite;
  will-change: transform;
}

.rt-track:hover {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ============================================================
   TOPBAR & NAVBAR
   ============================================================ */
.topbar { 
  font-size: 0.78rem; 
}

.navbar {
  will-change: transform;
}

.navbar-brand img {
  object-fit: contain;
  display: block;
}

.navbar-nav .nav-link {
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  padding: 0.6rem 0.5rem !important;
  transition: color 0.2s ease-in-out;
  border-bottom: 2px solid transparent;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--secondary) !important;
  border-bottom-color: var(--secondary);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
  position: relative;
  min-height: 480px;
  background: linear-gradient(135deg, var(--primary) 60%, var(--accent) 100%);
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../img/hero-pattern.svg') center/cover;
  opacity: 0.06;
  pointer-events: none;
}

.hero-section .hero-logo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.3));
}

.hero-title {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.hero-subtitle {
  color: var(--secondary);
  font-weight: 600;
  font-size: 1.05rem;
}

.hero-motto {
  font-style: italic;
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
}

/* ============================================================
   STAT COUNTER SECTION
   ============================================================ */
.stat-section { 
  background: #fff; 
  border-bottom: 3px solid var(--secondary); 
}

.stat-card {
  text-align: center;
  padding: 1.5rem 1rem;
}

.stat-card .stat-number {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-card .stat-label {
  font-size: 0.82rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.3rem;
}

.stat-card .stat-icon {
  font-size: 1.8rem;
  color: var(--secondary);
  margin-bottom: 0.4rem;
}

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  position: relative;
  padding-bottom: 0.5rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 50px; height: 3px;
  background: var(--secondary);
  border-radius: 2px;
}

.section-title.centered::after { 
  left: 50%; 
  transform: translateX(-50%); 
}

/* ============================================================
   CARDS & HOVER ANIMATION (Mulus tanpa flicker)
   ============================================================ */
.news-card, .event-card, .prestasi-card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.08);
  transition: transform 0.25s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
  overflow: hidden;
  will-change: transform, box-shadow;
}

.news-card:hover, .event-card:hover, .prestasi-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.15);
}

.news-card img { 
  height: 180px; 
  object-fit: cover; 
}

.event-card .card-date {
  background: var(--primary);
  color: #fff;
  text-align: center;
  padding: 0.8rem;
  min-width: 60px;
  border-radius: 8px;
}

.event-card .card-date .day { 
  font-size: 1.6rem; 
  font-weight: 900; 
  line-height: 1; 
}

.event-card .card-date .month { 
  font-size: 0.72rem; 
  text-transform: uppercase; 
}

/* ============================================================
   BADGE / STATUS
   ============================================================ */
.badge-status-akan { background: #17a2b8; }
.badge-status-sedang { background: #28a745; }
.badge-status-selesai { background: #6c757d; }
.badge-status-dibatalkan { background: #dc3545; }

/* ============================================================
   GALLERY (Optimized smooth zoom)
   ============================================================ */
.gallery-item {
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  display: block;
  isolation: isolate;
}

.gallery-item img {
  width: 100%; 
  height: 200px;
  object-fit: cover;
  transition: transform 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: block;
  will-change: transform;
}

.gallery-item:hover img { 
  transform: scale(1.07); 
}

.gallery-overlay {
  position: absolute; 
  inset: 0;
  background: rgba(27,77,62,0.7);
  opacity: 0;
  display: flex; 
  align-items: center; 
  justify-content: center;
  color: #fff; 
  font-size: 2rem;
  transition: opacity 0.3s ease-in-out;
  border-radius: 10px;
}

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

/* ============================================================
   AYOPRAMUKA CARD
   ============================================================ */
.ayopramuka-card {
  border: 2px solid var(--secondary);
  border-radius: 14px;
  background: linear-gradient(135deg, #fffde7 0%, #fff8e1 100%);
  box-shadow: 0 4px 20px rgba(212,175,55,0.15);
}

.ayopramuka-card .card-title { 
  color: var(--primary); 
  font-weight: 800; 
}

/* ============================================================
   UTILITIES & BUTTONS
   ============================================================ */
.text-primary-pramuka { color: var(--primary) !important; }
.text-secondary-pramuka { color: var(--secondary) !important; }
.bg-primary-pramuka { background-color: var(--primary) !important; }
.bg-secondary-pramuka { background-color: var(--secondary) !important; }
.border-primary-pramuka { border-color: var(--primary) !important; }

.btn-pramuka {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
  will-change: transform;
}

.btn-pramuka:hover { 
  background: #0d2b22; 
  color: #fff; 
  transform: translateY(-1px); 
}

.btn-pramuka-gold {
  background: var(--secondary);
  color: #1a1a1a;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  transition: background 0.2s;
}

.btn-pramuka-gold:hover { 
  background: #c49a2e; 
  color: #1a1a1a; 
}

.rounded-xl { border-radius: 14px !important; }
.shadow-soft { box-shadow: 0 4px 20px rgba(0,0,0,0.09) !important; }

.empty-state { text-align: center; padding: 3rem 1rem; color: #aaa; }
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 1rem; opacity: 0.5; }

/* Search form */
.search-form .input-group .form-control {
  border-right: 0;
  border-radius: 8px 0 0 8px;
}
.search-form .input-group .btn {
  border-radius: 0 8px 8px 0;
}

/* Breadcrumb */
.breadcrumb-bar {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
  padding: 0.6rem 0;
  font-size: 0.85rem;
}

/* Site footer */
.site-footer { color: #fff; }

/* Admin stat cards */
.stat-card-admin {
  border-left: 4px solid #1b4d3e;
  border-radius: 8px;
  transition: transform 0.15s;
}
.stat-card-admin:hover { transform: translateY(-2px); }

/* Activity log items */
.activity-item {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 6px;
  margin-bottom: 6px;
}
.activity-item .act-time { font-size: 0.7rem; color: #aaa; }

/* fw-mono */
.fw-mono { font-family: 'Courier New', Courier, monospace; }