/* ==========================================================================
   intoDNS & WHOIS - Master Stylesheet
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #cbd5e1;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --pass: #16a34a;
  --warn: #ca8a04;
  --error: #dc2626;
  --info: #0284c7;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

/* Header & Search Bar */
.app-header {
  background: #ffffff;
  border-bottom: 2px solid #e2e8f0;
  padding: 1.25rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.75rem;
  font-weight: 800;
  color: #1e293b;
  text-decoration: none;
}

.brand-logo .dot-matrix {
  display: grid;
  grid-template-columns: repeat(3, 8px);
  gap: 3px;
}

.brand-logo .dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.brand-logo .dot:nth-child(1) { background: #3b82f6; }
.brand-logo .dot:nth-child(2) { background: #1d4ed8; }
.brand-logo .dot:nth-child(3) { background: #60a5fa; }
.brand-logo .dot:nth-child(4) { background: #1e40af; }
.brand-logo .dot:nth-child(5) { background: #3b82f6; }
.brand-logo .dot:nth-child(6) { background: #93c5fd; }
.brand-logo .dot:nth-child(7) { background: #2563eb; }
.brand-logo .dot:nth-child(8) { background: #1d4ed8; }
.brand-logo .dot:nth-child(9) { background: #3b82f6; }

/* Top Nav Buttons */
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 0.5rem;
  text-decoration: none;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.nav-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.search-container {
  display: flex;
  max-width: 680px;
  margin: 1.5rem auto 0.5rem auto;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  padding: 0.75rem 1.25rem;
  font-size: 1.05rem;
  border: 2px solid #cbd5e1;
  border-radius: 0.5rem;
  outline: none;
  transition: all 0.2s;
  background: #ffffff;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-report {
  padding: 0.75rem 1.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
  background: var(--primary);
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn-report:hover {
  background: var(--primary-hover);
}

.btn-report:active {
  transform: scale(0.98);
}

.quick-tags {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.quick-tag {
  background: #e2e8f0;
  padding: 0.2rem 0.6rem;
  border-radius: 0.375rem;
  color: #334155;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.quick-tag:hover {
  background: #cbd5e1;
  color: #0f172a;
}

/* Statistics Bar */
.stats-banner {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.score-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.score-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.25rem;
  color: #ffffff;
}

.score-circle.good { background: #16a34a; }
.score-circle.average { background: #ca8a04; }
.score-circle.poor { background: #dc2626; }

.stat-pills {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stat-pill {
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.stat-pill:hover {
  opacity: 0.85;
}

.stat-pill.pill-pass { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.stat-pill.pill-warn { background: #fef9c3; color: #a16207; border: 1px solid #fde047; }
.stat-pill.pill-error { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.stat-pill.pill-info { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; }

/* intoDNS Classic Table Layout */
.intodns-table-container {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 2.5rem;
}

.intodns-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
}

.intodns-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  text-align: left;
}

.intodns-table th:last-child {
  border-right: none;
}

.intodns-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  vertical-align: top;
}

.intodns-table td:last-child {
  border-right: none;
}

.intodns-table tr:last-child td {
  border-bottom: none;
}

.intodns-table tr:hover {
  background-color: #f8fafc;
}

/* Status Icons */
.status-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
}

.status-icon.pass {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.status-icon.warn {
  background: #eab308;
  color: #713f12;
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.2);
}

.status-icon.error {
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.status-icon.info {
  background: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.category-cell {
  font-weight: 700;
  color: #1e293b;
  background: #fafafa;
  width: 110px;
}

.status-cell {
  width: 60px;
  text-align: center;
}

.testname-cell {
  font-weight: 600;
  color: #334155;
  width: 240px;
}

.info-cell {
  color: #1e293b;
  word-break: break-word;
  line-height: 1.6;
}

.info-cell code {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.875rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* WHOIS Section Styles */
.whois-header-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.whois-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.whois-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.whois-field {
  margin-bottom: 0.85rem;
}

.whois-field:last-child {
  margin-bottom: 0;
}

.whois-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.whois-value {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  word-break: break-word;
}

.whois-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.whois-badge.active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.whois-badge.locked {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}

.whois-badge.expired {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* Raw WHOIS Text Block */
.raw-whois-container {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin-bottom: 2.5rem;
}

.raw-whois-header {
  background: #1e293b;
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #334155;
  font-size: 0.85rem;
  font-weight: 600;
}

.raw-whois-body {
  padding: 1.25rem;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 550px;
  overflow-y: auto;
}

/* Loader */
.loading-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.5rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.progress-bar-container {
  max-width: 400px;
  height: 8px;
  background: #e2e8f0;
  border-radius: 9999px;
  margin: 1rem auto 0 auto;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s ease;
}

/* Print Optimization */
@media print {
  .app-header, .search-container, .quick-tags, .action-buttons, .footer-section, nav {
    display: none !important;
  }
  body {
    background: #ffffff;
  }
  .intodns-table-container {
    border: none;
    box-shadow: none;
  }
}
