/* Modern Bootstrap UI CSS Overrides */

/* --- Typography & Base --- */
body {
  font-family: 'Noto Sans Thai', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Smooth Transitions --- */
.transition-colors, .card, .btn, .nav-link, .list-group-item, .bg-body, .bg-body-tertiary {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease !important;
}

/* --- Modern Card Styling --- */
.card {
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
  border-radius: 1rem !important; /* matches .rounded-4 */
}

[data-bs-theme="dark"] .card {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  background-color: var(--bs-gray-900) !important;
}

/* --- Subtle Shadows --- */
.shadow-sm {
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.05) !important;
}
[data-bs-theme="dark"] .shadow-sm {
  box-shadow: 0 .125rem .25rem rgba(0,0,0,.2) !important;
}

/* --- Buttons & Inputs --- */
.btn {
  border-radius: 0.5rem;
  font-weight: 500;
}
.btn-primary {
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 4px 8px rgba(13, 110, 253, 0.4);
  transform: translateY(-1px);
}
.form-control, .form-select {
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  border: 1px solid var(--bs-border-color);
}
.form-control:focus, .form-select:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

/* --- Navbar / Header --- */
header.sticky-top {
  background-color: rgba(var(--bs-body-bg-rgb), 0.95) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* --- Icon Boxes --- */
.custom-icon-box {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bs-secondary-bg);
  border-radius: 0.75rem;
  color: var(--bs-primary);
}

[data-bs-theme="dark"] .custom-icon-box {
  background-color: var(--bs-gray-800);
}

/* --- Mobile Specific Tweaks --- */
.bottom-nav {
  background-color: rgba(var(--bs-body-bg-rgb), 0.98) !important;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 1px solid rgba(var(--bs-border-color-rgb), 0.5) !important;
}

/* Hover effect on clickable cards */
.card-hover:hover {
  border-color: var(--bs-primary) !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08) !important;
  transform: translateY(-2px);
}
[data-bs-theme="dark"] .card-hover:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25) !important;
}

/* Ensure body uses correct theme background */
body {
  background-color: var(--bs-body-bg) !important;
}
.bg-body-tertiary {
  background-color: var(--bs-tertiary-bg) !important;
}

/* --- Admin Sidebar Layout --- */
.admin-sidebar {
  width: 280px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1040;
  transition: transform 0.3s ease-in-out;
  overflow-y: auto;
  background-color: var(--bs-body-bg);
}
.main-wrapper {
  margin-left: 280px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: calc(100% - 280px);
}
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 1030;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease-in-out;
  backdrop-filter: blur(2px);
}
@media (max-width: 991.98px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.show {
    transform: translateX(0);
  }
  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
  }
  .main-wrapper {
    margin-left: 0;
    width: 100%;
  }
}

.sidebar-nav-link {
  color: var(--bs-body-color);
  transition: all 0.2s ease;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 0.25rem;
}
.sidebar-nav-link:hover {
  background-color: var(--bs-secondary-bg);
  transform: translateX(3px);
}
.sidebar-nav-link.active {
  background-color: var(--bs-primary);
  color: #fff !important;
}
.sidebar-nav-link.active i {
  color: #fff !important;
}

