/* ============================================================
   TABLE ENHANCE CSS v2 — DigitalPox
   ============================================================ */

@keyframes dp-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50%      { box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

/* ── Wrapper ── */
.dataTables_wrapper { padding: 0; }

.dp-top {
  padding: 12px 16px 10px;
  background: #f8fafc;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  border-radius: 12px 12px 0 0;
  align-items: center;
}

.dp-bot {
  padding: 10px 16px;
  background: #f8fafc;
  border-top: 1px solid rgba(0,0,0,0.05);
  border-radius: 0 0 12px 12px;
  align-items: center;
}

/* ── Length label ── */
.dataTables_length label {
  font-size: 13px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
}

.dataTables_length select {
  height: 34px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
  border: 1.5px solid #e2e8f0 !important;
  padding: 0 8px !important;
  min-width: 80px;
  cursor: pointer;
  background: #fff;
  color: #374151;
}

/* ── Export Buttons ── */
.dt-buttons { display: flex; gap: 6px; flex-wrap: wrap; }

.dp-btn {
  height: 34px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #ffffff !important;
  color: #475569 !important;
  transition: all 0.2s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06) !important;
  cursor: pointer;
}

.dp-btn:hover {
  background: linear-gradient(135deg,#00775a,#06dca8) !important;
  color: #fff !important;
  border-color: transparent !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(0,119,90,0.25) !important;
}

/* Individual button colors on hover */
.dp-btn:nth-child(1):hover { background: linear-gradient(135deg,#475569,#64748b) !important; }
.dp-btn:nth-child(3):hover { background: linear-gradient(135deg,#217346,#2d9d5c) !important; box-shadow: 0 4px 12px rgba(33,115,70,0.3) !important; }
.dp-btn:nth-child(4):hover { background: linear-gradient(135deg,#e53e3e,#fc8181) !important; box-shadow: 0 4px 12px rgba(229,62,62,0.3) !important; }

/* ── Table ── */
table.dp-done thead th {
  background: #f1f5f9 !important;
  color: #374151 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  padding: 12px 14px !important;
  border-bottom: 2px solid #e2e8f0 !important;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

table.dp-done thead th:hover {
  background: #e8f0fe !important;
  color: #00775a !important;
}

table.dp-done thead th.sorting_asc  { color: #00775a !important; }
table.dp-done thead th.sorting_desc { color: #00775a !important; }

table.dp-done tbody tr { transition: background 0.15s; }
table.dp-done tbody tr:hover { background: rgba(0,119,90,0.04) !important; }

table.dp-done tbody td {
  padding: 11px 14px !important;
  font-size: 13.5px !important;
  color: #374151;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: middle !important;
}

/* ── Info ── */
.dataTables_info {
  font-size: 13px;
  color: #64748b;
  padding-top: 2px;
}
.dataTables_info b { color: #00775a; font-weight: 700; }

/* ── Pagination ── */
.dataTables_paginate { display: flex; justify-content: flex-end; }
.dataTables_paginate .pagination { gap: 3px; margin: 0; }

.dataTables_paginate .page-item .page-link {
  border-radius: 8px !important;
  font-size: 13px;
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #e2e8f0;
  color: #475569;
  font-weight: 500;
  transition: all 0.15s;
  background: #fff;
}

.dataTables_paginate .page-item .page-link:hover {
  background: rgba(0,119,90,0.08);
  border-color: #00775a;
  color: #00775a;
}

.dataTables_paginate .page-item.active .page-link {
  background: linear-gradient(135deg,#00775a,#06dca8) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 3px 10px rgba(0,119,90,0.3);
}

.dataTables_paginate .page-item.disabled .page-link {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Responsive collapse button ── */
table.dp-done.dtr-inline.collapsed > tbody > tr > td.dtr-control::before,
table.dp-done.dtr-inline.collapsed > tbody > tr > th.dtr-control::before {
  background: linear-gradient(135deg,#00775a,#06dca8) !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(0,119,90,0.3);
}

/* ════════════════════════════════
   DARK MODE
   ════════════════════════════════ */
html.dark-theme .dp-top,
html.dark-theme .dp-bot {
  background: #1a1d27;
  border-color: rgba(255,255,255,0.06);
}

html.dark-theme .dataTables_length label,
html.dark-theme .dataTables_info { color: #7c8aa0; }

html.dark-theme .dataTables_length select {
  background: #0f1117 !important;
  color: #e2e8f0 !important;
  border-color: rgba(255,255,255,0.10) !important;
}

html.dark-theme .dp-btn {
  background: #222639 !important;
  color: #94a3b8 !important;
  border-color: rgba(255,255,255,0.08) !important;
}
html.dark-theme .dp-btn:hover { color: #fff !important; }

html.dark-theme table.dp-done thead th {
  background: #222639 !important;
  color: #94a3b8 !important;
  border-bottom-color: rgba(255,255,255,0.08) !important;
}
html.dark-theme table.dp-done thead th:hover {
  background: #2a2e42 !important;
  color: #00c48c !important;
}
html.dark-theme table.dp-done thead th.sorting_asc,
html.dark-theme table.dp-done thead th.sorting_desc { color: #00c48c !important; }

html.dark-theme table.dp-done tbody td {
  color: #e2e8f0 !important;
  border-bottom-color: rgba(255,255,255,0.04) !important;
}
html.dark-theme table.dp-done tbody tr:hover { background: rgba(0,196,140,0.05) !important; }

html.dark-theme .dataTables_info b { color: #00c48c; }

html.dark-theme .dataTables_paginate .page-item .page-link {
  background: #1a1d27;
  border-color: rgba(255,255,255,0.08);
  color: #94a3b8;
}
html.dark-theme .dataTables_paginate .page-item .page-link:hover {
  background: rgba(0,196,140,0.10);
  border-color: #00c48c;
  color: #00c48c;
}
html.dark-theme .dataTables_paginate .page-item.active .page-link {
  box-shadow: 0 3px 10px rgba(0,196,140,0.2);
}

/* ════════════════════════════════
   MOBILE
   ════════════════════════════════ */
@media (max-width: 767px) {
  .dp-top, .dp-bot {
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px;
  }
  .dp-top > div,
  .dp-bot > div {
    width: 100% !important;
    justify-content: flex-start !important;
  }
  .dt-buttons { flex-wrap: wrap; gap: 5px; }
  .dp-btn {
    font-size: 11px !important;
    padding: 0 8px !important;
    height: 30px !important;
  }
  .dataTables_paginate { justify-content: center; }
  .dataTables_info { text-align: center; }
  table.dp-done tbody td { font-size: 12px !important; padding: 8px 10px !important; }
}


/* ── Hide React status filter buttons (Pending/Approved/Rejected/Live etc) ── */
.col-md-7.text-end .btn-group,
.col-md-7.text-end .btn-group * {
  display: none !important;
}


/* ── Prevent duplicate toolbars ── */
.dp-toolbar + .dp-toolbar { display: none !important; }

/* ── Male / Female badge colors (React existing badges) ── */
td span[class*="badge"]:not(.dp-badge),
td .badge {
  font-size: 12px !important;
  font-weight: 600 !important;
  padding: 4px 10px !important;
  border-radius: 20px !important;
}

/* Find spans containing only "Male" or "Female" text via attribute/content */
/* Use text-based targeting via has selector */
td span.badge-male,
td span[style*="Male"],
td .text-male { 
  background: rgba(37,99,235,0.12) !important;
  color: #2563eb !important;
}

/* CSS-only: target React badges by their text content using attribute */
/* Female — pink */
tbody td span:not(.dp-badge)[class] {
  /* Will be overridden by JS class injection below */
}

/* ── Gender colors force override ── */
.dp-gender-male   { background: rgba(37,99,235,0.12)  !important; color: #2563eb !important; border: 1px solid rgba(37,99,235,0.25)  !important; }
.dp-gender-female { background: rgba(236,72,153,0.12) !important; color: #ec4899 !important; border: 1px solid rgba(236,72,153,0.3)   !important; }


/* ── Pagination Bar ── */
.dp-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  padding: 12px 4px 4px;
  flex-wrap: wrap;
}

.dp-page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dp-page-btn:hover:not([disabled]) {
  background: rgba(0,119,90,0.08);
  border-color: #00775a;
  color: #00775a;
}

.dp-page-btn.active {
  background: linear-gradient(135deg, #00775a, #06dca8);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 10px rgba(0,119,90,0.3);
}

.dp-page-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.dp-page-dots {
  color: #94a3b8;
  font-size: 13px;
  padding: 0 4px;
}

/* Dark mode pagination */
html.dark-theme .dp-page-btn {
  background: #1a1d27;
  border-color: rgba(255,255,255,0.08);
  color: #94a3b8;
}
html.dark-theme .dp-page-btn:hover:not([disabled]) {
  background: rgba(0,196,140,0.10);
  border-color: #00c48c;
  color: #00c48c;
}
html.dark-theme .dp-page-btn.active {
  box-shadow: 0 3px 10px rgba(0,196,140,0.2);
}

/* ── Upload Progress Bar ── */
.dp-progress-wrap {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dp-progress-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.dp-progress-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 36px 40px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  text-align: center;
}

.dp-progress-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dp-progress-title i { color: #00775a; font-size: 22px; }

.dp-progress-bar-track {
  background: #f1f5f9;
  border-radius: 100px;
  height: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}

.dp-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00775a, #06dca8);
  border-radius: 100px;
  transition: width 0.15s ease;
  box-shadow: 0 0 12px rgba(0, 119, 90, 0.4);
}

.dp-progress-pct {
  font-size: 28px;
  font-weight: 800;
  color: #00775a;
  margin-bottom: 8px;
}

.dp-progress-msg {
  font-size: 13px;
  color: #64748b;
  min-height: 20px;
}

/* Dark mode */
html.dark-theme .dp-progress-box {
  background: #1a1d27;
}
html.dark-theme .dp-progress-title { color: #e2e8f0; }
html.dark-theme .dp-progress-bar-track { background: #2a2e42; }
html.dark-theme .dp-progress-msg { color: #7c8aa0; }
html.dark-theme .dp-progress-pct { color: #00c48c; }

/* ── Form Validation Error Toast ── */
.dp-form-error {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  background: #fff;
  border: 2px solid #e53e3e;
  border-radius: 14px;
  padding: 16px 48px 16px 20px;
  box-shadow: 0 8px 32px rgba(229,62,62,0.25);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 320px;
  max-width: 480px;
  animation: dp-slide-down 0.3s ease;
}

@keyframes dp-slide-down {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.dp-form-error-icon {
  color: #e53e3e;
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}

.dp-form-error-text {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.6;
}

.dp-form-error-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 20px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.dp-form-error-close:hover { color: #e53e3e; }

/* Dark mode */
html.dark-theme .dp-form-error {
  background: #1a1d27;
  border-color: #e53e3e;
}
html.dark-theme .dp-form-error-text { color: #e2e8f0; }