/* ==================================================
   INDEX.CSS - FULL STYLE FOR SPA WEBAPP LPPK
   CARD SYSTEM VERSION (LOGIN + REGISTER)
   ================================================== */

/* ===============================
   GLOBAL RESET & BASE
================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  background: #f1f5f9;
  color: #1e293b;
}

/* ===============================
   LOGIN FULL SCREEN
================================ */
#login-container {
  width: 100%;
  height: 100vh;
}

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(120deg, #0f172a, #1e293b);
}

/* ===============================
   CARD BASE SYSTEM
================================ */
.card {
  background: #ffffff;
  padding: 40px;
  border-radius: 22px;
  width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  animation: cardFadeIn 0.5s ease;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===============================
   LOGIN CARD
================================ */
.login-card h2 {
  font-size: 26px;
  margin-bottom: 6px;
  color: #0f172a;
}

.login-subtitle {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 22px;
}

.login-links {
  margin-top: 18px;
  text-align: center;
}

.login-links a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

/* ===============================
   REGISTER CARD
================================ */
.register-card h3 {
  font-size: 22px;
  margin-bottom: 20px;
  color: #0f172a;
}

.register-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin-bottom: 20px;
}

.register-grid input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  width: 100%;
  font-size: 14px;
}

.register-grid input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

.register-grid .full {
  grid-column: span 2;
}

/* ===============================
   FORM ELEMENTS
================================ */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: #334155;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  outline: none;
}

.form-group input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
}

/* ===============================
   BUTTONS
================================ */
.btn-primary-full {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  border-radius: 14px;
  color: white;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  margin-top: 10px;
}

.btn-primary-full:hover {
  opacity: 0.95;
}

.btn-primary {
  background: #0ea5e9;
  border: none;
  color: white;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-danger {
  background: #dc2626;
  color: white;
}

/* ===============================
   MODAL BACKDROP
================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

/* ===============================
   APP LAYOUT
================================ */
.app-container {
  display: flex;
  height: 100vh;
  width: 100%;
}

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #0f172a, #1e293b);
  color: #fff;
  padding: 20px;
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.content {
  padding: 25px;
  background: #f8fafc;
  flex: 1;
  overflow-y: auto;
}

/* ===============================
   SIDEBAR STYLE
================================ */
.sidebar h3 {
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: bold;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  padding: 12px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.sidebar li:hover {
  background: rgba(255,255,255,0.1);
}

/* ===============================
   HEADER
================================ */
#header {
  background: white;
  padding: 15px 25px;
  border-bottom: 1px solid #e2e8f0;
  font-weight: bold;
}

/* ===============================
   TABLE STYLE
================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.table th, .table td {
  padding: 12px 15px;
  border-bottom: 1px solid #e5e7eb;
}

.table th {
  background: #f1f5f9;
  text-align: left;
}

/* ===============================
   RESPONSIVE
================================ */
@media(max-width:700px){
  .card {
    width: 92%;
  }

  .register-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: 200px;
  }
}

.modal-box {
  background: #ffffff;
  padding: 30px;
  border-radius: 16px;
  width: 500px; /* Lebih lebar untuk register */
  max-width: 90%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  animation: cardFadeIn 0.3s ease;
  position: relative;
}

/* Biar tombol close/batal ada jaraknya */
.btn-secondary {
  background: #cbd5e1;
  color: #334155;
  margin-top: 10px;
}
.btn-secondary:hover {
  background: #94a3b8;
}

/* UTILITY: Sembunyikan elemen */
.hidden {
  display: none !important;
}

/* ANIMASI MASUK (Sudah ada, tapi kita pastikan rapi) */
.fade-in {
  animation: cardFadeIn 0.5s ease forwards;
}

/* ANIMASI KELUAR (Baru) */
.fade-out {
  animation: cardFadeOut 0.4s ease forwards;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(0px) scale(1.0); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardFadeOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(0px) scale(1.0); }
}

/* KHUSUS REGISTER CARD AGAR SEJAJAR DENGAN LOGIN */
.register-card-wrapper {
  /* Kita buat wrapper biar stylingnya sama persis kayak login card */
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* ===============================
   MODAL BOX ANIMASI (TAMBAHAN PENTING)
================================ */
/* Pastikan ini ada di index.css Anda */
.modal-content-box {
    /* Style dasar dari list.html div konten */
    background: #ffffff;
    padding: 25px;
    border-radius: 10px;
    width: 420px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    /* Penting: Set opacity awal untuk animasi */
    opacity: 1; 
    transform: translateY(0) scale(1);
    transition: opacity 0.4s ease, transform 0.4s ease; /* Tambahkan transisi CSS */
}

/* Ganti penggunaan keyframes dengan transisi (lebih sederhana dan andal untuk fade/scale) */
/* Jika Anda tetap ingin menggunakan keyframes, pastikan class .fade-in dan .fade-out didefinisikan untuk .modal-content-box */

/* Menggunakan keyframes yang Anda definisikan: */
.modal-content-box.fade-in {
    animation: cardFadeIn 0.5s ease forwards;
}

.modal-content-box.fade-out {
    animation: cardFadeOut 0.4s ease forwards;
}

/* Pastikan keyframes ini ada: */
/* @keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardFadeOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-20px) scale(0.95); }
} */


/* ===============================
   SIDEBAR STYLE (Revisi untuk Menu JS)
================================ */
.sidebar h3 {
  margin-bottom: 25px;
  font-size: 20px;
  font-weight: 700;
  color: white; 
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.sidebar ul {
  list-style: none;
  padding: 0; /* Pastikan padding list hilang */
}

/* Style untuk LI yang baru dibuat JS */
.sidebar-menu-item {
  padding: 14px 15px; /* Padding yang elegan */
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-weight: 500;
  font-size: 16px;
  color: #cbd5e1; /* Warna non-aktif */
  display: flex;
  align-items: center;
  gap: 12px; /* Jarak antara ikon dan label */
  /* Hapus glow/hover effect bawaan CSS lama di sini jika ada */
}

/* Style untuk Item Aktif */
.sidebar-menu-item.active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 600;
}

/* Style untuk Hover (Non-aktif dan Aktif) */
.sidebar-menu-item:hover {
  background: rgba(255, 255, 255, 0.1); /* Hover lebih transparan */
  color: #fff;
}

/* Style untuk Ikon */
.sidebar-menu-item i {
  font-size: 1.1em; /* Ikon sedikit lebih besar */
  /* Agar ikon Bootstrap Icons terlihat flat dan tegas */
  width: 20px; 
  text-align: center;
}

/* Sidebar button logout */
#btnLogout {
  /* Tambahkan style yang konsisten dengan theme */
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  background: #dc2626; /* Warna merah tegas */
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

#btnLogout:hover {
  background: #b91c1c;
}