/* ZSEC TERMINAL - DOOM 64 INSPIRED INTERFACE */

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --text-primary: #00ff41;
  --text-secondary: #00aa2e;
  --text-muted: #006622;
  --accent-red: #ff0033;
  --accent-yellow: #ffcc00;
  --accent-cyan: #00ffff;
  --border-color: #00ff41;
  --shadow-glow: rgba(0, 255, 65, 0.5);
  --critical: #ff0033;
  --high: #ff6600;
  --medium: #ffcc00;
  --low: #00ffff;
  --info: #0099ff;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  font-family: 'Chakra Petch', 'Share Tech Mono', monospace;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* CRT EFFECTS */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(0, 0, 0, 0.25) 51%
  );
  background-size: 100% 4px;
  animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

.vignette {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    rgba(0, 0, 0, 0.7) 100%
  );
}

/* CONTAINER */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* HEADER */
.header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
  border-bottom: 2px solid var(--border-color);
  box-shadow: 0 2px 20px var(--shadow-glow);
}

.glitch-wrapper {
  margin-bottom: 1rem;
}

.glitch {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  text-shadow: 
    0 0 10px var(--shadow-glow),
    0 0 20px var(--shadow-glow),
    0 0 30px var(--shadow-glow);
  position: relative;
  animation: glitch 3s infinite;
}

@keyframes glitch {
  0%, 90%, 100% {
    transform: translate(0);
  }
  92% {
    transform: translate(-2px, 2px);
    text-shadow: 2px 0 var(--accent-red), -2px 0 var(--accent-cyan);
  }
  94% {
    transform: translate(2px, -2px);
    text-shadow: -2px 0 var(--accent-red), 2px 0 var(--accent-cyan);
  }
}

.status-bar {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.75rem;
  flex-wrap: wrap;
}

.status-item {
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--text-muted);
  background: rgba(0, 255, 65, 0.05);
}

.status-blink {
  color: var(--accent-red);
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 49%, 100% { opacity: 1; }
  50%, 99% { opacity: 0.3; }
}

.subtitle {
  font-family: 'Share Tech Mono', monospace;
  color: var(--text-secondary);
  font-size: 0.85rem;
  letter-spacing: 0.15em;
}

/* SECTION STYLES */
section {
  margin-bottom: 2rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  padding: 1.5rem;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.2);
}

section::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, transparent 48%, var(--border-color) 48%, var(--border-color) 52%, transparent 52%);
  background-size: 10px 10px;
  opacity: 0.1;
  pointer-events: none;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--text-muted);
}

.section-icon {
  color: var(--accent-red);
  font-size: 1.25rem;
  animation: pulse 2s ease-in-out infinite;
}

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

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  text-shadow: 0 0 10px var(--shadow-glow);
}

/* INPUT FORM */
.scan-form {
  margin-bottom: 1.5rem;
}

.input-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.input-wrapper {
  flex: 1;
  min-width: 250px;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.input-wrapper:focus-within {
  border-color: var(--accent-red);
  box-shadow: 0 0 20px rgba(255, 0, 51, 0.5);
}

.input-prefix {
  padding: 0 0.75rem;
  color: var(--accent-red);
  font-family: 'Share Tech Mono', monospace;
  font-weight: 700;
  font-size: 1.25rem;
}

#domain-input {
  flex: 1;
  padding: 1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  outline: none;
  text-transform: none;
}

#domain-input::placeholder {
  color: var(--text-muted);
  text-transform: lowercase;
}

#scan-button {
  padding: 1rem 2rem;
  font-family: 'Chakra Petch', monospace;
  font-size: 1rem;
  font-weight: 700;
  background: var(--accent-red);
  color: #000;
  border: 2px solid var(--accent-red);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-shadow: none;
}

#scan-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

#scan-button:hover:not(:disabled)::before {
  width: 300px;
  height: 300px;
}

#scan-button:hover:not(:disabled) {
  background: var(--text-primary);
  border-color: var(--text-primary);
  box-shadow: 0 0 30px var(--shadow-glow);
}

#scan-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-brackets {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.button-loading {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* VALIDATION MESSAGE */
.validation-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.875rem;
  border: 2px solid;
  background: rgba(0, 0, 0, 0.5);
}

.validation-message.error {
  border-color: var(--critical);
  color: var(--critical);
  box-shadow: 0 0 20px rgba(255, 0, 51, 0.3);
}

.validation-message.success {
  border-color: var(--text-primary);
  color: var(--text-primary);
  box-shadow: 0 0 20px var(--shadow-glow);
}

/* SCANNER OPTIONS */
.scanner-options {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--text-muted);
}

.scanner-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 700;
}

.scanner-checkboxes {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  position: relative;
}

.checkbox-label:hover {
  color: var(--text-primary);
  text-shadow: 0 0 10px var(--shadow-glow);
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  position: relative;
  transition: all 0.3s ease;
}

.checkbox-label input:checked ~ .checkbox-custom {
  background: var(--accent-red);
  border-color: var(--accent-red);
  box-shadow: 0 0 10px rgba(255, 0, 51, 0.5);
}

.checkbox-label input:checked ~ .checkbox-custom::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #000;
  font-weight: 700;
  font-size: 0.75rem;
}

/* PROGRESS SECTION */
.progress-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.progress-bar {
  flex: 1;
  height: 30px;
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--accent-red) 0%,
    var(--accent-yellow) 50%,
    var(--text-primary) 100%
  );
  width: 0%;
  transition: width 0.3s ease;
  box-shadow: 0 0 20px var(--shadow-glow);
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-glitch {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--accent-cyan);
  opacity: 0;
  animation: glitch-progress 5s infinite;
}

@keyframes glitch-progress {
  0%, 90%, 100% { opacity: 0; }
  91%, 93%, 95%, 97% { opacity: 0.3; transform: translateX(2px); }
  92%, 94%, 96% { opacity: 0; transform: translateX(-2px); }
}

.progress-percent {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 60px;
  text-align: right;
  text-shadow: 0 0 10px var(--shadow-glow);
}

.progress-log {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--text-muted);
}

.progress-log::-webkit-scrollbar {
  width: 8px;
}

.progress-log::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

.progress-log::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border: 1px solid var(--bg-primary);
}

.log-entry {
  padding: 0.35rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-left: 2px solid transparent;
  padding-left: 0.5rem;
  transition: all 0.3s ease;
}

.log-entry.started {
  color: var(--text-secondary);
  border-left-color: var(--text-muted);
}

.log-entry.completed {
  color: var(--text-primary);
  border-left-color: var(--text-primary);
  text-shadow: 0 0 5px var(--shadow-glow);
}

.log-entry.error {
  color: var(--critical);
  border-left-color: var(--critical);
}

/* RESULTS SECTION */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-secondary {
  padding: 0.75rem 1.25rem;
  font-family: 'Chakra Petch', monospace;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: var(--border-color);
  color: #000;
  box-shadow: 0 0 20px var(--shadow-glow);
}

.btn-icon {
  font-size: 1.25rem;
  font-weight: 700;
}

.btn-primary {
  padding: 1rem 2rem;
  font-family: 'Chakra Petch', monospace;
  font-size: 1rem;
  font-weight: 700;
  background: var(--text-primary);
  color: #000;
  border: 2px solid var(--text-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  box-shadow: 0 0 30px rgba(255, 0, 51, 0.5);
}

/* SUMMARY CARDS */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.summary-card {
  background: var(--bg-primary);
  border: 2px solid;
  padding: 1.25rem;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: currentColor;
}

.summary-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 20px currentColor;
}

.summary-card .count {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  font-family: 'Chakra Petch', monospace;
  text-shadow: 0 0 10px currentColor;
}

.summary-card .label {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  font-weight: 600;
  font-family: 'Share Tech Mono', monospace;
}

.summary-card.critical { border-color: var(--critical); color: var(--critical); }
.summary-card.high { border-color: var(--high); color: var(--high); }
.summary-card.medium { border-color: var(--medium); color: var(--medium); }
.summary-card.low { border-color: var(--low); color: var(--low); }
.summary-card.info { border-color: var(--info); color: var(--info); }
.summary-card.total { border-color: var(--text-primary); color: var(--text-primary); }

/* FINDINGS */
.findings-container {
  margin-bottom: 2rem;
}

.findings-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-left: 4px solid var(--accent-red);
}

.findings-icon {
  color: var(--accent-red);
  font-size: 1.5rem;
  animation: pulse 2s ease-in-out infinite;
}

.findings-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.15em;
}

.findings-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.finding-card {
  background: var(--bg-primary);
  border: 2px solid;
  border-left-width: 6px;
  padding: 1.25rem;
  transition: all 0.3s ease;
  position: relative;
}

.finding-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 20px 20px 0;
  border-color: transparent currentColor transparent transparent;
  opacity: 0.3;
}

.finding-card:hover {
  transform: translateX(4px);
  box-shadow: -4px 0 20px currentColor;
}

.finding-card.critical { border-color: var(--critical); color: var(--critical); }
.finding-card.high { border-color: var(--high); color: var(--high); }
.finding-card.medium { border-color: var(--medium); color: var(--medium); }
.finding-card.low { border-color: var(--low); color: var(--low); }
.finding-card.info { border-color: var(--info); color: var(--info); }

.finding-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.finding-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  text-shadow: 0 0 5px currentColor;
}

.finding-severity {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  background: currentColor;
  color: #000;
  font-family: 'Share Tech Mono', monospace;
  white-space: nowrap;
  box-shadow: 0 0 10px currentColor;
}

.finding-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-family: 'Share Tech Mono', monospace;
  text-transform: none;
  letter-spacing: 0.02em;
}

.finding-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'Share Tech Mono', monospace;
}

.no-findings {
  padding: 2rem;
  text-align: center;
  color: var(--text-primary);
  font-size: 1.25rem;
  text-shadow: 0 0 10px var(--shadow-glow);
}

/* REPORT DETAILS */
.report-details {
  margin-top: 2rem;
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
}

.report-details summary {
  cursor: pointer;
  padding: 1rem;
  font-weight: 700;
  font-size: 1rem;
  background: var(--bg-tertiary);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.report-details summary:hover {
  background: var(--border-color);
  color: #000;
  box-shadow: 0 0 20px var(--shadow-glow);
}

.summary-icon {
  color: var(--accent-red);
  font-size: 1rem;
  transition: transform 0.3s ease;
}

.report-details[open] .summary-icon {
  transform: rotate(90deg);
}

.report-markdown {
  padding: 1.5rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 500px;
  overflow-y: auto;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0;
}

.report-markdown::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.report-markdown::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

.report-markdown::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border: 1px solid var(--bg-primary);
}

/* ERROR SECTION */
.error-section {
  background: var(--bg-secondary);
  border: 2px solid var(--critical);
  padding: 2rem;
  text-align: center;
  box-shadow: 0 0 30px rgba(255, 0, 51, 0.3);
}

.error-content {
  max-width: 500px;
  margin: 0 auto;
}

.error-icon-wrapper {
  margin-bottom: 1rem;
}

.error-icon {
  font-size: 4rem;
  color: var(--critical);
  display: inline-block;
  animation: error-pulse 1s ease-in-out infinite;
  text-shadow: 0 0 20px var(--critical);
}

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

.error-section h3 {
  color: var(--critical);
  margin-bottom: 1rem;
  font-size: 1.5rem;
  text-shadow: 0 0 10px var(--critical);
}

.error-message-box {
  padding: 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--critical);
  margin-bottom: 1.5rem;
  font-family: 'Share Tech Mono', monospace;
  text-transform: none;
}

.error-message-box p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* FOOTER */
.footer {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
}

.footer-line {
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--border-color) 50%,
    transparent 100%
  );
  margin-bottom: 1rem;
  box-shadow: 0 0 10px var(--shadow-glow);
}

.footer p {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: 'Share Tech Mono', monospace;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer a {
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer a:hover {
  color: var(--accent-red);
  text-shadow: 0 0 10px var(--accent-red);
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* UTILITY */
[hidden] {
  display: none !important;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .glitch {
    font-size: 2rem;
  }
  
  .status-bar {
    gap: 0.5rem;
  }
  
  .status-item {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
  }
  
  .input-group {
    flex-direction: column;
  }
  
  .input-wrapper {
    width: 100%;
  }
  
  #scan-button {
    width: 100%;
  }
  
  .results-header {
    flex-direction: column;
  }
  
  .summary-cards {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .scanner-checkboxes {
    gap: 1rem;
  }
  
  .progress-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .progress-percent {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .scanner-options {
    flex-direction: column;
    align-items: flex-start;
  }
}
