/* daftarLaporan.css - Styling for the Report List & Preview page */

h1 {
  margin: 0 0 8px;
  font-size: 24px;
  color: var(--primary-color);
  letter-spacing: 0.2px;
}
p.sub {
  margin: 0 0 24px;
  color: var(--secondary-text-color);
}

/* Report Type Tabs */
.tabs-container {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background-color: var(--base-background);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary-text-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn:hover {
  color: var(--primary-color);
}

.tab-btn.active {
  background-color: var(--panel-background);
  color: #0ea5a4;
  box-shadow: var(--shadow-md);
}

/* Filter Panel */
.filter-panel {
  background: var(--gradient-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--base-text-color);
}

.filter-btn {
  width: 100%;
  background: #0ea5a4;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
}

.filter-btn:hover {
  background: #0d8b8a;
  box-shadow: 0 4px 12px rgba(14, 165, 164, 0.25);
}

/* List Table */
.report-list-container {
  background: var(--panel-background);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.table-loading {
  padding: 40px;
  text-align: center;
  color: var(--secondary-text-color);
  font-weight: 500;
}

.table-loading .spinner {
  margin: 0 auto 12px auto;
  border-top-color: #0ea5a4;
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--secondary-text-color);
}

.empty-state i {
  font-size: 3rem;
  color: var(--border-color);
  margin-bottom: 16px;
}

/* Action Buttons in Table */
.action-btn-group {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.btn-icon {
  border: none;
  background: none;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.15s ease;
}

.btn-icon-preview {
  color: #0ea5a4;
  background: rgba(14, 165, 164, 0.1);
}
.btn-icon-preview:hover {
  background: #0ea5a4;
  color: #fff;
}

.btn-icon-edit {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}
.btn-icon-edit:hover {
  background: #f59e0b;
  color: #fff;
}

/* Preview Modal */
.preview-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.6);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

.preview-modal.show {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 20px;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.1);
  display: flex;
  flex-direction: column;
}

@keyframes modalSlideUp {
  0% { transform: translateY(30px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gradient-surface);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-color);
}

.btn-close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--secondary-text-color);
  transition: color 0.15s;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.btn-close-modal:hover {
  background-color: var(--base-background);
  color: var(--primary-color);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background: var(--gradient-surface);
}

/* Detail UI Elements */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.detail-item {
  background: var(--base-background);
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--secondary-text-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.detail-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-color);
}

.detail-value-large {
  font-size: 1.1rem;
  font-weight: 800;
}

.detail-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 24px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-text-block {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--base-text-color);
  white-space: pre-line;
  margin-bottom: 16px;
}

/* Preview Photos */
.preview-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.preview-photo-item {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.2s;
}

.preview-photo-item:hover {
  transform: scale(1.05);
}

.preview-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Pagination Styles */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 20px 0;
  padding: 10px;
  flex-wrap: wrap;
}

.pagination-btn {
  background: white;
  border: 1px solid var(--border-color);
  color: var(--secondary-text-color);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--base-background);
  border-color: var(--secondary-text-color);
  color: var(--primary-color);
}

.pagination-btn.active {
  background: #0ea5a4;
  border-color: #0ea5a4;
  color: white;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 14px;
  color: var(--secondary-text-color);
  margin: 0 10px;
  font-weight: 600;
}

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

@media (max-width: 768px) {
  .table-wrapper {
    overflow-x: visible;
    border: none;
    box-shadow: none;
    background: transparent;
    margin-top: 12px;
  }
  
  table, thead, tbody, th, td, tr {
    display: block;
    width: 100%;
  }
  
  thead {
    display: none;
  }
  
  tr {
    background: var(--panel-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
  }
  
  tr:hover td {
    background-color: transparent !important;
  }
  
  td {
    border-bottom: none;
    padding: 8px 0;
    font-size: 0.95rem;
    color: var(--primary-text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--secondary-text-color);
    margin-right: 12px;
    font-size: 0.85rem;
    text-transform: uppercase;
    flex-shrink: 0;
  }
  
  td > * {
    max-width: 70%;
    text-align: right;
  }
  
  td.action-btn-group {
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
    padding-top: 12px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
  }
  
  td.action-btn-group::before {
    display: none;
  }
  
  td.action-btn-group > * {
    max-width: 100%;
  }

  .btn-icon {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    border-radius: 10px;
  }
}
