/* ======================================================
   🌐 GLOBAL STYLE
====================================================== */
body {
  background-color: #f9f9f9;
  font-family: 'Segoe UI', sans-serif;
  color: #212529;
  scroll-behavior: smooth;
}

/* ===== Navbar ===== */
.navbar {
  transition: background-color 0.3s ease;
}
.navbar-brand {
  font-size: 1.3rem;
}
.navbar-nav .nav-link {
  font-weight: 500;
  margin-left: 10px;
  transition: color 0.3s ease;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #0d6efd !important;
  font-weight: 600;
}

/* Jarak agar konten tidak tertutup navbar */
body > div:first-of-type {
  margin-top: 30px;
}

/* ===== Sidebar ===== */
.sidebar .nav-link {
  transition: 0.3s;
}
.sidebar .nav-link:hover {
  background-color: #495057;
  border-radius: 5px;
}

/* ===== Heading ===== */
h2.text-center {
  color: #007bff;
  font-weight: 700;
}

/* ======================================================
   🧱 CARD STYLE
====================================================== */
.card {
  border-radius: 12px;
  overflow: hidden;
  border: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}
.card-header {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}
.card-header i {
  margin-right: 8px;
}
.card-header .badge {
  font-size: 0.8rem;
  padding: 5px 8px;
  border-radius: 6px;
}

@media (max-width: 768px) {
  .card-header {
    flex-direction: column;
    text-align: center;
  }
  .card-header .badge {
    margin-top: 5px;
  }
}

/* ======================================================
   📅 AGENDA BOX & BADGES
====================================================== */
.agenda-box {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 15px;
  transition: all 0.2s ease-in-out;
}
.agenda-box:hover {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
  transform: translateY(-3px);
}
.agenda-title {
  font-weight: 600;
  color: #0d6efd;
  text-decoration: none;
  transition: 0.2s;
}
.agenda-title:hover {
  color: #0b5ed7 !important;
  text-decoration: underline !important;
}

.badge {
  padding: 6px 10px;
  font-size: 0.9rem;
  border-radius: 5px;
  margin-bottom: 5px;
}
.bg-success-subtle { background-color: #d1e7dd !important; }
.bg-danger-subtle { background-color: #f8d7da !important; }
.bg-primary-subtle { background-color: #cfe2ff !important; }

/* ======================================================
   🔘 NAVIGASI & CETAK KALENDER
====================================================== */
#btnWeek, #btnMonth, #btnPrint {
  border-radius: 8px;
  transition: all 0.25s ease;
}
#btnWeek:hover {
  background-color: #0d6efd;
  color: #fff;
  transform: translateY(-2px);
}
#btnMonth:hover {
  background-color: #198754;
  color: #fff;
  transform: translateY(-2px);
}
#btnPrint:hover {
  background-color: #dc3545;
  color: #fff;
  transform: translateY(-2px);
}

/* Saat cetak, sembunyikan elemen non-kalender */
@media print {
  #btnWeek, #btnMonth, #btnPrint,
  .hero-section, .navbar, .footer {
    display: none !important;
  }
  #calendar {
    box-shadow: none !important;
    border: none !important;
  }
}

/* ======================================================
   🗓️ KALENDER FULLCALENDAR
====================================================== */
#calendar {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  padding: 20px;
}
.fc-toolbar-title {
  font-weight: 700;
  color: #212529;
}
.fc-button {
  border-radius: 6px !important;
  font-weight: 500 !important;
}
.fc-event {
  color: #fff !important;
  border: none !important;
  font-size: 0.9rem;
  padding: 3px 5px;
  border-radius: 6px !important;
}
.fc-event:hover {
  opacity: 0.9;
  transform: scale(1.03);
  transition: all 0.2s ease;
}
.fc-day-today {
  background-color: rgba(13, 110, 253, 0.08) !important;
}
.fc-list-event-title {
  font-weight: 600;
}

/* ===== Animasi Fade-In Kalender ===== */
#calendar {
  opacity: 0;
  transform: translateY(15px);
  animation: fadeInCalendar 0.8s ease-out forwards;
}

@keyframes fadeInCalendar {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ======================================================
   🪟 MODAL & PDF PREVIEW
====================================================== */
#modalFile a {
  display: inline-block;
  min-width: 160px;
  text-align: left;
}
#previewSection { margin-top: 10px; }
#pdfPreview, #pdfViewer {
  background-color: #f8f9fa;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #ccc;
  border-radius: 6px;
}
.modal-content {
  border-radius: 12px;
}
.modal-body table th {
  background-color: #f8f9fa;
  width: 25%;
}

/* ======================================================
   📱 RESPONSIVE ADJUSTMENTS
====================================================== */
@media (max-width: 992px) {
  .hero-section img { width: 70px; }
  .hero-section h2 { font-size: 1.4rem; }
  .hero-section p { font-size: 0.95rem; }

  #calendar { padding: 10px; }

  .fc-toolbar.fc-header-toolbar {
    flex-wrap: wrap !important;
    gap: 6px;
    justify-content: center !important;
  }
  .fc-toolbar-chunk {
    text-align: center !important;
    width: 100%;
  }
  .fc-toolbar-title {
    font-size: 1.1rem;
    text-align: center;
  }
  #btnWeek, #btnMonth, #btnPrint {
    font-size: 0.85rem;
    padding: 6px 10px;
  }
}

@media (max-width: 576px) {
  .fc-event {
    font-size: 0.8rem;
    line-height: 1.2;
    white-space: normal !important;
  }
  .d-flex.justify-content-center.gap-2 {
    flex-direction: column !important;
    align-items: center !important;
  }
  #btnWeek, #btnMonth, #btnPrint {
    width: 80%;
  }
  #agendaModal table th,
  #agendaModal table td {
    font-size: 0.9rem;
    word-break: break-word;
  }
  #pdfViewer { height: 300px; }
}

/* ======== FIX: Event Judul Tidak Terlihat di Mobile (List View) ======== */
.fc-list-event-title,
.fc-list-event-time,
.fc-list-event-dot {
  overflow: visible !important;
  white-space: normal !important;
  text-overflow: unset !important;
}

/* Tampilan list event di mobile jadi lebih rapi */
.fc-list-event {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 10px 8px !important;
  border-bottom: 1px solid #eee;
}

.fc-list-event:hover {
  background-color: rgba(13, 110, 253, 0.08) !important;
  transition: background-color 0.3s ease;
}

.fc-list-event-title {
  flex: 1 1 100%;
  font-weight: 600;
  color: #0d6efd !important;
  font-size: 0.95rem;
}

.fc-list-event-time {
  flex: 1 1 100%;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 3px;
}

/* Hilangkan dot abu-abu kecil di kiri, diganti bullet biru */
.fc-list-event-dot {
  width: 8px !important;
  height: 8px !important;
  background: #0d6efd !important;
  margin-top: 6px;
  margin-right: 6px;
  border-radius: 50%;
}

/* Perbaiki padding container daftar event */
.fc-list-table {
  border-radius: 10px;
  overflow: hidden;
}

/* Judul bulan dan hari terlihat lebih jelas */
.fc-list-day-cushion {
  background-color: #f8f9fa !important;
  font-weight: 600;
  color: #212529 !important;
  padding: 8px 10px !important;
  border-top: 1px solid #eaeaea;
}

/* Judul hari di list view tetap terbaca */
.fc-list-day-text {
  font-size: 0.9rem;
  color: #0d6efd !important;
}

/* ======================== RESPONSIVE FIX ========================= */
@media (max-width: 576px) {
  /* Perbesar teks supaya mudah dibaca di HP */
  .fc-list-event-title {
    font-size: 1rem;
    line-height: 1.3;
  }
  .fc-list-event-time {
    font-size: 0.9rem;
  }
  .fc-list-event-dot {
    width: 10px !important;
    height: 10px !important;
  }
}

/* ====== HILANGKAN LABEL "ALL-DAY" DI LIST VIEW ====== */
.fc-list-event-time,
.fc-list-event-dot + .fc-list-event-time {
  display: none !important;
}

/* Supaya layout tetap rapi setelah "All-day" disembunyikan */
.fc-list-event-title {
  margin-left: 0 !important;
}
