@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap");

:root {
  --primary-modern: #0aa354;
  --primary-gradient: linear-gradient(135deg, #0aa354 0%, #007d3b 100%);
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.5);
  --shadow-modern: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

body {
  font-family: "Outfit", sans-serif !important;
}

.authincation {
  background: radial-gradient(
    circle at top left,
    #f0f9f4 0%,
    #e6f4ea 50%,
    #d5eedd 100%
  );
  position: relative;
  overflow: hidden;
  min-height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.authincation::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  background: var(--primary-gradient);
  border-radius: 50%;
  top: -100px;
  right: -100px;
  opacity: 0.1;
  filter: blur(50px);
}

.authincation::after {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  background: #000;
  border-radius: 50%;
  bottom: -150px;
  left: -150px;
  opacity: 0.03;
  filter: blur(80px);
}

.authincation-content {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px !important;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-modern);
  overflow: hidden;
  transition: all 0.3s ease;
}

.authincation-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.2);
}

.auth-form {
  padding: 40px !important;
}

.auth-form h4 {
  font-weight: 600;
  color: #333;
  letter-spacing: -0.5px;
}

.form-control,
.form-select {
  border-radius: 10px !important;
  border: 1px solid #e1e1e1 !important;
  transition: all 0.2s ease !important;
  background-color: rgba(255, 255, 255, 0.5) !important;
  color: #333 !important;
  display: block !important;
  box-sizing: border-box !important;
}

/* Default Height - 40px (More balanced than 48px) */
input.form-control:not(.form-control-lg):not(.form-control-sm),
select.form-control:not(.form-control-lg):not(.form-control-sm),
select.form-select:not(.form-select-lg):not(.form-select-sm) {
  padding: 0 15px !important;
  height: 40px !important;
  min-height: 40px !important;
  line-height: 40px !important;
}

/* Keep Bootstrap Large variant */
.form-control-lg,
.form-select-lg {
  height: calc(1.5em + 1rem + 2px) !important;
  padding: 0.5rem 1rem !important;
  border-radius: 12px !important;
}

textarea.form-control {
  padding: 12px 15px !important;
  height: auto !important;
  min-height: 100px !important;
  line-height: 1.6 !important;
}

#filterDate {
  height: 40px !important;
  min-height: 40px !important;
}

.form-control:focus {
  border-color: var(--primary-modern) !important;
  box-shadow: 0 0 0 4px rgba(10, 163, 84, 0.1) !important;
  background-color: #fff !important;
}

/* Input Group Unification */
.input-group {
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.input-group:focus-within {
  box-shadow: 0 0 0 4px rgba(10, 163, 84, 0.1);
  background-color: #fff;
}

.input-group .form-control {
  border-radius: 10px 0 0 10px !important;
  background-color: transparent !important;
  border-right: none !important;
}

.input-group .form-control:focus {
  box-shadow: none !important;
}

.input-group-text {
  border-radius: 0 10px 10px 0 !important;
  border: 1px solid #e1e1e1 !important;
  border-left: none !important;
  background-color: transparent !important;
  padding-right: 15px !important;
  height: 40px !important;
}

.input-group:focus-within .form-control,
.input-group:focus-within .input-group-text {
  border-color: var(--primary-modern) !important;
}

.btn {
  border-radius: 10px;
  padding: 8px 18px !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
}

/* Button Group Unification */
.btn-group > .btn,
.dt-buttons > .btn {
  border-radius: 0 !important;
}

.btn-group > .btn:first-child,
.dt-buttons > .btn:first-child {
  border-top-left-radius: 10px !important;
  border-bottom-left-radius: 10px !important;
}

.btn-group > .btn:last-child,
.dt-buttons > .btn:last-child {
  border-top-right-radius: 10px !important;
  border-bottom-right-radius: 10px !important;
}

/* Special case for single buttons in group */
.btn-group > .btn:first-child:last-child,
.dt-buttons > .btn:first-child:last-child {
  border-radius: 10px !important;
}

.btn-primary {
  background: var(--primary-gradient) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(10, 163, 84, 0.3) !important;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(10, 163, 84, 0.4) !important;
  opacity: 0.9;
}

.btn-primary:active {
  transform: translateY(0);
}

.captcha-box {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e1e1e1;
  border-radius: 10px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.captcha-box img {
  height: 35px !important;
  width: auto !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

#refreshCaptcha {
  color: var(--primary-modern) !important;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  cursor: pointer;
  display: inline-block;
}

#refreshCaptcha:hover {
  transform: rotate(180deg);
  opacity: 0.8;
}

/* Select2 Modern Styling */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  border: 1px solid #e1e1e1 !important;
  border-radius: 10px !important;
  min-height: 40px !important;
  display: flex !important;
  align-items: center !important;
  background-color: rgba(255, 255, 255, 0.5) !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
}

.select2-container--default .select2-selection--single {
  height: 40px !important;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__rendered {
  color: #333 !important;
  padding-left: 15px !important;
  line-height: 38px !important;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  height: 38px !important;
  right: 10px !important;
}

.select2-container--default .select2-selection--multiple {
  padding: 4px 8px !important;
}

.select2-container--default
  .select2-selection--multiple
  .select2-selection__choice {
  background-color: var(--primary-modern) !important;
  border: none !important;
  color: #fff !important;
  border-radius: 6px !important;
  padding: 2px 10px !important;
  margin-top: 5px !important;
}

.select2-container--default
  .select2-selection--multiple
  .select2-selection__choice__remove {
  color: #fff !important;
  margin-right: 5px !important;
}

.select2-container--default.select2-container--focus
  .select2-selection--single {
  border-color: var(--primary-modern) !important;
  box-shadow: 0 0 0 4px rgba(10, 163, 84, 0.1) !important;
  background-color: #fff !important;
}

.select2-dropdown {
  border: 1px solid #e1e1e1 !important;
  border-radius: 10px !important;
  box-shadow: var(--shadow-modern) !important;
  overflow: hidden !important;
}

.select2-search--dropdown .select2-search__field {
  border-radius: 6px !important;
  border: 1px solid #e1e1e1 !important;
  padding: 6px 10px !important;
}

.select2-results__option--highlighted[aria-selected] {
  background-color: var(--primary-modern) !important;
}

/* =============================================
   DATATABLES PROFESSIONAL STYLING
   ============================================= */
/* Poin 1: Teks rata kiri untuk kolom nama, alamat, kebutuhan */
table.dataTable td.text-left {
  text-align: left !important;
}

/* Poin 1: Angka rata kanan untuk kolom jumlah, jangka waktu */
table.dataTable td.text-right {
  text-align: right !important;
}

/* Poin 3: Nowrap di semua cell datatables, biarkan scroll horizontal */
.table-responsive {
  overflow-x: auto !important;
}
.table-responsive table.dataTable {
  width: 100% !important;
}
.table-responsive table.dataTable td,
.table-responsive table.dataTable th {
  white-space: nowrap !important;
}

/* Poin 2: Gap untuk button groups */
.d-flex.gap-1 {
  gap: 0.35rem !important;
}
.d-flex.gap-2 {
  gap: 0.5rem !important;
}
.d-flex.gap-3 {
  gap: 0.75rem !important;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.authincation-content {
  animation: fadeInUp 0.8s ease-out;
}

/* Responsive Fixes */
@media (max-width: 576px) {
  .auth-form {
    padding: 25px !important;
  }

  .authincation-content {
    margin: 15px;
  }
}

.btn-group-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.75rem;
}

.connecting-line {
  height: 2px;
  background: #e0e0e0;
  position: absolute;
  width: calc(100% - (100% / 6));
  margin: 0 auto;
  left: 0;
  right: 0;
  top: 15px;
  z-index: 1;
}

.wizard .nav-tabs > li {
  width: calc(100% / 6);
}

.card {
  border-radius: 15px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  height: 37px;
  margin: 0 2px;
}

.pagination .page-item .page-link {
  padding: 0.55rem 0.2rem;
  border: none;
}

.pagination .page-item.active .page-link {
  height: 37px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
  height: 37px;
}

/* =============================================
   TRACKING & MONITORING - MapLibre GL JS
   ============================================= */
.tracking-hero {
  background: linear-gradient(135deg, #0aa354 0%, #007d3b 100%);
  border-radius: 20px;
  padding: 25px 30px;
  margin-bottom: 25px;
  color: white;
  box-shadow: 0 10px 40px rgba(10, 163, 84, 0.25);
  position: relative;
  overflow: hidden;
}
.tracking-hero::before {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  top: -50px;
  right: -50px;
}
.tracking-hero::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  bottom: -30px;
  left: -30px;
}
.tracking-hero h2 {
  font-weight: 700;
  margin: 0;
  position: relative;
  z-index: 1;
}
.tracking-hero p {
  opacity: 0.9;
  margin: 5px 0 0 0;
  position: relative;
  z-index: 1;
}

.card-glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
  transition: all 0.3s ease;
}
.card-glass:hover {
  box-shadow: 0 12px 40px rgba(31, 38, 135, 0.15);
  transform: translateY(-2px);
}
.card-glass .card-header {
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 18px 24px;
}
.card-glass .card-body {
  padding: 20px 24px;
}

#mapContainer {
  width: 100%;
  height: 520px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
  position: relative;
  z-index: 1;
}
#mapContainer .maplibregl-ctrl-top-right {
  top: 10px;
  right: 10px;
}

/* Fix Select2 dropdown terhalang map */
.select2-container--open {
  z-index: 9999 !important;
}
.card-glass .select2-container--open {
  z-index: 9999 !important;
}

.filter-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  margin-bottom: 6px;
}

.timeline-track {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 5px;
}
.timeline-track::-webkit-scrollbar {
  width: 4px;
}
.timeline-track::-webkit-scrollbar-thumb {
  background: #0aa354;
  border-radius: 10px;
}

.tracking-stat {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}
.tracking-stat .stat-item {
  background: rgba(10, 163, 84, 0.08);
  border-radius: 12px;
  padding: 12px 18px;
  flex: 1;
  min-width: 120px;
  text-align: center;
}
.tracking-stat .stat-item .stat-number {
  font-size: 22px;
  font-weight: 700;
  color: #0aa354;
}
.tracking-stat .stat-item .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6c757d;
  margin-top: 2px;
}

.marker-popup-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  margin-top: 5px;
}

.badge-live {
  background: #ff4757;
  color: white;
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  animation: pulse-live 1.5s infinite;
  display: inline-block;
}
@keyframes pulse-live {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

.btn-modern {
  border-radius: 10px;
  padding: 8px 20px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
}
.btn-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}
.btn-modern-success {
  background: linear-gradient(135deg, #0aa354, #007d3b);
  color: white;
}
.btn-modern-danger {
  background: linear-gradient(135deg, #ff4757, #c0392b);
  color: white;
}
.btn-modern-warning {
  background: linear-gradient(135deg, #ffa502, #e67e22);
  color: white;
}
.btn-modern-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(255, 165, 2, 0.3);
  color: white;
}

.table-modern thead th {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  padding: 12px 15px;
}
.table-modern tbody td {
  padding: 10px 15px;
  vertical-align: middle;
}

.date-mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.date-mode-toggle .btn-mode {
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid #dee2e6;
  background: white;
  color: #6c757d;
  cursor: pointer;
  transition: all 0.2s;
}
.date-mode-toggle .btn-mode.active {
  border-color: #0aa354;
  background: rgba(10, 163, 84, 0.1);
  color: #0aa354;
}
.date-mode-toggle .btn-mode:hover {
  border-color: #0aa354;
}

.select2-container--default
  .select2-selection--single
  .select2-selection__arrow {
  top: 0px;
}

/* =============================================
   NOTIFICATION DROPDOWN STYLING
   ============================================= */
.notification_dropdown .bell {
  position: relative;
  font-size: 1.2rem;
  padding: 8px 12px !important;
  transition: all 0.3s ease;
}
.notification_dropdown .bell:hover {
  color: var(--primary-modern) !important;
}

#notifBadge {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: notifPulse 2s infinite;
}

@keyframes notifPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.notification_dropdown_content {
  width: 360px !important;
  max-height: 480px;
  padding: 0 !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
  border: none !important;
  overflow: hidden;
}

.notification_header {
  padding: 15px 20px;
  background: linear-gradient(135deg, #0aa354, #007d3b);
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notification_body {
  max-height: 350px;
  overflow-y: auto;
}

.notification_body::-webkit-scrollbar {
  width: 4px;
}
.notification_body::-webkit-scrollbar-thumb {
  background: #0aa354;
  border-radius: 10px;
}

.notif-item {
  padding: 12px 20px !important;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s ease;
  position: relative;
}
.notif-item:hover {
  background: rgba(10, 163, 84, 0.05);
}
.notif-item.unread {
  background: rgba(10, 163, 84, 0.03);
}
.notif-item .notif-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
  color: #333;
}
.notif-item .notif-text {
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.notif-item .notif-time {
  font-size: 11px;
  color: #adb5bd;
}
.notif-item .notif-dot {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: #0aa354;
  border-radius: 50%;
  animation: notifPulse 2s infinite;
}

.notification_footer {
  padding: 10px 20px;
  text-align: center;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
}
.notification_footer a {
  font-size: 13px;
  font-weight: 600;
}
.notification_footer a:hover {
  text-decoration: underline;
}

/* =============================================
   NOTIFICATION SLIDE-OVER PANEL
   ============================================= */
.notif-slide-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
  backdrop-filter: blur(2px);
}

.notif-slide-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100%;
  background: #fff;
  z-index: 9999;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

.notif-slide-panel.open {
  right: 0;
}

.notif-slide-header {
  padding: 18px 20px;
  background: linear-gradient(135deg, #0aa354, #007d3b);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.notif-slide-header h5 {
  font-weight: 600;
  font-size: 16px;
}

.notif-slide-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-slide-actions .btn-link {
  font-size: 12px;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.notif-slide-actions .btn-link:hover {
  opacity: 1;
  text-decoration: none;
}

.notif-slide-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.notif-slide-body::-webkit-scrollbar {
  width: 4px;
}

.notif-slide-body::-webkit-scrollbar-thumb {
  background: #0aa354;
  border-radius: 10px;
}

.notif-slide-body .notif-item {
  display: block;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.2s ease;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.notif-slide-body .notif-item:hover {
  background: rgba(10, 163, 84, 0.05);
}

.notif-slide-body .notif-item.unread {
  background: rgba(10, 163, 84, 0.03);
  border-left: 3px solid #0aa354;
}

.notif-slide-body .notif-item .notif-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
  color: #333;
}

.notif-slide-body .notif-item .notif-text {
  font-size: 12px;
  color: #6c757d;
  margin-bottom: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-slide-body .notif-item .notif-time {
  font-size: 11px;
  color: #adb5bd;
}

.notif-slide-body .notif-item .notif-dot {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: #0aa354;
  border-radius: 50%;
  animation: notifPulse 2s infinite;
}

/* Responsive untuk mobile */
@media (max-width: 576px) {
  .notif-slide-panel {
    width: 100%;
    right: -100%;
  }
}

.authincation-content .auth-form img {
  width: 100%;
}
