/* Himmer GmbH — Messestand Designtool */
:root {
  --blue: #016cb6;
  --blue-dark: #015a99;
  --blue-light: #0480d0;
  --black: #000000;
  --bg: #0d0d0d;
  --bg-card: #181818;
  --bg-input: #222222;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --text-muted: #888;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

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

body {
  font-family: 'Nunito', 'Avenir', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Typography ── */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
a { color: var(--blue-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.page-wrap { padding: 32px 0 64px; }

/* ── Navbar ── */
.navbar {
  background: var(--black);
  border-bottom: 2px solid var(--blue);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.navbar .logo img { height: 32px; }
.navbar .logo span {
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.03em;
}
.navbar-actions { display: flex; align-items: center; gap: 16px; }
.navbar-user { color: var(--text-muted); font-size: 0.85rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #2d2d2d; }
.btn-danger { background: #7f1d1d; color: #fca5a5; }
.btn-danger:hover { background: #991b1b; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--blue);
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* ── Tabs ── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 28px; }
.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--blue-light); border-bottom-color: var(--blue); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Toast ── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  padding: 12px 18px;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  animation: slide-in 0.2s ease;
  max-width: 320px;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }
@keyframes slide-in {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── Project List ── */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.project-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}
.project-card h3 { margin-bottom: 8px; color: var(--text); }
.project-meta { font-size: 0.82rem; color: var(--text-muted); }
.project-meta span { display: inline-block; margin-right: 12px; }
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.status-running { background: #1e3a5f; color: #93c5fd; }
.status-done    { background: #14532d; color: #86efac; }
.status-error   { background: #7f1d1d; color: #fca5a5; }
.status-none    { background: #1a1a1a; color: var(--text-muted); }

/* ── File Upload Area ── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 16px;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--blue);
  background: rgba(1,108,182,0.05);
}
.upload-area p { color: var(--text-muted); margin-top: 8px; font-size: 0.88rem; }
.upload-area input[type="file"] { display: none; }

.file-list { list-style: none; }
.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 0.88rem;
}
.file-list li span { color: var(--text-muted); font-size: 0.8rem; }

/* ── Version / Results ── */
.version-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.version-card h3 { color: var(--blue-light); margin-bottom: 12px; }
.rendering-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.rendering-grid img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.1s;
}
.rendering-grid img:hover { transform: scale(1.02); }

/* ── Progress / SSE ── */
.progress-wrap { max-width: 600px; margin: 0 auto; padding-top: 40px; }
.progress-header { text-align: center; margin-bottom: 40px; }
.progress-header h2 { margin-bottom: 8px; }
.progress-header p { color: var(--text-muted); }

.step-list { list-style: none; margin-bottom: 32px; }
.step-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.step-item:last-child { border-bottom: none; }
.step-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
}
.step-icon.pending { background: var(--bg-input); color: var(--text-muted); }
.step-icon.active  { background: var(--blue); color: #fff; animation: pulse 1.2s infinite; }
.step-icon.done    { background: var(--success); color: #fff; }
.step-icon.error   { background: var(--error); color: #fff; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(1,108,182,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(1,108,182,0); }
}
.step-content { flex: 1; }
.step-title { font-weight: 600; }
.step-msg { font-size: 0.85rem; color: var(--text-muted); margin-top: 2px; }

.progress-bar-wrap {
  background: var(--bg-input);
  border-radius: 4px;
  height: 6px;
  margin-bottom: 32px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ── Login Page ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}
.login-box .logo-area {
  text-align: center;
  margin-bottom: 32px;
}
.login-box .logo-area img { height: 40px; }
.login-box .logo-area h1 {
  font-size: 1.2rem;
  margin-top: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}
.modal h2 { margin-bottom: 20px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius); }
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

/* ── Helpers ── */
.flex { display: flex; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.text-muted { color: var(--text-muted); }
.text-blue { color: var(--blue-light); }
.text-sm { font-size: 0.85rem; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.section-title h2 { margin-bottom: 0; }
.divider { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* ── Collapsible sections ── */
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.collapsible-header h3 { margin: 0; }
.collapsible-arrow {
  transition: transform 0.2s;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.collapsible-header.open .collapsible-arrow { transform: rotate(180deg); }
.collapsible-body { padding: 16px 0; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .project-grid { grid-template-columns: 1fr; }
  .rendering-grid { grid-template-columns: 1fr 1fr; }
  .login-box { padding: 28px 20px; }
  .tabs { overflow-x: auto; }
}
