/* =====================================================
   OSDA Dashboard - Custom Animations CSS
   Dipindahkan dari React single-file ke file terpisah
   ===================================================== */

/* ---- Base ---- */
body {
  margin: 0;
  padding: 0;
  background-color: #f8fafc;
  font-family: 'Inter', sans-serif;
}

/* ---- Fade In ---- */
.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---- Slide Up ---- */
.animate-slide-up {
  animation: slideUp 0.5s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

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

/* ---- Animation Delays ---- */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }

/* ---- Pop Zoom In ---- */
@keyframes popZoomIn {
  0%   { opacity: 0; transform: scale(0.3); }
  60%  { opacity: 1; transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1);   }
}
.animate-pop-zoom {
  animation: popZoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ---- Logo Pulse ---- */
@keyframes logo-pulse {
  0%   { transform: scale(1);    filter: drop-shadow(0 0 0 rgba(255,255,255,0.4)); }
  50%  { transform: scale(1.08); filter: drop-shadow(0 0 20px rgba(255,255,255,0.4)); }
  100% { transform: scale(1);    filter: drop-shadow(0 0 0 rgba(255,255,255,0.4)); }
}
.animate-logo-pulse {
  animation: logo-pulse 3s infinite ease-in-out;
}

/* ---- Bell Zoom Shake ---- */
@keyframes zoomShake {
  0%,80%  { transform: scale(1) rotate(0deg); }
  82%     { transform: scale(1.25) rotate(15deg); }
  84%     { transform: scale(1.25) rotate(-15deg); }
  86%     { transform: scale(1.25) rotate(15deg); }
  88%     { transform: scale(1.25) rotate(-15deg); }
  90%     { transform: scale(1.25) rotate(15deg); }
  92%     { transform: scale(1.25) rotate(-15deg); }
  94%,100%{ transform: scale(1) rotate(0deg); }
}
.animate-zoom-shake {
  animation: zoomShake 4s 2s infinite cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* ---- Smooth Welcome Card (Hijau Tua) ---- */
.smooth-welcome-card {
  background: linear-gradient(135deg, #0b3b2c 0%, #177557 100%);
  box-shadow:
    0 20px 40px -10px rgba(11, 59, 44, 0.4),
    inset 0 2px 5px rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---- 3D Smooth Data Cards (Putih) ---- */
.smooth-card {
  background: #ffffff;
  box-shadow:
    0 10px 30px -10px rgba(0, 0, 0, 0.06),
    inset 0 2px 4px rgba(255, 255, 255, 1);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-bottom: 4px solid #e2e8f0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.smooth-card:hover {
  transform: translateY(-6px);
  border-bottom: 4px solid #125e46;
  box-shadow:
    0 20px 40px -15px rgba(18, 94, 70, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 1);
}

/* ---- Dalil Card Style ---- */
.dalil-card {
  background: linear-gradient(135deg, #0f172a 0%, #064e3b 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.3);
}

.smooth-shadow {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

/* ---- Custom Scrollbar ---- */
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(18, 94, 70, 0.3);
  border-radius: 20px;
}
.custom-scrollbar:hover::-webkit-scrollbar-thumb {
  background: rgba(18, 94, 70, 0.6);
}

/* ---- Running Text / Marquee ---- */
.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}
.marquee-content {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 45s linear infinite;
  will-change: transform;
  line-height: 1.5;
}
.marquee-content:hover {
  animation-play-state: paused;
}
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ---- Modal Overlay ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}
.modal-box {
  background: white;
  border-radius: 1.5rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: popZoomIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* ---- Progress Bar Animation ---- */
.progress-fill {
  transition: width 1s ease-in-out;
}

/* ---- Toast Notification ---- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  animation: slideUp 0.4s ease-out forwards;
}

/* ---- Table Row Hover ---- */
.table-row-hover:hover {
  background-color: rgba(236, 253, 245, 0.3);
  transition: background-color 0.15s ease;
}

/* ---- Badge Status ---- */
.badge-hadir  { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-sakit  { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.badge-izin   { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-alpa   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.badge-aktif  { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

/* ---- Alert Flash ---- */
.alert-success { background: #d1fae5; border-left: 4px solid #10b981; color: #065f46; }
.alert-error   { background: #fee2e2; border-left: 4px solid #ef4444; color: #991b1b; }
.alert-info    { background: #dbeafe; border-left: 4px solid #3b82f6; color: #1e40af; }

/* ---- Sidebar Active Indicator ---- */
.sidebar-item-active {
  background: white;
  color: #0b3b2c;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  transform: scale(1.02);
  font-weight: 700;
}
.sidebar-item {
  color: rgba(209, 250, 229, 0.8);
  transition: all 0.3s ease-out;
}
.sidebar-item:hover {
  background: rgba(255,255,255,0.1);
  color: white;
  transform: translateY(-2px);
}

/* ---- Responsive Sidebar ---- */
@media (max-width: 1024px) {
  .sidebar-mobile {
    position: fixed;
    left: -100%;
    top: 0;
    z-index: 500;
    height: 100vh;
    transition: left 0.3s ease;
  }
  .sidebar-mobile.open {
    left: 0;
  }
}
