/* App-specific styles — extends theme.css */

/* ─── NAV ─── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 0;
  background: rgba(10, 12, 16, 0.92);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--fg);
  text-decoration: none;
}

.nav-logo .bolt { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--fg); }

/* ─── HERO CTA ─── */
.hero-cta {
  margin-top: 40px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-note {
  font-size: 0.82rem;
  color: var(--fg-dim);
  margin-top: 12px;
}

/* ─── CLOSING CTA ─── */
.closing-cta {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  border: none;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(245,158,11,0.25);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--fg);
  border: 1px solid rgba(255,255,255,0.1);
}

.btn-secondary:hover {
  background: #222632;
  border-color: rgba(255,255,255,0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid rgba(255,255,255,0.08);
}

.btn-ghost:hover {
  color: var(--fg);
  background: var(--bg-elevated);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.84rem;
}

.btn-lg {
  padding: 15px 32px;
  font-size: 1.05rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ─── APP LAYOUT ─── */
.app-wrapper {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 57px);
  overflow: hidden;
}

.app-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  overflow: hidden;
}

.app-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.input-panel {
  background: var(--bg);
  border-right: 1px solid rgba(255,255,255,0.06);
}

.output-panel {
  background: var(--bg-surface);
}

.panel-header {
  padding: 18px 28px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header-left h2 {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--fg);
}

.panel-header-left p {
  font-size: 0.8rem;
  color: var(--fg-muted);
  margin-top: 2px;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ─── TEXTAREA ─── */
#tender-input {
  width: 100%;
  flex: 1;
  min-height: 0;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 0.93rem;
  line-height: 1.65;
  padding: 16px 18px;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}

#tender-input:focus { border-color: rgba(245,158,11,0.35); }
#tender-input::placeholder { color: var(--fg-dim); }

.input-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.char-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-dim);
}

.char-count.warn { color: var(--accent); }
.char-count.over { color: #ef4444; }

/* ─── DRAFT OUTPUT ─── */
.draft-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  gap: 14px;
  color: var(--fg-dim);
}

.draft-empty-icon {
  font-size: 2.8rem;
  opacity: 0.35;
}

.draft-empty p {
  font-size: 0.88rem;
  max-width: 220px;
  line-height: 1.6;
}

.draft-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 18px;
  color: var(--fg-muted);
}

.draft-loading p { font-size: 0.88rem; }

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(245,158,11,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* ─── DRAFT SECTIONS ─── */
.draft-sections { display: flex; flex-direction: column; gap: 0; }

.draft-section {
  padding: 18px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.draft-section:last-child { border-bottom: none; padding-bottom: 8px; }

.ds-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ds-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
}

.ds-body {
  font-size: 0.875rem;
  color: var(--fg-muted);
  line-height: 1.7;
  white-space: pre-wrap;
}

.ds-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}

.ds-body ul li::before {
  content: '→ ';
  color: var(--accent);
  font-weight: 600;
}

/* ─── OUTPUT TOOLBAR ─── */
.output-toolbar {
  padding: 10px 28px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.copy-ok {
  font-size: 0.78rem;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.3s;
  margin-left: 4px;
}

.copy-ok.show { opacity: 1; }

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 11px 18px;
  font-size: 0.88rem;
  color: var(--fg);
  z-index: 999;
  animation: fadeUp 0.25s ease;
  max-width: 300px;
}

.toast.error { border-color: rgba(239,68,68,0.4); color: #fca5a5; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.18); }

/* ─── RESPONSIVE ─── */
@media (max-width: 800px) {
  .nav { padding: 14px 20px; }
  .nav-links a:not(.btn) { display: none; }

  .app-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .app-wrapper { height: auto; }

  .input-panel {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    height: 380px;
  }

  .output-panel { min-height: 400px; }
  .draft-empty { height: auto; padding: 40px 20px; }
  .draft-loading { height: auto; padding: 40px 20px; }
}

@media print {
  .nav, .input-panel, .output-toolbar, .panel-header .btn { display: none !important; }
  .app-body { display: block; }
  .output-panel { background: #fff; color: #000; }
  .ds-label { color: #92400e; }
  .ds-body { color: #374151; }
  .ds-title { color: #111827; }
}
