/* =========================================================
   LAPORAN PAGE - Responsive Mobile Optimized
========================================================= */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap");

.report-page {
  font-family: "Inter", sans-serif;
  transform: scale(0.95);
  transform-origin: top center;
  background-color: #f8fbfd;
  padding: 50px;
  transition: background-color 0.3s ease;
}

body.dark .laporan-page {
  background-color: #1a1a1a;
  color: #66b3ff;
}

/* ======== Judul ======== */
h1 {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  color: #0b3d91;
  margin-bottom: 14px;
  font-size: 20px;
}

body.dark h1 {
  color: #66b3ff;
}

/* ======== Search dan Filter ======== */
.search-container {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-container input {
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  padding: 9px 13px;
  width: 215px;
  min-width: 140px;
  font-size: 12px;
  outline: none;
  transition: 0.2s ease;
}

body.dark .search-container input {
  background-color: #2a2a2a;
  border-color: #444;
  color: #e8e8e8;
}

.search-container input:focus {
  border-color: #0b3d91;
  box-shadow: 0 0 5px rgba(11, 61, 145, 0.2);
}

select {
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  padding: 9px 13px;
  background-color: white;
  color: #333;
  min-width: 115px;
  transition: 0.2s ease;
  font-size: 12px;
}

body.dark select {
  background-color: #2a2a2a;
  border-color: #444;
  color: #e8e8e8;
}

select:focus {
  border-color: #0b3d91;
  box-shadow: 0 0 5px rgba(11, 61, 145, 0.2);
  outline: none;
}

/* ======== Tombol ======== */
button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 9px 17px;
  font-weight: 600;
  font-size: 12px;
  transition: 0.25s ease;
  white-space: nowrap;
}

button:hover {
  transform: translateY(-2px);
}

.btn-green {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.2);
}

.btn-green:hover {
  background: linear-gradient(135deg, #15803d, #166534);
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.3);
}

.btn-red {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.2);
}

.btn-red:hover {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
  box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
}

/* ======== Table Wrapper ======== */
.table-wrapper {
  background-color: #fff;
  border-radius: 9px;
  border: 1px solid #e0e6f0;
  overflow-x: auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

body.dark .table-wrapper {
  background-color: #2a2a2a;
  border-color: #444;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ======== Table ======== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 950px;
}

thead {
  font-family: "Inter", sans-serif;
  background: linear-gradient(135deg, #0b3d91, #0c4da8);
  color: white;
}

body.dark thead {
  background: linear-gradient(135deg, #1a4d7a, #0f3a5f);
}

thead th {
  font-weight: 600;
  padding: 11px 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-bottom: 2px solid #0b3d91;
  font-size: 11px;
}

body.dark thead th {
  border-bottom-color: #66b3ff;
}

thead th:first-child {
  border-top-left-radius: 9px;
}

thead th:last-child {
  border-top-right-radius: 9px;
}

tbody tr {
  border-bottom: 1px solid #e5e7eb;
  transition: 0.2s ease;
}

body.dark tbody tr {
  border-bottom-color: #444;
}

tbody tr:nth-child(even) {
  background-color: #f5f8fc;
}

body.dark tbody tr:nth-child(even) {
  background-color: #333;
}

tbody tr:hover {
  background-color: #eef5ff;
}

body.dark tbody tr:hover {
  background-color: #3a3a3a;
}

tbody td {
  font-family: "Inter", sans-serif;
  padding: 11px 13px;
  color: #333;
}

body.dark tbody td {
  color: #e8e8e8;
}

td.text-green {
  color: #16a34a;
  font-weight: 600;
}

td.text-red {
  color: #dc2626;
  font-weight: 600;
}

/* ======== Footer Total ======== */
tfoot {
  font-family: "Inter", sans-serif;
  background-color: #f9fafb;
  font-weight: 600;
}

body.dark tfoot {
  background-color: #333;
}

tfoot td {
  padding: 11px 13px;
  font-size: 12px;
  border-top: 2px solid #0b3d91;
  color: #0b3d91;
}

body.dark tfoot td {
  border-top-color: #66b3ff;
  color: #66b3ff;
}

/* ======== Alert Box ======== */
.alert-box {
  display: none;
  position: relative;
  padding: 12px 17px;
  background-color: #d1fae5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  border-radius: 10px;
  margin: 12px 0 17px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  animation: fadeInSlide 0.3s ease-in-out;
}

body.dark .alert-box {
  background-color: #064e3b;
  border-color: #047857;
  color: #6ee7b7;
}

.alert-box::before {
  content: "✓ ";
  font-weight: 600;
  color: #059669;
}

.alert-box.show {
  display: block;
}

.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background-color: #34d399;
  width: 0;
  border-radius: 0 0 10px 10px;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   RESPONSIVE DESIGN - MOBILE OPTIMIZED
========================================================= */

/* Tablet (1024px) */
@media (max-width: 1024px) {
  .laporan-page {
    transform: scale(1);
    padding: 20px 25px;
  }

  h1 {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .search-container {
    gap: 12px;
  }

  table {
    font-size: 12px;
  }
}

/* Tablet Small & Mobile Large (768px) */
@media (max-width: 768px) {
  .laporan-page {
    transform: scale(1);
    padding: 20px;
  }

  h1 {
    font-size: 20px;
    margin-bottom: 18px;
  }

  /* Search container stack vertically */
  .search-container {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
    gap: 12px;
  }

  .search-container input,
  select,
  button {
    width: 100%;
    min-width: 0;
    padding: 12px 15px;
    font-size: 14px;
  }

  button {
    padding: 12px 20px;
    font-size: 14px;
  }

  /* Table wrapper dengan scroll yang lebih baik */
  .table-wrapper {
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
  }

  table {
    font-size: 11px;
    min-width: 900px;
  }

  thead th {
    padding: 10px 11px;
    font-size: 10px;
  }

  tbody td {
    padding: 10px 11px;
  }

  tfoot td {
    padding: 10px 11px;
    font-size: 11px;
  }

  /* Alert box */
  .alert-box {
    font-size: 13px;
    padding: 12px 15px;
  }
}

/* Mobile Medium (480px - 640px) */
@media (max-width: 640px) {
  .laporan-page {
    padding: 18px 16px;
  }

  h1 {
    font-size: 19px;
    margin-bottom: 16px;
  }

  .search-container input,
  select,
  button {
    padding: 11px 14px;
    font-size: 13px;
  }

  table {
    min-width: 850px;
  }

  .alert-box {
    font-size: 12px;
  }
}

/* Mobile Small (< 480px) */
@media (max-width: 480px) {
  .laporan-page {
    padding: 16px 14px;
  }

  h1 {
    font-size: 18px;
    margin-bottom: 14px;
  }

  .search-container {
    gap: 10px;
  }

  .search-container input,
  select {
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 6px;
  }

  button {
    padding: 11px 16px;
    font-size: 13px;
    border-radius: 6px;
  }

  /* Table responsiveness */
  .table-wrapper {
    border-radius: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    font-size: 10px;
    min-width: 800px;
  }

  thead th {
    padding: 9px 8px;
    font-size: 9px;
    letter-spacing: 0.2px;
  }

  tbody td {
    padding: 9px 8px;
    font-size: 10px;
  }

  tfoot td {
    padding: 9px 8px;
    font-size: 10px;
  }

  /* Alert box mobile */
  .alert-box {
    padding: 10px 12px;
    font-size: 12px;
    margin: 10px 0 14px;
    border-radius: 8px;
  }

  .progress-bar {
    height: 3px;
  }
}

/* Mobile Extra Small (< 375px) */
@media (max-width: 374px) {
  .laporan-page {
    padding: 14px 12px;
  }

  h1 {
    font-size: 17px;
  }

  .search-container input,
  select {
    padding: 9px 11px;
    font-size: 12px;
  }

  button {
    padding: 10px 14px;
    font-size: 12px;
  }

  table {
    min-width: 750px;
    font-size: 9px;
  }

  thead th,
  tbody td,
  tfoot td {
    padding: 8px 6px;
    font-size: 9px;
  }

  .alert-box {
    font-size: 11px;
    padding: 9px 11px;
  }
}

/* Landscape Mode untuk Mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .laporan-page {
    padding: 15px 20px;
  }

  h1 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .search-container {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .search-container input,
  select,
  button {
    flex: 1 1 calc(33.333% - 10px);
    min-width: 150px;
  }

  table {
    font-size: 10px;
  }

  thead th,
  tbody td,
  tfoot td {
    padding: 8px 10px;
  }
}

/* Custom Scrollbar untuk Table */
@media (max-width: 768px) {
  .table-wrapper {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
  }

  .table-wrapper::-webkit-scrollbar {
    height: 8px;
  }

  .table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
  }

  body.dark .table-wrapper::-webkit-scrollbar-track {
    background: #333;
  }

  .table-wrapper::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
  }

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

  /* Touch optimization */
  button {
    min-height: 44px;
    touch-action: manipulation;
  }

  select,
  input {
    min-height: 44px;
    -webkit-appearance: none;
    appearance: none;
  }

  /* Prevent text selection on double tap */
  .table-wrapper {
    -webkit-tap-highlight-color: transparent;
  }

  /* Better focus states for mobile */
  input:focus,
  select:focus {
    outline: 2px solid #0b3d91;
    outline-offset: 2px;
  }
}

/* Scrollbar hint for users */
@media (max-width: 768px) {
  .table-wrapper::after {
    content: "← Scroll →";
    display: block;
    text-align: center;
    padding: 8px;
    font-size: 11px;
    color: #999;
    font-style: italic;
    background: linear-gradient(
      90deg,
      transparent,
      #f8f8f8 20%,
      #f8f8f8 80%,
      transparent
    );
    animation: fadeInOut 3s ease-in-out;
  }

  body.dark .table-wrapper::after {
    background: linear-gradient(
      90deg,
      transparent,
      #2a2a2a 20%,
      #2a2a2a 80%,
      transparent
    );
  }

  @keyframes fadeInOut {
    0%,
    100% {
      opacity: 0;
    }
    50% {
      opacity: 1;
    }
  }
}

/* =========================================================
   SMOOTH TRANSITIONS
========================================================= */
* {
  transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

button,
a,
input:focus,
select:focus {
  transition: background-color 0.25s ease, color 0.25s ease,
    border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease !important;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================
   FOOTER
============================= */
footer {
  background: #333;
  color: #fff;
  padding: 15px 20px;
  text-align: center;
  font-size: 14px;
}

footer p {
  margin: 0;
  line-height: 1.4;
}

@media (max-width: 768px) {
  footer {
    padding: 12px 15px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  footer {
    padding: 10px 12px;
    font-size: 12px;
  }
}
