/* ========================================
   11. PAITO TABLE (PAITO WARNA)
   ======================================== */

.pw-wrapper {
  font-size: 14px;
  padding: 0px !important;
}

.pw-wrapper.dark-mode {
  color: #e0e0e0;
}

.pw-card {
  background-color: #fafafa;
  border: 2px solid #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.pw-wrapper.dark-mode .pw-card {
  background: #1e1e1e;
  border: 1px solid #333;
}

.pw-toolbar {
  padding: 12px;
  border-radius: 6px;
  position: sticky;
  top: 0px;
  z-index: 1020;
  margin-bottom: 15px;
}

.pw-toolbar.mode-putih {
  background-color: #fafafa;
  border: 2px solid #fff;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.pw-toolbar.mode-hitam {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border: 1px solid #444;
}

.pw-toolbar .form-control {
  height: auto;
  padding: 6px 8px;
  font-size: 14px;
}

.pw-toolbar.mode-putih .form-control {
  background: #fff;
  color: #333;
  border-color: #ddd;
}

.pw-toolbar.mode-hitam .form-control {
  background: #2c2c2c;
  color: #fff;
  border-color: #555;
}

.pw-table-wrap {
  overflow-x: auto;
}

#pw-table {
  width: auto;
  border-collapse: collapse;
  text-align: center;
  font-size: 13px;
  min-width: 220px;
  background: #fff;
}

.pw-wrapper.dark-mode #pw-table {
  background: #1e1e1e;
}

#pw-table td,
#pw-table th {
  border: 1px solid #dee2e6;
  padding: 0;
  height: 22px;
  width: 22px;
}

.pw-wrapper.dark-mode #pw-table td,
.pw-wrapper.dark-mode #pw-table th {
  border-color: #333;
}

#pw-table .head td {
  background: linear-gradient(0deg, rgba(10, 10, 10, 1) 0%, rgba(64, 64, 64, 1) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  padding: 3px 0px;
}

.pw-wrapper.dark-mode #pw-table .head td {
  background: linear-gradient(0deg, rgba(10, 10, 10, 1) 0%, rgba(64, 64, 64, 1) 100%);
}

#pw-table .asu {
  font-weight: bold;
  color: #333;
  cursor: default;
}

.pw-wrapper.dark-mode #pw-table .asu {
  color: #ddd;
}

#pw-table .asux {
  font-weight: normal;
  color: #888;
  background: #f8f9fa;
}

.pw-wrapper.dark-mode #pw-table .asux {
  background: #252525;
  color: #aaa;
}

/* Paito List View */
#pw-table.list-view {
  width: auto;
  border-collapse: collapse;
  text-align: center;
  font-size: 13px;
  min-width: 220px;
  background: #fff;
}

#pw-table.list-view th {
  background: #343a40;
  color: #fff;
  padding: 5px;
  width: auto;
  font-size: 12px;
}

#pw-table.list-view td {
  padding: 0;
  width: auto;
  min-width: 24px;
  font-size: 15px;
}

#pw-table.list-view td.tgl-col,
#pw-table.list-view td.hri-col {
  padding: 0px 6px;
  font-size: 12px;
  background-color: #f9f9f9;
  color: #666666;
}

#pw-table.list-view td.psr-col {
  padding: 0px 6px;
  font-size: 12px;
  background-color: #f9f9f9;
  color: #383838;
}

.pw-wrapper.dark-mode #pw-table.list-view td.tgl-col {
  background-color: #252525;
}

.pw-wrapper.dark-mode #pw-table.list-view td.hri-col {
  background-color: #252525;
}

.pw-wrapper.dark-mode #pw-table.list-view td.psr-col {
  background-color: #252525;
  color: #9e9e9e;
}

/* Paito Zebra Striping */
#pw-table:not(.list-view) tr:nth-last-child(5n + 1) {
  background: rgba(0, 0, 0, 0.09) !important;
}

.pw-wrapper.dark-mode #pw-table:not(.list-view) tr:nth-last-child(5n + 1) {
  background: rgba(255, 255, 255, 0.09) !important;
}

#pw-table.list-view tbody tr:nth-child(odd) {
  background-color: #f9f9f9;
}

.pw-wrapper.dark-mode #pw-table.list-view tbody tr:nth-child(odd) {
  background-color: #252525;
}

/* Paito Palette & Highlight Colors */
.pw-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 10px;
}

.pw-palette-item {
  height: 26px;
  flex-grow: 2;
  min-width: 26px;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: transform 0.2s;
}

.pw-palette-item:hover {
  transform: scale(1.1);
}

.pw-palette-item.active {
  border-color: #000;
}

.pw-wrapper.dark-mode .pw-palette-item.active {
  border-color: #fff;
}

.pw-search-wrap {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 15px;
  border-radius: 6px;
}

.pw-wrapper.dark-mode .pw-search-wrap {
  background: #1e1e1e;
  border-color: #333;
}

.pw-search-input {
  border-width: 2px !important;
  text-align: center;
  font-weight: bold;
  padding: 4px;
}

.pw-h-d1 { background-color: #dc3545 !important; color: #fff !important; }
.pw-h-d2 { background-color: #007bff !important; color: #fff !important; }
.pw-h-d3 { background-color: #28a745 !important; color: #fff !important; }
.pw-h-d4 { background-color: #fd7e14 !important; color: #fff !important; }
.pw-h-d5 { background-color: #6f42c1 !important; color: #fff !important; }
.pw-h-d6 { background-color: #17a2b8 !important; color: #fff !important; }

.pw-jl1, .pw-jl2, .pw-jl3, .pw-jl4, .pw-jl5, .pw-jl6, .pw-jl7, .pw-jl8, .pw-jl9, .pw-jl0 {
  background-color: #343a40 !important;
  color: #fff !important;
  font-weight: bold;
}

/* Live Result Box */
.pw-live-result {
  margin-bottom: 15px;
  transition: all 0.3s ease;
  padding: 15px;
  border-radius: 6px;
  background-color: #fafafa;
  border: 2px solid #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.pw-wrapper.dark-mode .pw-live-result {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border: 1px solid #444;
}

.pw-live-result h2 {
  font-size: 1.1rem;
  margin-bottom: 5px;
  font-weight: 700;
}

.pw-live-result .num {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 3px;
}

@media (max-width: 768px) {
  .form-group-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .form-inline {
    justify-content: center;
    flex-wrap: wrap;
  }

  /* Adjustments for Paito on Mobile */
  #pw-table {
    font-size: 11px;
    min-width: 200px;
  }

  #pw-table td, #pw-table th {
    height: 18px;
  }

  .pw-live-result .num {
    font-size: 2rem;
  }

  #pw-table .head td,
  .pw-wrapper.dark-mode #pw-table .head td {
    font-weight: normal;
  }

  .head td {
    font-size: 11px;
  }

  .asu, .asux {
    min-width: 16px;
    line-height: 16px;
    font-size: 12px;
  }

  .single-view {
    padding: 0px !important;
  }

  #pw-table.list-view th {
    padding: 4px;
  }

  #pw-table.list-view td {
    padding: 0px 5px;
    font-size: 14px;
  }

  #pw-table.list-view td.tgl-col,
  #pw-table.list-view td.hri-col,
  #pw-table.list-view td.psr-col {
    padding: 0px 4px;
    font-size: 12px;
  }
}