/* ── Security Headers Auditor Subpage Stylesheet ── */

/* Workspace Container & Grid */
.workspace-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px 60px;
  animation: fadeUp 0.5s var(--ease);
}

.workspace-grid {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 32px;
  align-items: start;
}

.fav-preview-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

@media (max-width: 1024px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* Glassmorphic Workspace Cards */
.ws-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.ws-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.ws-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.ws-card-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Inputs & Form Groups */
.control-group {
  margin-bottom: 20px;
}

.control-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-70);
  margin-bottom: 8px;
}

.control-group input[type="url"] {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  padding: 12px 16px;
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}

.control-group input:focus {
  outline: none;
  border-color: var(--border-hover);
  background: var(--surface-3);
}

/* Tab menu */
.filter-btn-row {
  display: flex;
  gap: 6px;
}

.filter-btn-row .btn-toggle-action {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.filter-btn-row .btn-toggle-action.active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

/* Custom Tables */
.table-container {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  margin-top: 16px;
  -webkit-overflow-scrolling: touch;
}

.audit-results-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.audit-results-table th {
  background: var(--surface-3);
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-55);
  border-bottom: 1px solid var(--border);
}

.audit-results-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--fg-90);
  max-width: 280px;
  word-wrap: break-word;
  white-space: normal;
}

.audit-results-table tbody tr:last-child td {
  border-bottom: none;
}

.audit-results-table tbody tr:hover td {
  background: rgba(245, 245, 245, 0.01);
}

.table-empty-state {
  text-align: center;
  padding: 60px 20px !important;
  color: var(--fg-40);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.table-empty-state p {
  font-size: 0.9rem;
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.4;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.badge-internal {
  background: rgba(245, 245, 245, 0.04);
  color: var(--fg-70);
  border: 1px solid var(--border);
}

.badge.badge-external {
  background: rgba(99, 102, 241, 0.1);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Hide helpers */
.hidden {
  display: none !important;
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Buttons */
.btn-primary,
.btn-secondary {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--fg);
  border: 1px solid var(--fg);
  color: var(--bg);
}

.btn-primary:hover {
  background: rgba(245, 245, 245, 0.85);
  border-color: rgba(245, 245, 245, 0.85);
}

.btn-large {
  padding: 14px 24px;
  font-size: 0.95rem;
}

.btn-full-width {
  width: 100%;
}

.btn-compact {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.btn-toggle-action {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--fg-70);
  border-radius: var(--radius-xs);
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-toggle-action:hover {
  border-color: var(--border-hover);
  color: var(--fg);
}

.copy-btn {
  background: var(--surface-1);
  border: 1px solid var(--border);
  color: var(--fg-70);
  border-radius: var(--radius-xs);
  padding: 6px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.copy-btn:hover {
  border-color: var(--fg-40);
  color: var(--fg);
}

/* Spinner */
.btn-loader {
  display: inline-flex;
  align-items: center;
}

.spinner {
  animation: rotate-spinner 1.2s linear infinite;
  width: 16px;
  height: 16px;
  color: inherit;
}

@keyframes rotate-spinner {
  100% {
    transform: rotate(360deg);
  }
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.control-panel .ws-card {
  padding: 32px !important;
  display: flex;
  flex-direction: column;
  gap: 20px;
}


/* ── Tool Specific Customizations ── */

.seo-score-widget {
  display: flex;
  align-items: center;
  gap: 24px;
}

.seo-score-circle-wrap {
  position: relative;
  width: 70px;
  height: 70px;
}

.seo-ring {
  width: 70px;
  height: 70px;
  transform: rotate(-90deg);
}

.seo-ring .ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 5;
}

.seo-ring .ring-fg {
  fill: none;
  stroke: var(--primary);
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.seo-score-val {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.seo-score-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.seo-score-grade {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.seo-score-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
}

.seo-score-sub {
  font-size: 0.76rem;
  color: var(--fg-40);
  line-height: 1.4;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 4px;
  font-weight: 600;
  padding: 4px 8px;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.status-badge.broken {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.code-view-container {
  position: relative;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: #121212 !important;
}

.disabled-overlay {
  position: relative;
}

.disabled-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(24, 24, 24, 0.55);
  backdrop-filter: blur(1.5px);
  border-radius: inherit;
  z-index: 5;
  pointer-events: all;
  transition: opacity 0.3s ease;
}

.disabled-overlay.enabled::before,
.disabled-overlay:not(.disabled-overlay)::before {
  opacity: 0;
  pointer-events: none;
}

.disabled-overlay > * {
  opacity: 0.25;
  transition: opacity 0.3s ease;
}

.disabled-overlay.enabled > *,
.disabled-overlay:not(.disabled-overlay) > * {
  opacity: 1;
}
