/* ==========================================================
   Simple IPTV Panel — Custom Styles
   ========================================================== */

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.dark ::-webkit-scrollbar-thumb { background: #475569; }

/* ==========================================================
   DataTables — Tailwind integration
   ========================================================== */
.dataTables_wrapper {
  padding: 0 !important;
  font-size: 0.875rem;
}

/* ---- Toolbar: export buttons + filter ---- */
.dataTables_wrapper .dt-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 0.875rem;
}

/* Row: length selector (left) + search filter (right) */
.dataTables_wrapper .dt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
  margin-bottom: 0.875rem;
}

/* Export buttons */
.dt-buttons .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 0.625rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  white-space: nowrap;
  transition: all 0.15s ease;
}
.dt-buttons .btn svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.dt-buttons .btn:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4f46e5;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.18);
  transform: translateY(-1px);
}
.dt-buttons .btn:active {
  transform: translateY(0);
  box-shadow: none;
}
.dt-buttons .btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
}
.dark .dt-buttons .btn {
  background: #1f2937;
  border-color: #374151;
  color: #d1d5db;
}
.dark .dt-buttons .btn:hover {
  background: #4f46e5;
  border-color: #6366f1;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

/* Search filter */
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 0;
  margin-left: auto;
}
.dataTables_wrapper .dataTables_filter label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6b7280;
  font-size: 0.875rem;
}
.dark .dataTables_wrapper .dataTables_filter label { color: #9ca3af; }
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #d1d5db;
  border-radius: 0.625rem;
  padding: 0.5rem 0.875rem;
  outline: none;
  font-size: 0.875rem;
  transition: all 0.15s;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.dark .dataTables_wrapper .dataTables_filter input {
  background: #1f2937;
  border-color: #374151;
  color: #f3f4f6;
}
.dark .dataTables_wrapper .dataTables_filter input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Length selector */
.dataTables_wrapper .dataTables_length {
  margin-bottom: 0;
}
.dataTables_wrapper .dataTables_length label {
  color: #6b7280;
  font-size: 0.875rem;
}
.dark .dataTables_wrapper .dataTables_length label { color: #9ca3af; }
.dataTables_wrapper .dataTables_length select {
  margin: 0 0.375rem;
  padding: 0.375rem 2rem 0.375rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  outline: none;
  font-size: 0.875rem;
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") no-repeat right 0.5rem center / 1rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: all 0.15s;
}
.dataTables_wrapper .dataTables_length select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.dark .dataTables_wrapper .dataTables_length select {
  background-color: #1f2937;
  border-color: #374151;
  color: #f3f4f6;
}

/* ---- Table ---- */
table.dataTable {
  border-collapse: collapse !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
table.dataTable thead th {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb !important;
  padding: 0.875rem 1rem !important;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  white-space: nowrap;
}
.dark table.dataTable thead th {
  background: #0f172a;
  border-bottom-color: #1f2937 !important;
  color: #94a3b8;
}
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc,
table.dataTable thead th.sorting:hover {
  color: #4f46e5 !important;
}
table.dataTable thead th .select-all-check {
  color: #374151;
}
table.dataTable tbody td {
  padding: 0.875rem 1rem !important;
  font-size: 0.875rem;
  border-bottom: 1px solid #f3f4f6;
}
.dark table.dataTable tbody td { border-bottom-color: #1f2937; }
table.dataTable tbody tr {
  transition: background-color 0.1s ease;
}
table.dataTable tbody tr:hover {
  background: #f9fafb !important;
}
.dark table.dataTable tbody tr:hover {
  background: #111827 !important;
}

/* ---- Info + pagination ---- */
.dataTables_wrapper .dataTables_info {
  padding-top: 0.875rem;
  font-size: 0.8125rem;
  color: #6b7280;
}
.dark .dataTables_wrapper .dataTables_info { color: #9ca3af; }
.dataTables_wrapper .dataTables_paginate {
  padding-top: 0.875rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 0.375rem 0.625rem;
  margin: 0 0.125rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
  background: #f3f4f6 !important;
  border-color: #9ca3af;
  color: #111827 !important;
}
.dark .dataTables_wrapper .dataTables_paginate .paginate_button {
  background: #1f2937 !important;
  border-color: #374151;
  color: #e5e7eb !important;
}
.dark .dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.current):not(.disabled) {
  background: #374151 !important;
  border-color: #4b5563;
  color: #f9fafb !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: #4f46e5 !important;
  border-color: #4f46e5;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}
.dark .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: #4f46e5 !important;
  border-color: #6366f1;
  color: #ffffff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---- Processing overlay ---- */
.dataTables_processing {
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid #e0e7ff !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08) !important;
  color: #4f46e5 !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  border-radius: 0.75rem !important;
  padding: 0.75rem 1.5rem !important;
  backdrop-filter: blur(4px);
}
.dark .dataTables_processing {
  background: rgba(17, 24, 39, 0.75) !important;
  border-color: #312e81 !important;
  color: #a5b4fc !important;
}

/* Badge / status pills */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-active { background: #d1fae5; color: #065f46; }
.badge-expired { background: #fee2e2; color: #991b1b; }
.badge-suspended { background: #fef3c7; color: #92400e; }
.dark .badge-active { background: #064e3b; color: #a7f3d0; }
.dark .badge-expired { background: #7f1d1d; color: #fca5a5; }
.dark .badge-suspended { background: #78350f; color: #fcd34d; }

@media (max-width: 767px) {
  .dataTables_wrapper table.dataTable {
    display: block;
    width: max-content;
    min-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

