/* UNIFIED DNS TABLE - DNSDumpster Style
 * Dense, professional, highly readable
 * One table with section headers
 */

.unified-table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  margin-top: 1rem;
  overflow-x: auto;
}

.unified-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.3;
  table-layout: fixed;
}

/* Table Header */
.unified-table thead {
  background: var(--bg-elevated);
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.unified-table th {
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  white-space: nowrap;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.unified-table th .sort-indicator {
  display: inline-block;
  margin-left: 4px;
  opacity: 0.45;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid var(--text-muted);
  transform: translateY(1px);
}

.unified-table th.sorted .sort-indicator.asc { border-top-color: var(--accent-primary); transform: rotate(180deg) translateY(-1px); }
.unified-table th.sorted .sort-indicator.desc { border-top-color: var(--accent-primary); }

.unified-table th:last-child {
  border-right: none;
}

/* Column Widths - DNSDumpster Exact */
.col-host {
  width: 22%;
  min-width: 200px;
}

.col-ip {
  width: 15%;
  min-width: 140px;
}

.col-asn {
  width: 12%;
  min-width: 110px;
}

.col-org {
  width: 18%;
  min-width: 160px;
}

.col-location {
  width: 12%;
  min-width: 120px;
}

.col-services {
  width: 16%;
  min-width: 150px;
}

.col-revip {
  width: 5%;
  min-width: 60px;
  text-align: center;
}
.col-actions {
  width: 6%;
  min-width: 70px;
  text-align: center;
}

/* Section Headers */
.section-header td {
  background: var(--bg-elevated);
  padding: 8px 12px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-primary);
  border-top: 2px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

/* Data Rows */
.data-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.15s ease;
}

.data-row:hover {
  background: rgba(0, 245, 255, 0.03);
}

.unified-table td {
  padding: 8px;
  vertical-align: top;
  color: var(--text-primary);
  border-right: 1px solid rgba(255, 255, 255, 0.02);
}

.unified-table td:last-child {
  border-right: none;
}

/* Host Cell */
.host-cell {
  font-family: var(--font-mono);
  font-size: 13px;
}

.priority {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(255, 204, 0, 0.15);
  color: var(--color-warning);
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}

/* IP Cell - Multi-line (IP + Reverse DNS) */
.ip-cell {
  font-family: var(--font-mono);
}

.ip-main {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ip-reverse {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.2;
}

/* ASN Cell - Multi-line (ASN + CIDR) */
.asn-cell {
  font-family: var(--font-mono);
}

.asn-main {
  font-size: 13px;
  color: var(--neon-cyan);
  font-weight: 500;
  margin-bottom: 2px;
}

.asn-cidr {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Organization Cell */
.org-cell {
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

/* Location Cell */
.location-cell {
  font-size: 12px;
  line-height: 1.4;
}

/* Services Cell */
.services-cell {
  font-size: 12px;
  line-height: 1.5;
}

.service-entry {
  margin-bottom: 3px;
  line-height: 1.4;
}

.service-entry:last-child {
  margin-bottom: 0;
}

.service-protocol {
  color: var(--neon-cyan);
  font-weight: 500;
}

.service-title {
  color: var(--color-txt);
  font-style: italic;
}

.service-tech {
  color: var(--color-warning);
}

/* RevIP Cell */
.revip-cell {
  text-align: center;
  font-weight: 600;
  color: var(--color-warning);
  font-size: 13px;
}

.actions-cell {
  text-align: center;
  position: relative;
}

.kebab-btn {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  width: 28px;
  height: 24px;
  cursor: pointer;
}

.kebab-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.action-menu {
  position: absolute;
  right: 0;
  margin-top: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  min-width: 140px;
  z-index: 10;
}

.action-menu button {
  background: none;
  border: none;
  color: var(--text-primary);
  padding: 6px 10px;
  text-align: left;
  font-family: var(--font-mono);
  cursor: pointer;
}

.action-menu button:hover {
  background: rgba(0, 245, 255, 0.06);
  color: var(--accent-primary);
}

/* TXT Records Special Styling */
.txt-row td {
  padding: 10px 12px;
}

.txt-value {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  word-break: break-all;
  color: var(--text-secondary);
}

/* Pills for TXT types */
.pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pill.ok {
  background: rgba(0, 255, 136, 0.15);
  color: var(--color-success);
}

.pill.warn {
  background: rgba(255, 204, 0, 0.15);
  color: var(--color-warning);
}

.pill {
  background: rgba(100, 100, 120, 0.15);
  color: var(--text-secondary);
}

/* Empty State */
.muted {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 2rem;
}

/* Record Type Indicators */
.type-a {
  border-left: 3px solid var(--color-a);
}

.type-aaaa {
  border-left: 3px solid var(--color-aaaa);
}

.type-mx {
  border-left: 3px solid var(--color-mx);
}

.type-ns {
  border-left: 3px solid var(--color-ns);
}

/* Responsive Adjustments */
@media (max-width: 1400px) {
  .unified-table {
    font-size: 12px;
  }

  .unified-table th {
    font-size: 10px;
  }

  .ip-main,
  .asn-main {
    font-size: 12px;
  }

  .ip-reverse,
  .asn-cidr {
    font-size: 10px;
  }
}

@media (max-width: 1200px) {
  .col-services {
    display: none;
  }

  .col-revip {
    display: none;
  }
}

@media (max-width: 900px) {
  .col-location {
    display: none;
  }
}

/* Print Styles */
@media print {
  .unified-table {
    font-size: 10px;
  }

  .unified-table-container {
    border: 1px solid #000;
  }

  .data-row:hover {
    background: none;
  }
}

/* Mobile - Critical Fix */
@media (max-width: 768px) {
  .panel-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .unified-table {
    min-width: 600px;
    font-size: 11px;
    table-layout: auto;
  }

  .unified-table th {
    font-size: 9px;
    padding: 6px 4px;
    white-space: nowrap;
  }

  .unified-table td {
    padding: 4px;
    font-size: 11px;
  }

  .col-host {
    min-width: 140px;
  }

  .col-ip {
    min-width: 120px;
  }

  .col-asn {
    min-width: 90px;
  }

  .col-org {
    display: none;
  }

  .ip-main,
  .asn-main {
    font-size: 11px;
  }

  .ip-reverse,
  .asn-cidr {
    font-size: 9px;
  }

  .section-header td {
    font-size: 11px;
    padding: 6px 8px;
  }
}
