/* ==========================================================================
   PERLENGKAPAN CLIENT - MAIN STYLESHEET
   ========================================================================== */

/* ---------- CSS VARIABLES ---------- */
.perlengkapan-client-wrap {
  --p-accent: #003df6;
  --p-accent-gradient: linear-gradient(135deg, #003df6 0%, #2563eb 100%);
  --p-accent-soft: rgba(0, 61, 246, 0.08);
  --p-page-bg: #f8fafc;
  --p-card-bg: #ffffff;
  --p-text: #0f172a;
  --p-text-soft: #334155;
  --p-muted: #64748b;
  --p-line: rgba(148, 163, 184, 0.2);
  --p-line-strong: rgba(148, 163, 184, 0.4);
  --p-pad-x: 1rem;
  --p-pad-y: 0;
  --p-gap: 1.25rem;
  --p-section-gap: 2rem;
}

/* ==========================================================================
   LAYOUT & WRAPPER
   ========================================================================== */
.perlengkapan-client-wrap {
  background: var(--p-page-bg);
  padding-inline: var(--p-pad-x);
  padding-block: var(--p-pad-y);
  padding-bottom: 2rem;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  min-height: 70vh;
}

@media (min-width: 768px) {
  .perlengkapan-client-wrap {
    --p-pad-x: 2rem;
  }
}

@media (min-width: 1200px) {
  .perlengkapan-client-wrap {
    --p-pad-x: 3rem;
  }
}

/* ==========================================================================
   PRINT ONLY ELEMENTS
   ========================================================================== */
.print-only {
  display: none;
}

/* ==========================================================================
   ALERTS
   ========================================================================== */
.auto-hide {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.perlengkapan-hero {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  color: var(--p-text);
  padding: 2.5rem 2rem;
  margin: 0 calc(var(--p-pad-x) * -1) 1.5rem;
  border: none;
  border-radius: 0;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.perlengkapan-hero::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background: var(--p-accent-soft);
  border-radius: 50%;
  transform: translate(150px, -150px);
  opacity: 0.4;
  pointer-events: none;
}

.perlengkapan-hero h2 {
  color: var(--p-text);
  font-weight: 700;
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  position: relative;
}

.perlengkapan-hero .lead {
  font-size: clamp(0.95rem, 0.9rem + 0.35vw, 1.1rem);
  color: var(--p-text-soft);
  max-width: 600px;
  line-height: 1.6;
}

/* Filter active info */
.filter-active-info {
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-badge {
  background: white;
  color: var(--p-text);
  border: 1px solid var(--p-line);
  padding: 0.25rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
}

.btn-refresh-link {
  color: var(--p-muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-left: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  border: 1px solid var(--p-line);
  transition: all 0.2s ease;
}

.btn-refresh-link:hover {
  background: var(--p-accent);
  color: white;
  border-color: var(--p-accent);
}

/* Stats overview */
.stats-overview {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  border-radius: 1rem;
  padding: 1.25rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 20px 40px -15px rgba(0, 61, 246, 0.15);
}

.stat-item {
  position: relative;
  padding: 0.25rem 0;
}

.stat-number {
  display: block;
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
  font-weight: 700;
  color: var(--p-accent);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--p-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ==========================================================================
   FILTER BAR
   ========================================================================== */
.filter-bar {
  margin-bottom: 1.5rem;
}

.filter-card {
  background: white;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  border: 1px solid var(--p-line);
}

.filter-search {
  display: flex;
  align-items: center;
  border: 1px solid var(--p-line);
  border-radius: 0.5rem;
  background: white;
}

.filter-search-icon {
  padding: 0.5rem 0 0.5rem 0.75rem;
  color: var(--p-muted);
}

.filter-input {
  width: 100%;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  background: transparent;
  outline: none;
}

.filter-select {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid var(--p-line);
  border-radius: 0.5rem;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
}

.filter-select:hover,
.filter-input:hover {
  border-color: var(--p-accent);
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn-filter {
  background: var(--p-accent-gradient);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
}

.btn-filter:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 61, 246, 0.3);
}

.btn-refresh-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--p-line);
  border-radius: 0.5rem;
  color: var(--p-text-soft);
  background: white;
  transition: all 0.3s ease;
}

.btn-refresh-icon:hover {
  transform: rotate(180deg);
  background: var(--p-accent);
  color: white;
  border-color: var(--p-accent);
}

/* ==========================================================================
   ACTION CARD
   ========================================================================== */
.action-card-wrapper {
  margin-bottom: 1.5rem;
}

.action-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--p-line);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.02);
}

.action-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--p-text);
  margin-bottom: 0.35rem;
}

.action-text {
  color: var(--p-muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn-mobile-filter {
  display: none;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  border: 1px solid var(--p-line);
  background: white;
  color: var(--p-text-soft);
  cursor: pointer;
  position: relative;
}

.btn-mobile-filter.active {
  background: var(--p-accent);
  color: white;
  border-color: var(--p-accent);
}

.btn-mobile-refresh {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--p-line);
  border-radius: 0.5rem;
  color: var(--p-text-soft);
  background: white;
  transition: all 0.3s ease;
}

.btn-print {
  background: var(--p-accent);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-print:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 61, 246, 0.3);
}

/* Filter indicator */
.filter-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #dc3545;
  border-radius: 50%;
  margin-left: 4px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ==========================================================================
   KATEGORI SECTIONS (LAYAR)
   ========================================================================== */
.kategori-section {
  background-color: var(--p-card-bg);
  border-radius: 1rem;
  padding: 1.75rem;
  border: 1px solid var(--p-line);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
  margin-bottom: var(--p-section-gap);
}

.kategori-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--p-accent-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.kategori-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--p-text);
  letter-spacing: -0.01em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kategori-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--p-accent-gradient);
  border-radius: 50px;
}

.kategori-description {
  color: var(--p-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-top: 0.25rem;
}

.kategori-badge {
  background: var(--p-accent-gradient);
  color: #ffffff;
  padding: 0.4rem 1.2rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 10px rgba(0, 61, 246, 0.2);
  white-space: nowrap;
}

/* ==========================================================================
   GRID & ITEMS (LAYAR)
   ========================================================================== */
.perlengkapan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--p-gap);
}

.perlengkapan-item {
  border-radius: 0.5rem;
  padding: 1.5rem;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  transform: translateY(20px);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--p-line);
}

.perlengkapan-item.item-visible {
  opacity: 1;
  transform: translateY(0);
}

.perlengkapan-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 40px -15px rgba(0, 61, 246, 0.25);
  border-color: transparent;
}

.perlengkapan-item:hover::before {
  opacity: 1;
}

.perlengkapan-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--p-accent-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Category specific backgrounds */
.kategori-wajib .perlengkapan-item {
  background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
}

.kategori-saran .perlengkapan-item {
  background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

.kategori-opsional .perlengkapan-item {
  background: linear-gradient(135deg, #f0fff4 0%, #ffffff 100%);
}

/* Category specific borders */
.kategori-wajib .perlengkapan-item::before {
  background: linear-gradient(135deg, #dc3545, #ff6b6b);
}

.kategori-saran .perlengkapan-item::before {
  background: linear-gradient(135deg, #ffc107, #ffd966);
}

.kategori-opsional .perlengkapan-item::before {
  background: linear-gradient(135deg, #28a745, #34ce57);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.item-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--p-text);
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
}

.item-jenis {
  background: var(--p-accent-soft);
  color: var(--p-accent);
  padding: 0.2rem 0.9rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid rgba(0, 61, 246, 0.1);
}

.item-keterangan {
  color: var(--p-text-soft);
  line-height: 1.6;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  padding-right: 0.5rem;
}

.item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--p-muted);
  padding-top: 0.75rem;
  border-top: 1px solid var(--p-line);
}

.item-urutan {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.item-urutan::before {
  content: '⚡';
  font-size: 0.9rem;
  opacity: 0.7;
}

.item-status {
  font-weight: 600;
  color: var(--p-accent);
  background: var(--p-accent-soft);
  padding: 0.2rem 0.8rem;
  border-radius: 50px;
  font-size: 0.7rem;
  border: 1px solid rgba(0, 61, 246, 0.1);
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--p-muted);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 1rem;
  border: 2px dashed var(--p-line);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.02);
}

.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  opacity: 0.5;
  color: var(--p-accent);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.empty-state h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--p-text);
  margin-bottom: 0.75rem;
}

/* ==========================================================================
   INFO ALERT (LAYAR)
   ========================================================================== */
.alert-info {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  border: 1px solid #bae6fd;
  border-radius: 1rem;
  padding: 1.5rem;
  color: #0369a1;
  box-shadow: 0 8px 25px rgba(3, 105, 161, 0.08);
  margin-top: 2rem;
}

.alert-info h5 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #0369a1;
}

.alert-info ul {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 0;
}

.alert-info li {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.9rem;
}

.alert-info li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #0369a1;
  font-weight: 700;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.perlengkapan-hero,
.filter-bar,
.action-card-wrapper,
.kategori-section {
  animation: slideUp 0.6s ease-out forwards;
}

.kategori-section:nth-child(1) {
  animation-delay: 0.1s;
}

.kategori-section:nth-child(2) {
  animation-delay: 0.15s;
}

.kategori-section:nth-child(3) {
  animation-delay: 0.2s;
}

.spinner {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   RESPONSIVE - MOBILE
   ========================================================================== */
@media (max-width: 991.98px) {
  .perlengkapan-client-wrap {
    --p-pad-x: 1.25rem;
    --p-gap: 1.25rem;
  }

  .perlengkapan-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 767.98px) {
  .perlengkapan-client-wrap {
    --p-pad-x: 1rem;
    --p-gap: 1rem;
    --p-section-gap: 1.5rem;
  }

  .perlengkapan-hero {
    padding: 1.75rem 1.25rem;
  }

  .perlengkapan-hero h2 {
    font-size: 1.35rem;
  }

  .stats-overview {
    padding: 1rem 0.75rem;
    margin-top: 1rem;
  }

  .stat-number {
    font-size: 1.25rem;
  }

  .kategori-section {
    padding: 1.25rem;
  }

  .kategori-title {
    font-size: 1.1rem;
  }

  .kategori-badge {
    padding: 0.25rem 0.8rem;
    font-size: 0.75rem;
  }

  .perlengkapan-grid {
    grid-template-columns: 1fr;
  }

  .perlengkapan-item {
    padding: 1.25rem;
  }

  .item-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .btn-mobile-filter,
  .btn-mobile-refresh {
    display: inline-flex;
  }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {

  /* Sembunyikan semua elemen yang tidak perlu */
  .perlengkapan-hero,
  .filter-bar,
  .action-card-wrapper,
  .alert-info,
  .modal,
  .btn,
  .btn-mobile-filter,
  .btn-mobile-refresh,
  .btn-print,
  .btn-filter,
  .btn-refresh-icon,
  .btn-refresh-link,
  .filter-active-info,
  .stats-overview,
  footer,
  header,
  .site-header,
  .site-footer,
  .app-header,
  .app-footer,
  .mobile-bottom-nav,
  .no-print,
  .global-loader,
  .loading-overlay,
  .toast,
  .offcanvas,
  .dropdown,
  .navbar,
  [class*="fab"],
  [class*="floating"],
  [class*="dial"] {
    display: none !important;
  }

  /* Setting halaman */
  @page {
    size: A4 portrait;
    margin: 1.5cm;
  }

  body {
    background: white !important;
    font-family: 'Times New Roman', Times, serif !important;
    color: #000 !important;
    line-height: 1.2 !important;
  }

  /* Tampilkan konten utama */
  main,
  .app-content,
  .perlengkapan-main {
    display: block !important;
    width: 100% !important;
    background: white !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Tampilkan elemen print */
  .print-only {
    display: block !important;
  }

  table.print-table.print-only {
    display: table !important;
  }

  /* Header judul */
  .print-header {
    text-align: center;
    margin-bottom: 20px;
  }

  .print-title {
    font-size: 18pt;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px;
  }

  .print-subtitle {
    font-size: 11pt;
    color: #333;
    margin-bottom: 10px;
  }

  .print-date {
    font-size: 10pt;
    text-align: right;
    margin-bottom: 15px;
    font-style: italic;
  }

  /* Tabel utama */
  table.print-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 10pt;
  }

  table.print-table th {
    background-color: #e0e0e0 !important;
    font-weight: bold;
    text-align: center;
    padding: 8px 6px;
    border: 1px solid #000;
    font-size: 11pt;
  }

  table.print-table td {
    padding: 6px;
    border: 1px solid #333;
    vertical-align: top;
  }

  table.print-table tr {
    page-break-inside: avoid;
  }

  /* Style untuk baris kategori */
  tr.print-category-row td {
    background-color: #f0f0f0 !important;
    font-weight: bold;
    padding: 8px 6px;
    border: 1px solid #000;
  }

  .print-category-text {
    font-size: 12pt;
    text-transform: uppercase;
  }

  .print-category-desc {
    font-size: 9pt;
    font-weight: normal;
    color: #555;
    margin-left: 10px;
  }

  /* Kolom tabel */
  .col-no {
    width: 5%;
    text-align: center;
  }

  .col-nama {
    width: 25%;
  }

  .col-kategori {
    width: 15%;
  }

  .col-jenis {
    width: 15%;
  }

  .col-keterangan {
    width: 40%;
  }

  /* Style untuk teks */
  .print-nama {
    font-weight: 600;
  }

  .print-kategori {
    font-weight: 500;
  }

  .kategori-wajib {
    color: #b71c1c;
  }

  .kategori-saran {
    color: #bf360c;
  }

  .kategori-opsional {
    color: #1b5e20;
  }

  .print-jenis {
    font-style: italic;
  }

  /* Footer catatan */
  .print-footer {
    margin-top: 30px;
    font-size: 9pt;
    border-top: 1px solid #999;
    padding-top: 10px;
  }

  .print-footer p {
    margin: 3px 0;
  }
}
