/* history.css - Enhanced UI for Restetion History Page */

/* Base Styles */
body {
  font-family: "Poppins", sans-serif; /* Menggunakan font yang lebih modern */
  background: linear-gradient(
    135deg,
    #e0f2f7 0%,
    #c1e4f4 100%
  ); /* Gradien latar belakang yang lembut */
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: 50px;
  color: #34495e; /* Warna teks dasar yang lebih gelap */
  overflow-x: hidden; /* Mencegah scroll horizontal yang tidak perlu */
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Navbar Enhancements */
.navbar {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); /* Bayangan yang lebih menonjol */
  background: linear-gradient(
    120deg,
    #1abc9c 0%,
    #16a085 100%
  ); /* Warna gradien hijau teal yang menenangkan */
  padding: 0.8rem 1rem;
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 1.8rem;
  transition: transform 0.3s ease-in-out, text-shadow 0.3s ease;
  color: white; /* Pastikan warna brand putih */
}

.navbar-brand:hover {
  transform: scale(1.05);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

.nav-link {
  transition: all 0.3s ease;
  position: relative;
  padding: 0.7rem 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.nav-link:hover {
  transform: translateY(-3px);
  color: white !important;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -5px; /* Sedikit di bawah link */
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px; /* Garis bawah yang lebih tebal */
  background-color: white;
  transition: width 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Animasi meluas yang elastis */
}

.nav-link:hover::after {
  width: 80%; /* Meluas 80% dari lebar link */
}

#navbarProfilePic {
  border: 3px solid rgba(255, 255, 255, 0.8);
  transition: border-color 0.3s ease-in-out, transform 0.3s ease-in-out,
    box-shadow 0.3s ease;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

#navbarProfilePic:hover {
  border-color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

.dropdown-menu {
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  border-radius: 0.75rem;
  overflow: hidden;
  background-color: #f8f9fa; /* Latar belakang dropdown lebih cerah */
}

.dropdown-item {
  padding: 10px 20px;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out,
    transform 0.2s ease;
  color: #34495e;
}

.dropdown-item:hover {
  background-color: #e2e6ea; /* Sedikit lebih gelap dari f8f9fa */
  color: #1abc9c; /* Warna teks sesuai tema */
  transform: translateX(5px); /* Geser sedikit ke kanan */
}

/* Card Styling */
.card {
  border-radius: 18px; /* Lebih bulat */
  border: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1); /* Bayangan yang lebih dalam */
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); /* Transisi lebih halus */
  overflow: hidden;
  margin-bottom: 30px; /* Jarak antar kartu */
}

.card:hover {
  transform: translateY(-15px); /* Angkat lebih tinggi */
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); /* Bayangan lebih intens */
}

.card-header {
  border-radius: 18px 18px 0 0 !important;
  background: linear-gradient(120deg, #1abc9c 0%, #16a085 100%);
  color: white;
  font-weight: 600;
  padding: 1.2rem 1.8rem; /* Padding lebih besar */
  font-size: 1.25rem;
  border-bottom: none;
}

.card-title {
  color: #1abc9c; /* Sesuaikan warna judul kartu */
  font-weight: 700;
  margin-bottom: 0.75rem;
}

/* List Group Styling (for history items) */
.list-group-item {
  border: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding: 18px 25px; /* Padding lebih besar */
  transition: all 0.3s ease-out;
  background-color: white; /* Latar belakang item putih */
  animation: slideInFromLeft 0.6s ease-out forwards; /* Animasi slide in */
  opacity: 0; /* Mulai dari tidak terlihat */
  transform: translateX(-30px); /* Mulai dari kiri */
}

/* Animasi untuk setiap item list, dengan delay */
#myTaskHistoryList .list-group-item:nth-child(1) {
  animation-delay: 0.1s;
}
#myTaskHistoryList .list-group-item:nth-child(2) {
  animation-delay: 0.2s;
}
#myTaskHistoryList .list-group-item:nth-child(3) {
  animation-delay: 0.3s;
}
#myTaskHistoryList .list-group-item:nth-child(4) {
  animation-delay: 0.4s;
}
#myTaskHistoryList .list-group-item:nth-child(5) {
  animation-delay: 0.5s;
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.list-group-item:last-child {
  border-bottom: none;
}

.list-group-item:hover {
  background-color: #f0f8ff; /* Warna hover lebih terang */
  transform: translateX(8px); /* Geser sedikit lebih jauh saat hover */
}

.list-group-item h5 {
  color: #34495e; /* Warna judul item */
  font-weight: 600;
}

.list-group-item small.text-success {
  color: #27ae60 !important; /* Hijau yang lebih cerah untuk poin */
  font-weight: 600;
}

/* Buttons Enhancements */
.btn {
  border-radius: 30px; /* Tombol lebih bulat */
  font-weight: 600;
  padding: 10px 25px; /* Padding lebih besar */
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Animasi "pop" */
  position: relative;
  overflow: hidden;
  z-index: 1; /* Pastikan tombol di atas efek after */
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.15); /* Lapisan putih transparan */
  transform: translateX(-100%) skewX(-30deg); /* Efek kilau diagonal */
  transition: transform 0.5s ease-out;
  z-index: -1; /* Di belakang teks tombol */
}

.btn:hover::after {
  transform: translateX(100%) skewX(-30deg);
}

.btn:hover {
  transform: translateY(-5px); /* Angkat sedikit */
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2); /* Bayangan saat hover */
}

.btn-primary {
  background: linear-gradient(120deg, #1abc9c 0%, #16a085 100%);
  border: none;
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(120deg, #16a085 0%, #138d75 100%);
}

.btn-outline-secondary {
  border: 2px solid #95a5a6;
  color: #95a5a6;
  background-color: transparent;
}

.btn-outline-secondary:hover {
  background-color: #95a5a6;
  color: white;
}

.btn-success {
  background-color: #2ecc71; /* Hijau cerah */
  border-color: #2ecc71;
  color: white;
}
.btn-success:hover {
  background-color: #27ae60;
  border-color: #27ae60;
}

.btn-danger {
  background-color: #e74c3c; /* Merah cerah */
  border-color: #e74c3c;
  color: white;
}
.btn-danger:hover {
  background-color: #c0392b;
  border-color: #c0392b;
}

.btn-warning {
  background-color: #f1c40f; /* Kuning cerah */
  border-color: #f1c40f;
  color: #34495e; /* Teks gelap */
}
.btn-warning:hover {
  background-color: #f39c12;
  border-color: #f39c12;
}

.btn-info {
  background-color: #3498db; /* Biru info */
  border-color: #3498db;
  color: white;
}
.btn-info:hover {
  background-color: #2980b9;
  border-color: #2980b9;
}

/* Badges Enhancements */
.badge {
  font-weight: 600;
  padding: 0.6em 1em; /* Padding lebih besar */
  border-radius: 20px; /* Lebih bulat */
  transition: all 0.3s ease;
  text-transform: capitalize; /* Huruf pertama kapital */
}

.badge:hover {
  transform: scale(1.1); /* Zoom saat hover */
}

/* Inputs Enhancements */
.form-control {
  border-radius: 8px;
  border: 1px solid #c0d9e4; /* Border lebih lembut */
  padding: 12px 18px; /* Padding lebih besar */
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background-color: #fcfdff; /* Latar belakang input lebih terang */
}

.form-control:focus {
  border-color: #1abc9c; /* Fokus ke warna tema */
  box-shadow: 0 0 0 0.25rem rgba(26, 188, 156, 0.25); /* Shadow fokus warna tema */
}

/* Animations (from Animate.css, customized duration) */
.animate__animated {
  -webkit-animation-duration: 0.8s;
  animation-duration: 0.8s;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}

.animate__faster {
  -webkit-animation-duration: 0.5s;
  animation-duration: 0.5s;
}

/* .animate__delay-0.2s {
  -webkit-animation-delay: 0.2s;
  animation-delay: 0.2s;
}

.animate__delay-0.4s {
  -webkit-animation-delay: 0.4s;
  animation-delay: 0.4s;
}

.animate__delay-0.6s {
  -webkit-animation-delay: 0.6s;
  animation-delay: 0.6s;
} */

/* Toast Notification Enhancements */
#notificationToast {
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  font-weight: 500;
}

#notificationToast .toast-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.85rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
}

#notificationToast .toast-body {
  padding: 1.25rem;
  font-size: 1rem;
  color: #34495e;
}

/* Specific Toast Colors */
#notificationToast .toast-header.bg-success {
  background-color: #27ae60 !important;
}
#notificationToast .toast-header.bg-danger {
  background-color: #e74c3c !important;
}
#notificationToast .toast-header.bg-warning {
  background-color: #f39c12 !important;
  color: #34495e;
} /* Teks gelap untuk warning */
#notificationToast .toast-header.bg-info {
  background-color: #3498db !important;
}

/* Profile Picture Enhancements (for modals) */
.navbar .dropdown-toggle img {
  border: 3px solid rgba(255, 255, 255, 0.7);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

.navbar .dropdown-toggle:hover img {
  transform: scale(1.15) rotate(5deg); /* Sedikit putar saat hover */
  border-color: white;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.9);
}

/* Modal Enhancements */
.modal-content {
  border-radius: 20px; /* Lebih bulat lagi */
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35); /* Bayangan lebih dalam */
}

.modal-header {
  border-radius: 20px 20px 0 0 !important;
  padding: 1.5rem;
  font-size: 1.3rem;
}

/* History Page Specific Styles */
h1 {
  position: relative;
  padding-bottom: 20px;
  font-size: 2.5rem; /* Ukuran judul lebih besar */
  color: #2c3e50; /* Warna judul lebih gelap */
  font-weight: 700;
}

h1::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150px; /* Garis bawah lebih panjang */
  height: 5px; /* Garis bawah lebih tebal */
  background: linear-gradient(90deg, #1abc9c, #3498db); /* Gradien warna */
  border-radius: 3px;
}

#historyLoading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh; /* Sesuaikan tinggi agar tidak terlalu besar */
  color: #1abc9c;
  font-size: 1.4rem;
  animation: fadeAndScaleIn 1.5s ease-out forwards;
}

#historyLoading .spinner-border {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 20px;
  border-width: 0.35em;
  animation: spin 1s linear infinite; /* Animasi spin */
}

@keyframes fadeAndScaleIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#noHistoryFound {
  background-color: #e0f7fa; /* Warna latar belakang yang lebih menarik */
  border: 1px solid #b2ebf2;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  color: #00838f; /* Warna teks yang kontras */
}

#noHistoryFound .fas {
  color: #00bcd4; /* Warna ikon */
  margin-bottom: 15px;
}

/* History Status Badges */
.badge-success-history {
  background-color: #27ae60;
  color: white;
}
.badge-warning-history {
  background-color: #f39c12;
  color: white;
}
.badge-danger-history {
  background-color: #e74c3c;
  color: white;
}
.badge-info-history {
  background-color: #3498db;
  color: white;
}
.badge-secondary-history {
  background-color: #95a5a6;
  color: white;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .navbar-brand {
    font-size: 1.5rem;
  }
  .nav-link {
    padding: 0.5rem 1rem;
  }
  .card-header {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
  }
  .list-group-item {
    padding: 15px 20px;
  }
  .btn {
    padding: 8px 20px;
    font-size: 0.9rem;
  }
  h1 {
    font-size: 2rem;
  }
  h1::after {
    width: 120px;
  }
}

@media (max-width: 767px) {
  .navbar-nav .nav-item {
    margin: 5px 0;
  }
  .navbar-nav .nav-item .nav-link::after {
    width: 50%;
    left: 25%;
    transform: translateX(0);
  }
  .card {
    margin-bottom: 20px;
  }
  .list-group-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
  }
  .list-group-item .d-flex.w-100.justify-content-between {
    flex-direction: column;
    align-items: flex-start;
  }
  .list-group-item .badge {
    margin-top: 5px;
    align-self: flex-end;
  }
  .task-actions {
    width: 100%;
    text-align: center;
    margin-top: 15px;
  }
  .task-actions .btn {
    margin: 5px auto;
    display: block;
  }
  #historyLoading {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1.3rem;
  }
  .modal-dialog {
    margin: 0.5rem;
  }
  .modal-header {
    padding: 1rem;
    font-size: 1.1rem;
  }
  .modal-body {
    padding: 20px;
  }
}
