/* public/css/admin.css - HoneyPair SuperAdmin Theme & Modern Web Guidance */

:root {
  --hp-primary: #8D1B36;
  --hp-primary-hover: #6E1328;
  --hp-bg: #FFF8F7;
  --hp-surface: #FFFFFF;
  --hp-surface-subtle: #FBF3F4;
  --hp-border: #E8CECB;
  --hp-text-dark: #2C2224;
  --hp-text-muted: #7A6B6E;
  --hp-accent: #D67472;
  --hp-emerald: #00A86B;
  --hp-gold: #FFB800;
  --target-size: 32px;
}

@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--hp-bg);
  color: var(--hp-text-dark);
  overflow-wrap: break-word;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Sniglet', 'Poppins', sans-serif;
  text-wrap: balance;
}

p, li, span {
  text-wrap: pretty;
}

/* Touch target sizing for controls */
:where(button, select, input:not([type="checkbox"], [type="radio"]), [role="button"], a.btn) {
  min-block-size: var(--target-size);
  min-inline-size: var(--target-size);
}

/* Safe area insets */
.safe-bottom {
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
}

/* Responsive Table with Container Queries & Sticky Headers (from Modern Web Guidance) */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(600px, 80vh);
  container-type: inline-size;
  border-radius: 12px;
  border: 1.2px solid var(--hp-border);
  background: var(--hp-surface);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  background-color: #F8EDEF;
}

th {
  padding: 12px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--hp-text-dark);
  border-bottom: 1.5px solid var(--hp-border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--hp-text-dark);
  border-bottom: 1px solid #F2E3E5;
  vertical-align: middle;
}

tbody tr:hover {
  background-color: #FFF2F4;
}

/* Adaptive mobile transformation */
@container (width < 640px) {
  table, thead, tbody, tr, th, td {
    display: block;
  }
  thead {
    display: none;
  }
  tr {
    margin: 10px;
    padding: 12px;
    background: #FFFFFF;
    border: 1.2px solid var(--hp-border);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(141, 27, 54, 0.05);
  }
  td {
    border-bottom: none;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 11.5px;
    color: var(--hp-text-muted);
  }
}

/* Modern Accessible Dialog Modals */
dialog {
  border: none;
  border-radius: 20px;
  padding: 0;
  background: #FFF8F7;
  box-shadow: 0 20px 40px -15px rgba(141, 27, 54, 0.3);
  max-width: 90vw;
  width: 600px;
  max-height: 90vh;
  overflow: hidden;
}

dialog::backdrop {
  background: rgba(44, 34, 36, 0.6);
  backdrop-filter: blur(3px);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #FDF4F5;
}
::-webkit-scrollbar-thumb {
  background: #E0C2C7;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #C49BA2;
}

/* Pulse animation for live online indicator */
@keyframes pulse-emerald {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 168, 107, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(0, 168, 107, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 168, 107, 0); }
}

.live-dot {
  width: 9px;
  height: 9px;
  background-color: var(--hp-emerald);
  border-radius: 50%;
  display: inline-block;
  animation: pulse-emerald 2s infinite;
}
