/* ============================================================================
   DNS ENTERPRISE SUITE+ - PREMIUM STYLES
   Enterprise-grade styling with glassmorphism, gradients, and animations
   ============================================================================ */

/* Premium Variables */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --danger-gradient: linear-gradient(135deg, #fc466b 0%, #3f5efb 100%);
  --dark-glass: rgba(15, 23, 42, 0.7);
  --border-glass: rgba(255, 255, 255, 0.1);
  --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  --glow-primary: 0 0 40px rgba(102, 126, 234, 0.3);
  --glow-success: 0 0 40px rgba(17, 153, 142, 0.3);
}

/* ============================================================================
   INFRASTRUCTURE VISUALIZER
   ============================================================================ */

.infrastructure-tree {
  padding: 2rem;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-premium);
}

.tree-root {
  position: relative;
}

.tree-node {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
  border-radius: 16px;
  border: 1px solid rgba(102, 126, 234, 0.3);
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.tree-node:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-primary);
}

.node-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px rgba(102, 126, 234, 0.5));
}

.node-name {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.node-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.node-badge.tld {
  background: rgba(102, 126, 234, 0.3);
  color: #667eea;
  border: 1px solid rgba(102, 126, 234, 0.5);
}

.dnssec-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(17, 153, 142, 0.2), rgba(56, 239, 125, 0.2));
  border-radius: 12px;
  border: 1px solid rgba(17, 153, 142, 0.3);
  margin-bottom: 1.5rem;
  color: #38ef7d;
  font-weight: 500;
}

.dnssec-icon {
  font-size: 1.25rem;
  filter: drop-shadow(0 0 10px rgba(56, 239, 125, 0.5));
}

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

.ns-card {
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 16px;
  border: 1px solid var(--border-glass);
  transition: all 0.3s ease;
}

.ns-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-premium);
}

.ns-card.healthy {
  border-left: 4px solid #38ef7d;
}

.ns-card.degraded {
  border-left: 4px solid #f5576c;
}

.ns-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ns-icon {
  font-size: 1.5rem;
}

.ns-name {
  flex: 1;
  font-weight: 600;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
}

.ns-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.ns-status.healthy {
  background: rgba(17, 153, 142, 0.3);
  color: #38ef7d;
}

.ns-status.degraded {
  background: rgba(245, 87, 108, 0.3);
  color: #f5576c;
}

.ns-metrics {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-label {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  font-weight: 700;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
}

.ns-records {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.record-pill {
  padding: 0.25rem 0.5rem;
  background: rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 6px;
  font-size: 0.75rem;
  color: #667eea;
  font-weight: 500;
}

.soa-details {
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 16px;
  border: 1px solid var(--border-glass);
}

.soa-details h4 {
  margin: 0 0 1rem 0;
  color: #94a3b8;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.soa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.soa-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.soa-label {
  font-size: 0.75rem;
  color: #64748b;
}

.soa-value {
  font-weight: 600;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
}

/* ============================================================================
   SECURITY COMMAND CENTER
   ============================================================================ */

.security-dashboard {
  padding: 2rem;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border-radius: 24px;
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-premium);
}

.security-score-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-glass);
}

.security-score-ring {
  position: relative;
  width: 140px;
  height: 140px;
}

.security-score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.security-score-ring.secure {
  color: #38ef7d;
}

.security-score-ring.warning {
  color: #f5576c;
}

.security-score-ring.danger {
  color: #fc466b;
}

.score-progress {
  filter: drop-shadow(0 0 10px currentColor);
}

.score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-value {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
}

.score-label {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.security-status h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.security-status p {
  margin: 0;
  color: #64748b;
}

.security-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.sec-card {
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 16px;
  border: 1px solid var(--border-glass);
  transition: all 0.3s ease;
}

.sec-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.sec-card.pass {
  border-left: 4px solid #38ef7d;
}

.sec-card.fail {
  border-left: 4px solid #f5576c;
}

.sec-card.warning {
  border-left: 4px solid #fbbf24;
}

.sec-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.sec-icon {
  font-size: 1.5rem;
}

.sec-title {
  flex: 1;
  font-weight: 600;
  color: #fff;
}

.sec-score {
  font-size: 0.875rem;
  font-weight: 700;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
}

.sec-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sec-policy {
  font-size: 0.875rem;
  color: #fff;
  font-weight: 500;
}

.sec-lookups, .sec-pct, .sec-valid, .sec-selectors {
  font-size: 0.75rem;
  color: #64748b;
}

.sec-missing {
  font-size: 0.875rem;
  color: #f5576c;
  font-weight: 500;
}

.sec-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.issue-tag {
  padding: 0.25rem 0.5rem;
  background: rgba(245, 87, 108, 0.2);
  border: 1px solid rgba(245, 87, 108, 0.3);
  border-radius: 6px;
  font-size: 0.7rem;
  color: #f5576c;
}

.threat-intel {
  padding: 1.5rem;
  background: rgba(252, 70, 107, 0.1);
  border-radius: 16px;
  border: 1px solid rgba(252, 70, 107, 0.3);
}

.threat-intel h4 {
  margin: 0 0 1rem 0;
  color: #fc466b;
  font-size: 1rem;
}

.threat-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.threat-severity {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.threat-item.critical .threat-severity {
  background: #fc466b;
  color: #fff;
}

.threat-item.high .threat-severity {
  background: #f5576c;
  color: #fff;
}

.threat-item.medium .threat-severity {
  background: #fbbf24;
  color: #000;
}

.threat-item.low .threat-severity {
  background: #64748b;
  color: #fff;
}

.threat-desc {
  flex: 1;
  font-size: 0.875rem;
  color: #cbd5e1;
}

/* ============================================================================
   COMPARISON TOOL
   ============================================================================ */

.comparison-dashboard {
  padding: 2rem;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border-radius: 24px;
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-premium);
}

.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.comparison-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-export {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-export:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-primary);
}

.comparison-table-wrapper {
  overflow-x: auto;
  margin-bottom: 2rem;
}

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.comparison-table th {
  padding: 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  border-bottom: 1px solid var(--border-glass);
}

.comparison-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-glass);
}

.comparison-table tr:hover td {
  background: rgba(102, 126, 234, 0.1);
}

.domain-cell {
  font-weight: 600;
  color: #fff;
}

.domain-name {
  font-family: 'JetBrains Mono', monospace;
}

.record-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: 700;
}

.record-count.has {
  background: linear-gradient(135deg, #11998e, #38ef7d);
  color: #fff;
}

.record-count.none {
  background: rgba(100, 116, 139, 0.3);
  color: #64748b;
}

.ns-list {
  font-size: 0.75rem;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
}

.dnssec-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.dnssec-status.enabled {
  background: rgba(17, 153, 142, 0.2);
  color: #38ef7d;
}

.dnssec-status.disabled {
  background: rgba(245, 87, 108, 0.2);
  color: #f5576c;
}

.health-bar {
  position: relative;
  height: 8px;
  background: rgba(100, 116, 139, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

.health-fill {
  height: 100%;
  background: linear-gradient(90deg, #11998e, #38ef7d);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.health-text {
  position: absolute;
  right: 0;
  top: -20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #38ef7d;
}

.comparison-insights {
  padding: 1.5rem;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 16px;
  border: 1px solid rgba(102, 126, 234, 0.2);
}

.comparison-insights h4 {
  margin: 0 0 1rem 0;
  color: #667eea;
}

.comparison-insights ul {
  margin: 0;
  padding-left: 1.5rem;
  color: #94a3b8;
}

.comparison-insights li {
  margin-bottom: 0.5rem;
}

/* ============================================================================
   TEMPLATES GALLERY
   ============================================================================ */

.templates-gallery {
  padding: 2rem;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border-radius: 24px;
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-premium);
}

.templates-gallery h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.templates-subtitle {
  margin: 0 0 2rem 0;
  color: #64748b;
}

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

.template-card {
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 16px;
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all 0.3s ease;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glow-primary);
  border-color: rgba(102, 126, 234, 0.5);
}

.template-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.template-icon {
  font-size: 2rem;
}

.template-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.template-desc {
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  color: #64748b;
}

.template-records {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.record-badge {
  padding: 0.25rem 0.5rem;
  background: rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 6px;
  font-size: 0.75rem;
  color: #667eea;
  font-weight: 500;
}

.record-more {
  padding: 0.25rem 0.5rem;
  background: rgba(100, 116, 139, 0.3);
  border-radius: 6px;
  font-size: 0.75rem;
  color: #94a3b8;
}

.btn-apply-template {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-apply-template:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-primary);
}

.custom-template {
  padding: 1.5rem;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 16px;
  border: 1px solid var(--border-glass);
}

.custom-template h4 {
  margin: 0 0 1rem 0;
  color: #fff;
}

.custom-template textarea {
  width: 100%;
  min-height: 150px;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  resize: vertical;
  margin-bottom: 1rem;
}

.btn-parse {
  padding: 0.75rem 1.5rem;
  background: rgba(102, 126, 234, 0.2);
  border: 1px solid rgba(102, 126, 234, 0.3);
  border-radius: 8px;
  color: #667eea;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-parse:hover {
  background: rgba(102, 126, 234, 0.3);
}

/* ============================================================================
   CHANGE ALERTS
   ============================================================================ */

.change-alert {
  padding: 1.5rem;
  background: rgba(251, 191, 36, 0.1);
  border-radius: 16px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  margin-bottom: 1rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.alert-icon {
  font-size: 1.5rem;
}

.alert-title {
  flex: 1;
  font-weight: 600;
  color: #fbbf24;
}

.alert-time {
  font-size: 0.75rem;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
}

.alert-changes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.change-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
}

.change-type {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.change-item.added .change-type {
  background: rgba(17, 153, 142, 0.3);
  color: #38ef7d;
}

.change-item.removed .change-type {
  background: rgba(245, 87, 108, 0.3);
  color: #f5576c;
}

.change-record {
  font-weight: 600;
  color: #fff;
  min-width: 60px;
}

.change-data {
  flex: 1;
  font-size: 0.875rem;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
}

/* ============================================================================
   LOADING ANIMATIONS
   ============================================================================ */

.infra-loading, .security-scanning, .comparison-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  text-align: center;
}

.spinner-premium {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(102, 126, 234, 0.2);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.scan-animation {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 1rem;
}

.radar {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(102, 126, 234, 0.3);
  border-radius: 50%;
  animation: pulse 2s ease-out infinite;
}

.scan-line {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, #667eea, transparent);
  transform-origin: left center;
  animation: radar-scan 2s linear infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.5; }
}

@keyframes radar-scan {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.loading-bars {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.loading-bars .bar {
  width: 8px;
  height: 40px;
  background: linear-gradient(180deg, #667eea, #764ba2);
  border-radius: 4px;
  animation: bar-bounce 1s ease-in-out infinite;
}

.loading-bars .bar:nth-child(2) { animation-delay: 0.1s; }
.loading-bars .bar:nth-child(3) { animation-delay: 0.2s; }

@keyframes bar-bounce {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.5); }
}

.error-premium {
  padding: 2rem;
  background: rgba(245, 87, 108, 0.1);
  border-radius: 16px;
  border: 1px solid rgba(245, 87, 108, 0.3);
  color: #f5576c;
  text-align: center;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
  .infrastructure-tree,
  .security-dashboard,
  .comparison-dashboard,
  .templates-gallery {
    padding: 1rem;
  }

  .nameserver-grid {
    grid-template-columns: 1fr;
  }

  .security-score-header {
    flex-direction: column;
    text-align: center;
  }

  .security-cards {
    grid-template-columns: 1fr;
  }

  .templates-grid {
    grid-template-columns: 1fr;
  }

  .comparison-header {
    flex-direction: column;
    gap: 1rem;
  }
}
