/* ========================================
   STYLE PAITON TABLE (PAITO WARNA)
   ======================================== */

/* --- Base Wrapper --- */
.pw-wrapper {
  font-size: 14px;
  padding: 0 !important;
}
.pw-wrapper.dark-mode {
  color: #e0e0e0;
}

/* --- Card --- */
.pw-card {
  background: #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;
}

/* --- Toolbar --- */
.pw-toolbar {
  padding: 12px;
  border-radius: 6px;
  position: sticky;
  top: 0;
  z-index: 1020;
  margin-bottom: 15px;
}
.pw-toolbar.mode-putih {
  background: #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, #2d2d2d);
  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;
}

/* --- Table --- */
.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 #d1d1d1;
  padding: 0;
  width: 22px;
}
.pw-wrapper.dark-mode #pw-table td,
.pw-wrapper.dark-mode #pw-table th {
  border-color: #333;
}
#pw-table .head td {
  background: #ebe8e8;
  color: #222;
  font-weight: 600;
  font-size: 12px;
  padding: 3px 0;
}
.pw-wrapper.dark-mode #pw-table .head td {
  background: linear-gradient(0deg, #0a0a0a, #404040);
  color: #fff;
}
#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;
  cursor: default;
}
.pw-wrapper.dark-mode #pw-table .asux {
  background: #252525;
  color: #aaa;
}

/* --- 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: 0 6px;
  font-size: 12px;
  background: #f9f9f9;
  color: #666;
}
#pw-table.list-view td.psr-col {
  padding: 0 6px;
  font-size: 12px;
  background: #f9f9f9;
  color: #383838;
}
.pw-wrapper.dark-mode #pw-table.list-view td.tgl-col,
.pw-wrapper.dark-mode #pw-table.list-view td.hri-col,
.pw-wrapper.dark-mode #pw-table.list-view td.psr-col {
  background: #252525;
  color: #9e9e9e;
}

/* --- Zebra Striping --- */
#pw-table:not(.list-view) tr:nth-last-child(5n + 1) {
  background: #ebe8e8 !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-last-child(5n + 1) {
  background: #f0f0f0;
}
.pw-wrapper.dark-mode #pw-table.list-view tbody tr:nth-last-child(5n + 1) {
  background: #252525;
}

/* --- Palette --- */
.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: 4px;
  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;
}

/* --- Search --- */
.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: 1px !important;
  text-align: center;
  font-weight: bold;
  padding: 4px;
}

/* --- Highlight Colors --- */
.pw-h-d1 { background: #dc3545 !important; color: #fff !important; }
.pw-h-d2 { background: #007bff !important; color: #fff !important; }
.pw-h-d3 { background: #28a745 !important; color: #fff !important; }
.pw-h-d4 { background: #fd7e14 !important; color: #fff !important; }
.pw-h-d5 { background: #6f42c1 !important; color: #fff !important; }
.pw-h-d6 { background: #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: #8c8c8c !important;
  color: #fff !important;
  font-weight: bold;
}

/* --- Live Result --- */
.pw-live-result {
  margin-bottom: 15px;
  transition: all 0.3s ease;
  padding: 15px;
  border-radius: 6px;
  background: #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, #2d2d2d);
  border: 1px solid #444;
}
.pw-live-result h2 {
  font-size: 1.1rem;
  margin-bottom: 5px;
  font-weight: 700;
}
.pw-live-result .date {
  font-size: 0.8rem;
  font-weight: 500;
}

/* --- 3D Balls --- */
.pw-balls-container {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pw-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
  transform: translateY(-30px) scale(0.5);
  opacity: 0;
  animation: pw-ball-drop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: transform 0.2s;
  margin-bottom: 15px;
  margin-top: 15px;
}
.pw-ball:hover {
  transform: translateY(-4px) scale(1.2);
}
.pw-ball.void {
  background: linear-gradient(135deg, #475569, #1e293b);
  color: #94a3b8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3),
              inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}
.pw-ball::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 10px;
  width: 12px;
  height: 8px;
  background: radial-gradient(ellipse, rgba(255, 255, 255, 0.6), transparent);
  border-radius: 50%;
  transform: rotate(-20deg);
}
@keyframes pw-ball-drop {
  0%   { transform: translateY(-30px) scale(0.5); opacity: 0; }
  60%  { transform: translateY(4px) scale(1.05);   opacity: 1; }
  100% { transform: translateY(0) scale(1);         opacity: 1; }
}

/* ========================================
   SEO ENHANCED COMPONENTS
   ======================================== */

/* --- Breadcrumb --- */
.acp-breadcrumb {
  font-size: 13px;
  color: #666;
  margin-bottom: 15px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
.acp-breadcrumb a {
  color: #007bff;
  text-decoration: none;
  transition: color 0.2s;
}
.acp-breadcrumb a:hover {
  text-decoration: underline;
}
.acp-breadcrumb .separator {
  margin: 0 8px;
  color: #999;
}
.pw-wrapper.dark-mode .acp-breadcrumb {
  color: #aaa;
  border-color: #333;
}
.pw-wrapper.dark-mode .acp-breadcrumb a {
  color: #5dade2;
}

/* --- Stats Bar --- */
.acp-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px;
  margin-bottom: 15px;
  justify-content: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 10px;
}
.pw-wrapper.dark-mode .acp-stats-bar {
  background: linear-gradient(135deg, #0f3460, #533483);
}
.acp-stat-item {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  backdrop-filter: blur(5px);
  transition: transform 0.2s, box-shadow 0.2s;
}
.acp-stat-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.acp-stat-item .stat-value {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.acp-stat-item .stat-label {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Hot / Cold Bar --- */
.acp-hot-cold-bar {
  display: flex;
  gap: 15px;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e0e0e0;
}
.pw-wrapper.dark-mode .acp-hot-cold-bar {
  background: #16213e;
  border-color: #ededed;
}
.acp-hot-section,
.acp-cold-section {
  flex: 1;
}
.acp-hot-section h4 {
  color: #dc3545;
  margin: 0 0 10px;
  font-size: 14px;
}
.acp-cold-section h4 {
  color: #007bff;
  margin: 0 0 10px;
  font-size: 14px;
}
.acp-hot-cold-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  padding: 6px 2px;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}
.acp-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
}
.acp-hot-number {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: #fff;
  box-shadow: 0 2px 6px rgba(238, 90, 36, 0.3);
}
.acp-cold-number {
  background: linear-gradient(135deg, #74b9ff, #0984e3);
  color: #fff;
  box-shadow: 0 2px 6px rgba(9, 132, 227, 0.3);
}

/* --- Frequency Bar --- */
.acp-frequency-bar {
  margin-bottom: 15px;
  padding: 10px;
}
.acp-frequency-bar h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #333;
}
.pw-wrapper.dark-mode .acp-frequency-bar h4 {
  color: #e0e0e0;
}
.acp-freq-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}
.acp-freq-cell {
  text-align: center;
  padding: 6px 2px;
  border-radius: 4px;
  font-size: 12px;
}
.acp-freq-cell .freq-num {
  display: block;
  font-weight: 700;
  font-size: 16px;
}
.acp-freq-cell .freq-count {
  display: block;
  font-size: 10px;
  color: #666;
  margin-top: 2px;
}
.pw-wrapper.dark-mode .acp-freq-cell .freq-count {
  color: #999;
}

/* --- Gap Analysis --- */
.acp-gap-analysis {
  padding: 10px;
  margin-bottom: 15px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}
.pw-wrapper.dark-mode .acp-gap-analysis {
  background: #16213e;
  border-color: #0f3460;
}
.acp-gap-analysis h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #333;
}
.pw-wrapper.dark-mode .acp-gap-analysis h4 {
  color: #e0e0e0;
}
.acp-gap-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}
.acp-gap-cell {
  text-align: center;
  padding: 6px 2px;
  border-radius: 4px;
  font-size: 11px;
}
.acp-gap-cell .gap-num {
  display: block;
  font-weight: 700;
  font-size: 14px;
}
.acp-gap-cell .gap-val {
  display: block;
  font-size: 10px;
  color: #666;
  margin-top: 2px;
}
.pw-wrapper.dark-mode .acp-gap-cell .gap-val {
  color: #999;
}

/* --- Related Pasaran --- */
.acp-related-section {
  margin-top: 20px;
  padding: 15px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 6px;
}
.acp-related-section h3 {
  font-size: 1rem;
  margin: 0 0 12px;
  color: #333;
}
.acp-related-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.acp-related-link {
  display: inline-block;
  padding: 6px 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  color: #333;
  text-decoration: none;
  transition: all 0.2s;
}
.acp-related-link:hover {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
  transform: translateY(-1px);
}
.pw-wrapper.dark-mode .acp-related-section {
  background: #1e1e1e;
  border-color: #333;
}
.pw-wrapper.dark-mode .acp-related-section h3 {
  color: #fff;
}
.pw-wrapper.dark-mode .acp-related-link {
  background: #0f3460;
  border-color: #555;
  color: #e0e0e0;
}
.pw-wrapper.dark-mode .acp-related-link:hover {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}

/* --- FAQ --- */
.acp-faq-section {
  margin-top: 20px;
  padding: 15px;
  margin-bottom: 15px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}
.acp-faq-section h3 {
  margin: 0 0 15px;
  font-size: 16px;
  color: #333;
}
.acp-faq-item {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s;
}
.acp-faq-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.acp-faq-question {
  padding: 12px 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  transition: background 0.2s;
  user-select: none;
}
.acp-faq-question:hover {
  background: #e9ecef;
}
.acp-faq-question .arrow {
  transition: transform 0.3s;
  font-size: 12px;
  flex-shrink: 0;
  margin-left: 10px;
}
.acp-faq-item.active .acp-faq-question .arrow {
  transform: rotate(180deg);
}
.acp-faq-answer {
  padding: 0 15px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  line-height: 1.6;
  font-size: 14px;
  color: #555;
}
.acp-faq-item.active .acp-faq-answer {
  padding: 15px;
  max-height: 500px;
}
.pw-wrapper.dark-mode .acp-faq-section {
  background: #16213e;
  border-color: #0f3460;
}
.pw-wrapper.dark-mode .acp-faq-section h3 {
  color: #fff;
}
.pw-wrapper.dark-mode .acp-faq-item {
  border-color: #0f3460;
  background: #1e1e1e;
}
.pw-wrapper.dark-mode .acp-faq-question {
  background: #1a1a2e;
  color: #fff;
}
.pw-wrapper.dark-mode .acp-faq-question:hover {
  background: #333;
}
.pw-wrapper.dark-mode .acp-faq-answer {
  color: #ccc;
}
.pw-wrapper.dark-mode .acp-faq-answer div {
  color: #bbb;
}

/* --- Share Bar --- */
.acp-share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 15px;
  margin-bottom: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
}
.pw-wrapper.dark-mode .acp-share-bar {
  background: #16213e;
}
.acp-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}
.acp-share-btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}
.acp-share-btn.facebook  { background: #1877f2; }
.acp-share-btn.twitter   { background: #1da1f2; }
.acp-share-btn.whatsapp  { background: #25d366; }
.acp-share-btn.telegram  { background: #0088cc; }
.acp-share-btn.copy-link { background: #6c757d; }

/* --- Update Info --- */
.acp-update-info {
  text-align: center;
  padding: 10px;
  margin-top: 15px;
  font-size: 12px;
  color: #888;
  border-top: 1px solid #eee;
}
.pw-wrapper.dark-mode .acp-update-info {
  color: #777;
  border-color: #333;
}

/* --- Back to Top --- */
.acp-back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  background: #007bff;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
  z-index: 9999;
  transition: all 0.3s;
  opacity: 0;
  visibility: hidden;
}
.acp-back-to-top.visible {
  display: flex;
  opacity: 1;
  visibility: visible;
}
.acp-back-to-top:hover {
  background: #0056b3;
  transform: translateY(-3px);
}

/* ========================================
   RESPONSIVE
   ======================================== */

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

  /* Paito Table */
  #pw-table {
    min-width: 180px;
  }
  #pw-table th {
    height: 18px;
  }
  #pw-table .head td,
  .pw-wrapper.dark-mode #pw-table .head td {
    font-weight: normal;
    font-size: 12px;
  }
  .asu,
  .asux {
    min-width: 14px;
    line-height: 18px;
    font-size: 13px;
  }
  .single-view {
    padding: 0px !important;
  }

  /* List View */
  #pw-table.list-view th {
    padding: 3px;
  }
  #pw-table.list-view td {
    padding: 0 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: 0 4px;
    font-size: 12px;
  }

  /* Balls */
  .pw-ball {
    width: 33px;
    height: 33px;
    font-size: 18px;
  }

  /* SEO Components */
  .acp-stats-bar {
    flex-direction: column;
  }
  .acp-stat-item {
    min-width: auto;
    padding: 8px 10px;
  }
  .acp-stat-item .stat-value {
    font-size: 1rem;
  }
  .acp-freq-grid,
  .acp-gap-grid {
    grid-template-columns: repeat(5, 1fr);
  }
  .acp-hot-cold-bar {
    flex-direction: column;
  }
  .acp-share-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
  .acp-back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  .acp-related-link {
    padding: 5px 10px;
    font-size: 11px;
  }
  .acp-faq-question {
    padding: 10px 12px;
    font-size: 14px;
  }
  .acp-faq-answer {
    font-size: 13px;
  }
  .acp-breadcrumb {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .acp-stats-bar {
    gap: 4px;
  }
  .acp-stat-item {
    min-width: 70px;
    padding: 6px 8px;
    flex: 1;
  }
  .acp-stat-item .stat-value {
    font-size: 0.9rem;
  }
  .acp-stat-item .stat-label {
    font-size: 9px;
  }
  .acp-share-btn span {
    display: none;
  }
}