/* === VARIABEL WARNA === */
:root {
  --primary: #3498db;
  --primary-light: #5dade2;
  --primary-dark: #2980b9;
  --success: #2ecc71;
  --warning: #f39c12;
  --danger: #e74c3c;
  --light-gray: #f8f9fa;
  --gray: #e9ecef;
  --dark-gray: #6c757d;
  --white: #ffffff;
}

/* === GAYA UMUM === */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  padding: 20px 0;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 25px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
}

header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--gray);
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  background: linear-gradient(to right, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--dark-gray);
  font-size: 1.1rem;
  margin-top: 10px;
}

/* === TOMBOL KEMBALI === */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: linear-gradient(to right, var(--primary), var(--primary-light));
  color: var(--white);
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
  border: none;
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
  color: var(--white);
}

/* === FILTER BOX === */
.filter-box {
  background: var(--light-gray);
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 25px;
  border: 1px solid var(--gray);
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.filter-box label {
  font-weight: 600;
  color: var(--dark-gray);
  margin: 0;
}

.filter-box input[type="date"] {
  padding: 8px 12px;
  border: 2px solid var(--gray);
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.3s;
  background: white;
}

.filter-box input[type="date"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#filterBtn,
#resetBtn {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

#filterBtn {
  background: linear-gradient(to right, var(--primary), var(--primary-light));
  color: var(--white);
}

#resetBtn {
  background: var(--dark-gray);
  color: var(--white);
}

#filterBtn:hover,
#resetBtn:hover {
  transform: translateY(-2px);
}

#filterBtn:hover {
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

/* === DATA TABLES CUSTOM STYLING === */
.dataTables_wrapper {
  margin-top: 20px;
}

/* Search Box Styling */
.dataTables_filter {
  margin-bottom: 15px !important;
}

.dataTables_filter label {
  font-weight: 600;
  color: var(--dark-gray);
}

.dataTables_filter input {
  padding: 8px 12px;
  border: 2px solid var(--gray);
  border-radius: 8px;
  margin-left: 10px;
  transition: all 0.3s;
}

.dataTables_filter input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Button Group Styling */
.dt-buttons {
  margin-bottom: 15px !important;
}

.dt-button {
  padding: 8px 16px !important;
  border-radius: 8px !important;
  margin-right: 8px !important;
  font-weight: 600 !important;
  border: none !important;
  transition: all 0.3s !important;
}

.dt-button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1) !important;
}

.btn-success {
  background: linear-gradient(to right, var(--success), #27ae60) !important;
}

.btn-danger {
  background: linear-gradient(to right, var(--danger), #c0392b) !important;
}

.btn-info {
  background: linear-gradient(
    to right,
    var(--primary),
    var(--primary-dark)
  ) !important;
}

/* Table Container */
.table-container {
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--gray);
  margin-top: 20px;
}

/* Table Header */
#logTable thead th {
  background: linear-gradient(to right, var(--primary), var(--primary-light));
  color: var(--white);
  font-weight: 600;
  padding: 16px 12px;
  border: none;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Table Body */
#logTable tbody tr {
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--gray);
}

#logTable tbody tr:hover {
  background-color: rgba(52, 152, 219, 0.05) !important;
}

#logTable tbody td {
  padding: 14px 12px;
  color: #333;
  font-size: 0.9rem;
  border: none;
  vertical-align: middle;
}

/* === STATUS COLORS === */
.row-aman {
  background: linear-gradient(
    90deg,
    rgba(46, 204, 113, 0.08),
    rgba(46, 204, 113, 0.04)
  ) !important;
  border-left: 4px solid var(--success) !important;
}

.row-siaga {
  background: linear-gradient(
    90deg,
    rgba(243, 156, 18, 0.08),
    rgba(243, 156, 18, 0.04)
  ) !important;
  border-left: 4px solid var(--warning) !important;
}

.row-bahaya {
  background: linear-gradient(
    90deg,
    rgba(231, 76, 60, 0.08),
    rgba(231, 76, 60, 0.04)
  ) !important;
  border-left: 4px solid var(--danger) !important;
}

/* === STATUS BADGES === */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 60px;
  text-align: center;
}

.aman-badge {
  background: rgba(46, 204, 113, 0.15);
  color: #27ae60;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.siaga-badge {
  background: rgba(243, 156, 18, 0.15);
  color: #d68910;
  border: 1px solid rgba(243, 156, 18, 0.3);
}

.bahaya-badge {
  background: rgba(231, 76, 60, 0.15);
  color: #c0392b;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

/* === PAGINATION IMPROVEMENT === */
.dataTables_paginate {
  margin-top: 20px !important;
  text-align: center !important;
}

.paginate_button {
  margin: 0 2px !important;
  padding: 6px 12px !important;
  border-radius: 6px !important;
  border: 1px solid var(--gray) !important;
  color: var(--dark-gray) !important;
  background: white !important;
  font-weight: 500 !important;
  transition: all 0.3s !important;
}

.paginate_button.current {
  background: linear-gradient(
    to right,
    var(--primary),
    var(--primary-light)
  ) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3) !important;
}

.paginate_button:hover:not(.disabled):not(.current) {
  background: var(--light-gray) !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.paginate_button.disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

/* === INFO TEXT === */
.dataTables_info {
  padding: 10px 0 !important;
  color: var(--dark-gray) !important;
  font-weight: 500 !important;
}

/* === TABLE FOOTER === */
.table-footer {
  margin-top: 25px;
  padding: 15px;
  background: var(--light-gray);
  border-radius: 10px;
  border: 1px solid var(--gray);
}

.legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--dark-gray);
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.legend-color.aman {
  background: linear-gradient(
    to right,
    var(--success),
    rgba(46, 204, 113, 0.7)
  );
}

.legend-color.siaga {
  background: linear-gradient(
    to right,
    var(--warning),
    rgba(243, 156, 18, 0.7)
  );
}

.legend-color.bahaya {
  background: linear-gradient(to right, var(--danger), rgba(231, 76, 60, 0.7));
}

/* === RESPONSIVE === */
@media (max-width: 992px) {
  .container {
    padding: 15px;
    margin: 10px;
  }

  header h1 {
    font-size: 2rem;
  }

  .filter-box {
    flex-direction: column;
    align-items: stretch;
  }

  .dt-buttons {
    text-align: center !important;
  }

  .dt-button {
    margin-bottom: 8px !important;
    width: calc(50% - 8px) !important;
  }
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
    flex-direction: column;
    gap: 10px;
  }

  .dataTables_wrapper .dt-buttons {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .dt-button {
    width: 100% !important;
    margin-bottom: 10px !important;
    margin-right: 0 !important;
  }

  .dataTables_filter {
    text-align: center !important;
  }

  .dataTables_filter input {
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 10px !important;
  }

  .dataTables_info,
  .dataTables_paginate {
    text-align: center !important;
  }
}

/* === LOADING STATE === */
.dataTables_processing {
  background: linear-gradient(
    to right,
    var(--primary),
    var(--primary-light)
  ) !important;
  color: white !important;
  border-radius: 10px !important;
  padding: 15px !important;
  font-weight: bold !important;
  border: none !important;
}

/* === SCROLLBAR CUSTOM === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--primary-light), var(--primary));
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, var(--primary), var(--primary-dark));
}

/* Record Count Badge */
#recordCount {
  font-size: 0.9rem;
  padding: 8px 15px;
  border-radius: 20px;
  background: linear-gradient(to right, var(--primary), var(--primary-light));
  color: white;
  font-weight: 600;
}

/* === HIDE PROCESSING MESSAGE === */
.dataTables_processing {
  display: none !important;
}

/* Custom loading indicator */
.custom-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  flex-direction: column;
}

.custom-loading.active {
  display: flex;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--gray);
  border-top: 5px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

.loading-text {
  color: var(--primary);
  font-weight: 600;
  font-size: 1.1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* === TOAST NOTIFICATION === */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
}

.toast {
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  border-left: 5px solid var(--primary);
  padding: 15px 20px;
  margin-bottom: 10px;
  display: none;
  animation: slideIn 0.3s ease;
}

.toast.show {
  display: block;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast.error {
  border-left-color: var(--danger);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* === FILTER STATUS === */
.filter-status {
  display: inline-block;
  padding: 5px 10px;
  background: var(--light-gray);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--dark-gray);
  margin-left: 10px;
  display: none;
}

.filter-status.active {
  display: inline-block;
  background: rgba(52, 152, 219, 0.1);
  color: var(--primary);
}

/* === FOOTER STYLING === */
.table-footer {
  margin-top: 25px;
  padding: 15px;
  background: var(--light-gray);
  border-radius: 10px;
  border: 1px solid var(--gray);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.status-section,
.credits-section,
.refresh-section {
  flex: 1;
  min-width: 200px;
}

.credits-section {
  text-align: center;
}

.refresh-section {
  text-align: right;
}

.developer-info {
  display: inline-block;
  text-align: left;
}

.developer,
.assistant {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.developer-name,
.assistant-name {
  font-weight: 600;
  margin-right: 5px;
}

.developer .role {
  color: var(--primary);
  font-weight: 500;
}

.assistant .role {
  color: var(--info);
  font-weight: 500;
}

.refresh-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .status-section,
  .credits-section,
  .refresh-section {
    width: 100%;
    text-align: center;
  }

  .developer-info {
    text-align: center;
  }

  .developer,
  .assistant {
    justify-content: center;
  }

  .refresh-control {
    justify-content: center;
  }
}
