@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body { font-family: 'Inter', sans-serif; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Card */
.content-card { 
  background: #fff; border-radius: 16px; 
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03); 
  border: 1px solid #f1f5f9; transition: all 0.3s ease; 
}
.content-card:hover { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04); }

/* =========================================
   BUTTON STYLES (DASAR)
   ========================================= */
.btn, .delete-btn, #login-form button[type="submit"] { 
  padding: 0.5rem 1rem; border-radius: 8px; font-weight: 500; font-size: 13px;
  cursor: pointer; transition: all 0.3s ease; border: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  position: relative; overflow: hidden; z-index: 1; /* Wajib untuk Liquid */
}

.btn:active, .delete-btn:active, #login-form button[type="submit"]:active { 
  transform: scale(0.95); 
}

.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2); }
.btn-info { background: #4f46e5; color: #fff; }
.btn-info:hover { background: #4338ca; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2); }
.delete-btn { background: #ef4444; color: #fff; padding: 6px 12px; border-radius: 6px; font-size: 12px; }
.delete-btn:hover { background: #dc2626; box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3); }

/* =========================================
   LIQUID DOUBLE WAVE EFFECT (TOMBOL & MENU NAV)
   ========================================= */
/* Lapisan Air Pertama */
.btn::before, .delete-btn::before, #login-form button[type="submit"]::before,
.sidebar-item::before, #magic-indicator::before {
  content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  width: max(200%, 150px); aspect-ratio: 1 / 1; border-radius: 40%;
  transition: top 0.6s cubic-bezier(0.4, 0, 0.2, 1); z-index: -1; pointer-events: none;
}

/* Lapisan Air Kedua */
.btn::after, .delete-btn::after, #login-form button[type="submit"]::after,
.sidebar-item::after, #magic-indicator::after {
  content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  width: max(200%, 150px); aspect-ratio: 1 / 1; border-radius: 45%;
  transition: top 0.6s cubic-bezier(0.4, 0, 0.2, 1); z-index: -1; animation-delay: 0.2s; pointer-events: none;
}

/* 1. Warna Ombak (Untuk Tombol Utama) */
.btn::before, .delete-btn::before, #login-form button[type="submit"]::before { background: rgba(255, 255, 255, 0.15); }
.btn::after, .delete-btn::after, #login-form button[type="submit"]::after { background: rgba(255, 255, 255, 0.25); }
.btn.bg-slate-200::before { background: rgba(0, 0, 0, 0.05); } /* Tombol Batal/Terang */
.btn.bg-slate-200::after { background: rgba(0, 0, 0, 0.1); }

/* 2. Warna Ombak (Menu Nav Saat di-Hover) */
.sidebar-item::before { background: rgba(99, 102, 241, 0.05); }
.sidebar-item::after { background: rgba(99, 102, 241, 0.1); }

/* 3. Warna Ombak (Khusus Magic Indicator yang Sedang Aktif - Selalu Berombak) */
#magic-indicator::before { background: rgba(129, 140, 248, 0.15); top: -30%; animation: liquid-wave 4s linear infinite; }
#magic-indicator::after { background: rgba(129, 140, 248, 0.25); top: -30%; animation: liquid-wave 4s linear infinite; animation-delay: 0.2s; }

/* Pemicu Animasi Air Naik (Untuk Tombol & Menu Biasa) */
.btn:hover::before, .delete-btn:hover::before, #login-form button[type="submit"]:hover::before,
.btn:hover::after, .delete-btn:hover::after, #login-form button[type="submit"]:hover::after,
.sidebar-item:hover::before, .sidebar-item:hover::after {
  top: -30%;
  animation: liquid-wave 3s linear infinite;
}

@keyframes liquid-wave {
  0% { transform: translateX(-50%) rotate(0deg); }
  100% { transform: translateX(-50%) rotate(360deg); }
}

/* =========================================
   MAGIC NAVIGATION INDICATOR STYLE
   ========================================= */
#main-nav { position: relative; }
#magic-indicator {
  position: absolute; left: 12px; right: 12px;
  background: rgba(99, 102, 241, 0.15); border-left: 4px solid #6366f1; border-radius: 0 8px 8px 0;
  transition: top 0.4s cubic-bezier(0.68, -0.55, 0.26, 1.55), height 0.3s ease;
  z-index: 0; pointer-events: none;
  overflow: hidden; /* Agar efek liquid tidak bocor dari indikator */
}
.sidebar-item { 
  position: relative; z-index: 10; background: transparent !important; 
  overflow: hidden; /* Agar liquid hover tidak bocor dari menu */
  transition: all 0.2s ease-in-out; 
}
.sidebar-item:hover { transform: none; }
.sidebar-item.active i { color: #818cf8 !important; }
.sidebar-item.active span { color: #c7d2fe !important; font-weight: 600 !important; }

/* =========================================
   ANIMASI FISIKA LAMPU TIDUR (PENDULUM)
   ========================================= */
.origin-top { transform-origin: top center; }
.animate-gentle-swing { animation: gentleSwing 6s ease-in-out infinite; }
.animate-hard-swing { animation: hardSwing 1.5s cubic-bezier(0.28, 0.84, 0.42, 1) forwards; }

@keyframes gentleSwing {
  0% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
  100% { transform: rotate(-3deg); }
}

@keyframes hardSwing {
  0% { transform: rotate(0deg); }
  15% { transform: rotate(15deg); }
  35% { transform: rotate(-10deg); }
  55% { transform: rotate(6deg); }
  75% { transform: rotate(-3deg); }
  100% { transform: rotate(0deg); }
}

/* =========================================
   LAIN-LAIN (MODAL, BADGE, PRINT)
   ========================================= */
.modal { 
  display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; 
  background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(4px); animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content { 
  background: #fff; margin: 5% auto; padding: 24px; border-radius: 16px; width: 90%; max-width: 500px; 
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.close { float: right; font-size: 24px; cursor: pointer; color: #94a3b8; line-height: 1; transition: color 0.2s; }
.close:hover { color: #0f172a; }

.semester-badge { 
  background: linear-gradient(135deg, #f59e0b, #d97706); color: white; padding: 5px 16px; 
  border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap;
}

input[type="text"], input[type="number"], input[type="password"], select, textarea { font-family: 'Inter', sans-serif; font-size: 14px; }
label { font-size: 13px; font-weight: 500; color: #475569; display: block; margin-bottom: 6px; }

@media print {
  body { font-family: "Times New Roman", serif !important; font-size: 11pt !important; margin: 0 !important; padding: 0 !important; line-height: 1.2 !important; background: none !important; }
  .sidebar-item, #sidebar, header, .btn, .semester-badge, .modal, .content-card:hover { display: none !important; }
  .content-card { box-shadow: none !important; transform: none !important; border-radius: 0 !important; border: none !important;}
  #main-content { margin-left: 0 !important; padding: 0 !important; }
  @page { size: A4; margin: 15mm; }
  .rapor-preview-style { font-family: "Times New Roman", serif; font-size: 11pt; color: #000; line-height: 1.2; }
  .rapor-preview-style .container { max-width: 210mm; margin: auto; padding: 5mm; box-sizing: border-box; }
  .rapor-preview-style h2 { text-align: center; font-weight: bold; text-transform: uppercase; margin-bottom: 10px; font-size: 14pt; }
  .rapor-preview-style .info { display: grid; grid-template-columns: 100px auto 80px auto; row-gap: 3px; margin-bottom: 10px; font-size: 10pt; }
  .rapor-preview-style .info div { display: contents; }
  .rapor-preview-style table { border-collapse: collapse; width: 100%; margin-bottom: 8px; }
  .rapor-preview-style th, .rapor-preview-style td { border: 1px solid #000; padding: 4px; text-align: center; font-size: 10pt; color: #000;}
  .rapor-preview-style th { background-color: #f2f2f2; font-weight: bold; }
  .rapor-preview-style td:first-child { text-align: center; width: 5%; }
  .rapor-preview-style td:nth-child(2) { text-align: left; width: 35%; }
  .rapor-preview-style td:nth-child(3) { text-align: center; width: 10%; }
  .rapor-preview-style td:nth-child(4) { text-align: left; vertical-align: top; width: 50%; }
  .rapor-preview-style .section-title { font-weight: bold; margin-top: 8px; margin-bottom: 3px; font-size: 11pt; color: #000; }
  .rapor-preview-style .kotak { border: 1px solid #000; min-height: 40px; margin-bottom: 8px; padding: 3px; vertical-align: top; font-size: 10pt; color: #000; }
  .rapor-preview-style .half-container { display: flex; justify-content: space-between; gap: 8px; }
  .rapor-preview-style .half { flex: 1; }
  .rapor-preview-style .half table { width: 100%; }
  .rapor-preview-style .tanggapan { border: 1px solid #000; margin-top: 5px; padding: 3px; text-align: center; font-weight: bold; font-size: 10pt; color: #000; }
  .rapor-preview-style .kotak-tanggapan { border: 1px solid #000; height: 50px; margin-bottom: 15px; }
  .rapor-preview-style .ttd { width: 100%; margin-top: 8px; text-align: center; border: none; }
  .rapor-preview-style .ttd td { width: 33.33%; vertical-align: top; border: none; font-size: 10pt; }
  .rapor-preview-style .space-ttd { height: 40px; }
  .rapor-preview-style .nama { text-decoration: underline; font-weight: bold; margin-top: 0; font-size: 10pt; }
  .rapor-preview-style .nip { font-size: 9pt; }
  .rapor-preview-style tr { page-break-inside: avoid; }
  .rapor-preview-style thead { display: table-header-group; }
  .rapor-preview-style tfoot { display: table-footer-group; }
}