/* ── Reset & custom properties ─────────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --space-black:    #020406;
  --deep-blue:      #060e1a;
  --amiga-blue:     #0055aa;
  --amiga-dark-blue:#003388;
  --amiga-orange:   #ff8800;
  --amiga-cyan:     #66bbff;
  --text-bright:    #fff4ee;
  --text-dim:       #cc9988;
  --amiga-green:    #44cc88;
  --amiga-red:      #ff3344;
  --amiga-yellow:   #ffcc00;
  --dialog-bg:      #160808;
  --dialog-border:  #881100;
  --dialog-glow:    rgba(220, 40, 0, 0.30);
  --scanline-color: rgba(0, 0, 0, 0.04);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Courier New', 'Lucida Console', monospace;
  background: var(--space-black);
  color: var(--text-bright);
}

/* ── Star canvas (fixed behind everything) ──────────────────────────────── */

#starCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ── Main layout ────────────────────────────────────────────────────────── */

main {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 1rem;
}

.converter-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  width: min(500px, 100%);
}

/* ── App title block ────────────────────────────────────────────────────── */

.app-title-block {
  text-align: center;
  pointer-events: none;
}

.app-title {
  font-size: clamp(2.4rem, 9vw, 4.8rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  animation: titlePulse 3.5s ease-in-out infinite;
}

.title-dms {
  color: var(--amiga-orange);
  text-shadow:
    0 0 8px  rgba(255, 136, 0, 0.9),
    0 0 25px rgba(255, 136, 0, 0.5),
    0 0 55px rgba(255, 136, 0, 0.25);
}

.title-arrow {
  color: #cc6644;
  margin: 0 0.02em;
  font-size: 0.82em;
  vertical-align: middle;
}

.title-adf {
  color: var(--amiga-cyan);
  text-shadow:
    0 0 8px  rgba(102, 187, 255, 0.9),
    0 0 25px rgba(102, 187, 255, 0.5),
    0 0 55px rgba(102, 187, 255, 0.25);
}

@keyframes titlePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.88; }
}

.app-subtitle {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-top: 0.3rem;
}

/* ── Dialog window ──────────────────────────────────────────────────────── */

.dialog {
  width: 100%;
  background: var(--dialog-bg);
  border: 2px solid var(--dialog-border);
  border-radius: 4px;
  box-shadow:
    0 0 0 1px #440000,
    0 0 30px var(--dialog-glow),
    0 0 80px rgba(180, 20, 0, 0.12),
    inset 0 1px 0 rgba(255, 100, 60, 0.08);
  position: relative;
  overflow: hidden;
}

/* Scanline overlay */
.dialog::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    var(--scanline-color) 2px,
    var(--scanline-color) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* ── Dialog title bar ───────────────────────────────────────────────────── */

.dialog-titlebar {
  background: linear-gradient(
    90deg,
    #6b0000 0%,
    #cc1100 30%,
    #ee2200 50%,
    #cc1100 70%,
    #6b0000 100%
  );
  background-size: 200% 100%;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #771100;
  animation: copperShift 5s linear infinite;
  position: relative;
  z-index: 3;
}

@keyframes copperShift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.dialog-title-icon { font-size: 0.9rem; }

.dialog-title-text {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.dialog-titlebar-lights { display: none; }

/* ── Dialog body ────────────────────────────────────────────────────────── */

.dialog-body {
  padding: 1.6rem;
  min-height: 320px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* ── Panel base ─────────────────────────────────────────────────────────── */

.panel {
  width: 100%;
}
.panel.hidden { display: none; }

/* ── Drop zone ──────────────────────────────────────────────────────────── */

.drop-zone {
  border: 2px dashed #6b1a0a;
  border-radius: 6px;
  padding: 2rem 1rem;
  text-align: center;
  background: rgba(100, 20, 0, 0.15);
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone.drag-over {
  border-color: var(--amiga-orange);
  background: rgba(255, 136, 0, 0.07);
}

.drop-icon {
  font-size: 2.8rem;
  margin-bottom: 0.8rem;
  display: block;
  animation: diskFloat 2.8s ease-in-out infinite;
}

@keyframes diskFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-7px); }
}

.drop-text {
  font-size: 0.9rem;
  color: var(--text-bright);
  margin-bottom: 0.35rem;
}

.drop-subtext {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

.btn-primary {
  background: linear-gradient(135deg, #880000, #aa1100);
  border: 1px solid #ee4422;
  color: #ffffff;
  padding: 10px 30px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.12em;
  cursor: pointer;
  border-radius: 3px;
  text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(180, 0, 0, 0.45);
  transition: all 0.15s;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #aa1100, #cc2200);
  box-shadow: 0 0 14px rgba(255, 60, 0, 0.55);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-download {
  background: linear-gradient(135deg, #7a0000, #aa1100);
  border: 1px solid #dd3311;
  color: #ffddcc;
  padding: 11px 36px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-radius: 3px;
  box-shadow: 0 0 14px rgba(200, 40, 0, 0.35);
  transition: all 0.15s;
}
.btn-download:hover {
  background: linear-gradient(135deg, #991100, #cc2200);
  box-shadow: 0 0 22px rgba(255, 80, 0, 0.5);
  transform: translateY(-1px);
}
.btn-download:active { transform: translateY(0); }
.btn-download.hidden { display: none; }

.btn-secondary {
  background: transparent;
  border: 1px solid #4a2020;
  color: var(--text-dim);
  padding: 7px 20px;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  border-radius: 3px;
  letter-spacing: 0.06em;
  transition: all 0.15s;
}
.btn-secondary:hover {
  border-color: #884444;
  color: var(--text-bright);
}

/* ── Password modal ─────────────────────────────────────────────────────── */

#passwordModal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
#passwordModal.hidden { display: none; }

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.modal-box {
  position: relative;
  z-index: 1;
  background: var(--dialog-bg);
  border: 2px solid var(--dialog-border);
  border-radius: 4px;
  box-shadow:
    0 0 0 1px #440000,
    0 0 40px var(--dialog-glow),
    0 0 80px rgba(180, 20, 0, 0.15);
  width: min(360px, 90vw);
}

.modal-titlebar {
  background: linear-gradient(90deg, #6b0000 0%, #cc1100 50%, #6b0000 100%);
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #771100;
}

.modal-body {
  padding: 1.4rem;
}

.modal-body p {
  font-size: 0.84rem;
  color: var(--text-dim);
  margin-bottom: 1.1rem;
  text-align: center;
  line-height: 1.6;
}

.password-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #441100;
  border-radius: 3px;
  color: var(--text-bright);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 8px 12px;
  margin-bottom: 1.1rem;
  outline: none;
  transition: border-color 0.15s;
}
.password-input:focus   { border-color: var(--amiga-orange); }
.password-input::placeholder { color: #664444; }

.modal-brute-force {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  border-top: 1px solid #2a1010;
  padding-top: 0.9rem;
  width: 100%;
}

.modal-brute-force-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.btn-bruteforce {
  background: transparent;
  border: 1px solid #1a4a1a;
  color: #44aa44;
  padding: 6px 18px;
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 3px;
  transition: border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn-bruteforce:hover:not(:disabled) {
  border-color: #33aa33;
  color: #88ee88;
  box-shadow: 0 0 10px rgba(80, 200, 80, 0.25);
}

.btn-bruteforce:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-bruteforce-cancel {
  background: transparent;
  border: 1px solid #4a1a1a;
  color: #aa5555;
  padding: 5px 14px;
  font-family: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-radius: 3px;
  transition: border-color 0.15s, color 0.15s;
}

.btn-bruteforce-cancel:hover {
  border-color: #aa3333;
  color: #ee6666;
}

.btn-bruteforce-cancel.hidden { display: none; }

.brute-force-progress-wrap {
  width: 100%;
  height: 6px;
  background: #111;
  border: 1px solid #1a3a1a;
  border-radius: 4px;
  overflow: hidden;
}

.brute-force-progress-wrap.hidden { display: none; }

.brute-force-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #226622, #55ee55);
  box-shadow: 0 0 8px rgba(80, 220, 80, 0.55);
  border-radius: 4px;
  transition: width 0.12s linear;
}

.brute-force-status {
  font-size: 0.78rem;
  color: #44aa44;
  text-align: center;
  min-height: 1.2em;
}

.brute-force-status.hidden { display: none; }

.brute-force-status--error { color: #cc4444; }

.modal-actions {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  margin-bottom: 1rem;
}

/* ── Processing panel ───────────────────────────────────────────────────── */

.processing-container {
  text-align: center;
  padding: 1.5rem 0;
}

.spinner-ring {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(170, 20, 0, 0.25);
  border-top: 3px solid var(--amiga-orange);
  border-right: 3px solid rgba(255, 136, 0, 0.4);
  border-radius: 50%;
  margin: 0 auto 1.3rem;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.processing-label {
  font-size: 0.92rem;
  color: var(--amiga-orange);
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
}

.processing-filename {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ── File info section ──────────────────────────────────────────────────── */

.file-info-section { width: 100%; }
.file-info-section.hidden { display: none; }

.info-section-title {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #3a1010;
}

.info-table {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  font-size: 0.82rem;
  margin-bottom: 2.4rem;
}

.info-table dt {
  color: var(--text-dim);
  white-space: nowrap;
}

.info-table dd {
  color: var(--text-bright);
  font-weight: 600;
  word-break: break-all;
}

.info-table dd.info-status-ok    { color: #66ffaa; }
.info-table dd.info-status-warn  { color: #ffbb44; }
.info-table dd.info-status-error { color: #ffcc44; }

/* ── Error section ──────────────────────────────────────────────────────── */

.error-section {
  text-align: center;
  padding: 1rem 0;
}
.error-section.hidden { display: none; }

.error-icon {
  font-size: 2.4rem;
  margin-bottom: 0.7rem;
  display: block;
}

.error-text {
  font-size: 0.84rem;
  color: #ffcc44;
  line-height: 1.6;
}

/* ── Result actions ─────────────────────────────────────────────────────── */

.result-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  margin-top: 0.6rem;
}

/* ── Dialog hint text ───────────────────────────────────────────────────── */

.dialog-hint {
  font-size: 0.70rem;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin-top: auto;
  padding-top: 0.8rem;
}

.dialog-credit {
  font-size: 0.72rem;
  color: #c0805a;
  text-align: center;
  opacity: 0.75;
  padding: 0.5rem 1rem;
  letter-spacing: 0.04em;
  position: relative;
  z-index: 3;
  border-top: 1px solid rgba(180, 60, 20, 0.2);
}

.dialog-credit a {
  color: inherit;
  text-decoration: none;
}

.dialog-credit a:hover {
  opacity: 1;
  text-decoration: underline;
}
