/* Lutetia EVM Decompiler – Ethereum theme */

:root {
  --bg-dark: #0d0d0f;
  --bg-card: #16161a;
  --bg-input: #1a1a1f;
  --border: #2a2a32;
  --text: #e6e6e8;
  --text-muted: #8b8b92;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-dim: #4f46e5;
  --success: #3fb950;
  --error: #f85149;
  --font-sans: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;
  --radius: 10px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-dark);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 2.25rem;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin: 0 0 0.25rem 0;
}

.tagline {
  font-size: 1rem;
  color: var(--text-muted);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

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

.section-header h2 {
  margin: 0;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-docs {
  padding: 0.4rem 0.85rem;
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s;
}

.btn-docs:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* Docs modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.2s, opacity 0.2s;
}

.modal[aria-hidden="false"] {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.modal-close {
  padding: 0.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

.modal-body p {
  margin: 0 0 1rem 0;
}

.modal-body p:last-child {
  margin-bottom: 0;
}

.modal-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-input);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.tab:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.tab.active {
  background: var(--accent-dim);
  color: #e0e7ff;
  border-color: var(--accent);
}

/* Panels */
.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel .row {
  margin-bottom: 1rem;
}

.panel .row:last-of-type {
  margin-bottom: 0;
}

.panel .row.optional {
  margin-top: 0.75rem;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.field-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0.2rem;
  opacity: 0.9;
}

input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b8b92' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2rem;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.mono {
  font-family: var(--font-mono);
}

/* Buttons */
.actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #e0e7ff;
  border: none;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

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

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 0.4rem 0.85rem;
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.status {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.status.error {
  color: var(--error);
}

.status.success {
  color: var(--success);
}

/* Decompile progress estimate */
.progress-wrap {
  margin-top: 1rem;
}

.progress-wrap.hidden {
  display: none;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

#progress-label {
  color: var(--text);
  font-weight: 600;
}

#progress-eta {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.progress-track {
  height: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent-hover));
  transition: width 0.25s ease-out;
}

.progress-wrap.is-indeterminate .progress-bar {
  width: 35% !important;
  animation: progress-indeterminate 1.2s ease-in-out infinite;
}

@keyframes progress-indeterminate {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

/* Output section */
.output-section.hidden {
  display: none;
}

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

.output-header h2 {
  margin: 0;
}

.output-wrapper {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: auto;
  max-height: 70vh;
}

.output-wrapper pre {
  margin: 0;
  padding: 1rem;
}

.output-wrapper code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
}

.output-wrapper .hljs {
  background: transparent;
  padding: 0;
}

/* Footer */
.footer {
  margin-top: auto;
  padding-top: 2rem;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 0.5rem;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.footer a:hover {
  color: var(--accent);
}

.footer-link .icon-star {
  flex-shrink: 0;
  vertical-align: middle;
}

.footer-version {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-sep {
  color: var(--text-muted);
  font-size: 0.9rem;
}
