/* ══════════════════════════════════════════
   FRIBOURG EXPORT – exportstrategy_style.css
   Dark tech / Swiss precision aesthetic
   Matches riskanalyser_style.css base
══════════════════════════════════════════ */

:root {
  --red:         #E8192C;
  --red-hover:   #c9111f;
  --red-glow:    rgba(232,25,44,0.3);
  --gold:        #D4A83A;
  --dark:        #080b10;
  --dark2:       #0d1018;
  --card-bg:     rgba(13,16,24,0.90);
  --card-border: rgba(255,255,255,0.08);
  --text:        #ffffff;
  --muted:       rgba(255,255,255,0.55);
  --dim:         rgba(255,255,255,0.3);
  --green:       #22c55e;
  --orange:      #f59e0b;
  --accent:      #4fc8e8;
  --font:        'Barlow', sans-serif;
  --font-cond:   'Barlow Condensed', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Animated grid background ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(232,25,44,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,25,44,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── BACKGROUND ── */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
}
.bg-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(5,8,14,0.92) 0%,
    rgba(5,8,14,0.80) 40%,
    rgba(5,8,14,0.70) 70%,
    rgba(5,8,14,0.88) 100%
  );
}

/* ── CORNER DECORATIONS ── */
.corner {
  position: fixed;
  width: 20px;
  height: 20px;
  z-index: 50;
  pointer-events: none;
}
.corner::before,
.corner::after {
  content: '';
  position: absolute;
  background: var(--red);
  opacity: 0.5;
}
.corner::before { width: 100%; height: 1px; }
.corner::after  { width: 1px; height: 100%; }

.c-tl { top: 8px; left: 8px; }
.c-tl::before { top: 0; left: 0; }
.c-tl::after  { top: 0; left: 0; }

.c-tr { top: 8px; right: 8px; }
.c-tr::before { top: 0; right: 0; }
.c-tr::after  { top: 0; right: 0; }

.c-bl { bottom: 8px; left: 8px; }
.c-bl::before { bottom: 0; left: 0; }
.c-bl::after  { bottom: 0; left: 0; }

.c-br { bottom: 8px; right: 8px; }
.c-br::before { bottom: 0; right: 0; }
.c-br::after  { bottom: 0; right: 0; }

/* ══ NAVBAR ══ */
.navbar {
  position: sticky; top: 0;
  height: 62px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  background: rgba(8,11,16,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  z-index: 200;
}
/* Disable nav link */
.nav-link.disabled {
  pointer-events: none;   /* ❌ cannot click */
  opacity: 0.4;           /* looks disabled */
  cursor: default;
}

/* Optional: remove hover effect */
.nav-link.disabled:hover {
  background: none;
  color: rgba(255,255,255,0.4);
}
.logo {
  display: flex; align-items: center; gap: 11px;
  cursor: pointer;
}
.logo-icon {
  width: 36px; height: 36px; min-width: 36px;
  border-radius: 8px;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
}
.logo-icon img { width: 80%; height: 80%; object-fit: contain; }
.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-name {
  font-family: var(--font-cond); font-weight: 800;
  font-size: 15px; letter-spacing: 0.08em;
}
.logo-tagline {
  font-size: 9px; font-weight: 500;
  letter-spacing: 0.14em; color: var(--muted); margin-top: 3px;
}
.nav-center { display: flex; gap: 6px; }
.nav-link {
  color: var(--muted); text-decoration: none;
  font-size: 13px; font-weight: 500; letter-spacing: 0.02em;
  padding: 5px 12px; border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  position: relative;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-link.active { color: #fff; }
.nav-link.active::after {
  content: '';
  position: absolute; bottom: -3px; left: 12px; right: 12px;
  height: 2px; background: var(--red); border-radius: 1px;
}
.nav-right { display: flex; align-items: center; gap: 18px; }
.secure-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
}
.lang-sel { font-size: 13px; font-weight: 600; cursor: pointer; }

/* ══ PAGE LAYOUT ══ */
.page {
  position: relative; z-index: 1;
  max-width: 1340px; margin: 0 auto;
  padding: 32px 28px 80px;
}

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--dim); margin-bottom: 24px;
}
.breadcrumb a { color: var(--muted); text-decoration: none; transition: color 0.2s; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .sep { color: var(--dim); }
.breadcrumb .current { color: var(--red); font-weight: 600; }

/* ── PAGE HEADER ── */
.strategy-header {
  margin-bottom: 32px;
}
.header-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.15em;
  color: var(--red); text-transform: uppercase; margin-bottom: 10px;
}
.header-title {
  font-family: var(--font-cond);
  font-weight: 800; font-size: 42px; line-height: 1.05;
  letter-spacing: -0.01em; margin-bottom: 12px;
}
.header-title .dot { color: var(--red); }
.header-sub {
  font-size: 14px; color: var(--muted);
  line-height: 1.65; max-width: 600px;
}

/* ══ MAIN LAYOUT ══ */
.strategy-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  height: calc(100vh - 280px);
  min-height: 520px;
}

/* ══ LEFT CONTEXT PANEL ══ */
.context-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  backdrop-filter: blur(18px);
}

.panel-section { display: flex; flex-direction: column; gap: 8px; }

.panel-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; color: var(--red); text-transform: uppercase;
}

.panel-desc {
  font-size: 12px; color: var(--muted); line-height: 1.55;
}

.select-wrapper { position: relative; }
.select-arrow {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted); font-size: 11px; pointer-events: none;
}
.form-select {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 7px;
  color: #fff;
  font-family: var(--font);
  font-size: 13px; font-weight: 500;
  padding: 9px 28px 9px 12px;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.2s;
  outline: none;
}
.form-select:focus { border-color: var(--red); }
.form-select option { background: #111519; color: #fff; }

/* Stage / Goal pills */
.stage-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.stage-pill {
  font-family: var(--font);
  font-size: 11px; font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.stage-pill:hover { border-color: var(--red); color: #fff; }
.stage-pill.active {
  background: rgba(232,25,44,0.15);
  border-color: var(--red);
  color: #fff;
}

/* Prefill button */
.prefill-btn {
  width: 100%;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 16px;
  font-family: var(--font-cond);
  font-size: 14px; font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 18px var(--red-glow);
  margin-top: 2px;
}
.prefill-btn:hover {
  background: var(--red-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(232,25,44,0.5);
}
.btn-arrow { font-size: 16px; line-height: 1; }

/* Strategy Pillars */
.pillars-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px;
  margin-top: auto;
}
.pillars-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; color: var(--dim); text-transform: uppercase;
  margin-bottom: 10px;
}
.pillar-item {
  display: flex; align-items: center; gap: 9px;
  font-size: 12px; color: var(--muted);
  padding: 4px 0;
}
.pillar-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.pillar-dot.red    { background: var(--red); }
.pillar-dot.orange { background: var(--orange); }
.pillar-dot.green  { background: var(--green); }
.pillar-dot.accent { background: var(--accent); }
.pillar-dot.gold   { background: var(--gold); }
.pillar-dot.muted  { background: var(--muted); }

/* ══ RIGHT CHAT PANEL ══ */
.chat-panel {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(18px);
}

/* MESSAGES AREA */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
}

/* Custom scrollbar */
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Messages ── */
.message {
  display: flex;
  gap: 12px;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.user-message {
  flex-direction: row-reverse;
}

/* Avatar */
.msg-avatar {
  width: 34px; height: 34px; min-width: 34px;
  border-radius: 50%;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}
.msg-avatar img { width: 70%; height: 70%; object-fit: contain; }
.user-avatar-icon {
  font-size: 15px; color: #fff;
}

/* Bubble */
.msg-bubble {
  max-width: 72%;
  display: flex; flex-direction: column; gap: 4px;
}
.user-message .msg-bubble { align-items: flex-end; }

.msg-sender {
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.08em; color: var(--red); text-transform: uppercase;
}
.user-message .msg-sender { color: var(--muted); }

.msg-text {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px 12px 12px 4px;
  padding: 13px 16px;
  font-size: 13.5px; line-height: 1.65;
  color: rgba(255,255,255,0.85);
}
.user-message .msg-text {
  background: rgba(232,25,44,0.12);
  border-color: rgba(232,25,44,0.25);
  border-radius: 12px 12px 4px 12px;
  color: rgba(255,255,255,0.9);
}

/* Markdown-style formatting inside AI responses */
.msg-text h2 {
  font-family: var(--font-cond);
  font-size: 16px; font-weight: 800;
  color: #fff; letter-spacing: 0.03em;
  margin: 16px 0 6px;
}
.msg-text h2:first-child { margin-top: 0; }
.msg-text h3 {
  font-family: var(--font-cond);
  font-size: 13.5px; font-weight: 700;
  color: var(--red); letter-spacing: 0.04em; text-transform: uppercase;
  margin: 12px 0 5px;
}
.msg-text ul, .msg-text ol {
  padding-left: 18px; margin: 6px 0;
}
.msg-text li { margin: 4px 0; }
.msg-text strong { color: #fff; font-weight: 700; }
.msg-text em { color: var(--muted); }
.msg-text hr {
  border: none; border-top: 1px solid rgba(255,255,255,0.08);
  margin: 14px 0;
}
.msg-text code {
  background: rgba(255,255,255,0.08);
  border-radius: 4px; padding: 1px 6px;
  font-size: 12px; color: var(--accent);
}
.msg-text blockquote {
  border-left: 3px solid var(--red);
  padding-left: 12px; margin: 10px 0;
  color: var(--muted); font-style: italic;
}

.msg-time {
  font-size: 10px; color: var(--dim);
  margin-top: 2px; padding: 0 4px;
}

/* Typing indicator */
.typing-indicator {
  display: flex; align-items: center; gap: 5px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px 12px 12px 4px;
  width: fit-content;
}
.typing-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ── CHAT INPUT AREA ── */
.chat-input-area {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 14px 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
}

/* Suggested prompts */
.suggested-prompts {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}
.prompt-label {
  font-size: 11px; font-weight: 600;
  color: var(--dim); letter-spacing: 0.06em; text-transform: uppercase;
  flex-shrink: 0;
}
.suggest-chip {
  font-size: 11.5px; font-weight: 500;
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.suggest-chip:hover {
  border-color: rgba(232,25,44,0.4);
  color: #fff;
  background: rgba(232,25,44,0.08);
}

/* Input row */
.input-row {
  display: flex; align-items: flex-end; gap: 10px;
}
.chat-textarea {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #fff;
  font-family: var(--font);
  font-size: 13.5px; line-height: 1.6;
  padding: 11px 14px;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  max-height: 120px;
  overflow-y: auto;
}
.chat-textarea:focus { border-color: var(--red); }
.chat-textarea::placeholder { color: rgba(255,255,255,0.3); }

/* Send button */
.send-btn {
  width: 42px; height: 42px; min-width: 42px;
  background: var(--red);
  border: none; border-radius: 10px;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 3px 14px var(--red-glow);
  flex-shrink: 0;
}
.send-btn:hover {
  background: var(--red-hover);
  transform: translateY(-1px);
  box-shadow: 0 5px 20px rgba(232,25,44,0.5);
}
.send-btn:active { transform: translateY(0); }
.send-btn:disabled {
  background: rgba(255,255,255,0.08);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Input footer */
.input-footer {
  display: flex; align-items: center; justify-content: space-between;
}
.ai-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--dim); letter-spacing: 0.04em;
}
.char-count {
  font-size: 10.5px; color: var(--dim);
}
.char-count.warn { color: var(--orange); }
.char-count.error { color: var(--red); }

/* ══ BOTTOM BAR ══ */
.bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 36px; z-index: 100;
  background: rgba(8,11,16,0.85); backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 28px;
}
.bottom-emblem {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
.bottom-emblem .emblem-cross {
  width: 22px; height: 22px;
  background: var(--red);
  display: flex; align-items: center; justify-content: center;
  clip-path: polygon(40% 0%, 60% 0%, 60% 40%, 100% 40%, 100% 60%, 60% 60%, 60% 100%, 40% 100%, 40% 60%, 0% 60%, 0% 40%, 40% 40%);
}
.bottom-tagline {
  font-family: var(--font-cond); font-size: 11px; font-weight: 600;
  letter-spacing: 0.12em; color: var(--dim); text-transform: uppercase;
}

/* ══ RESPONSIVE ══ */
@media (max-width: 900px) {
  .strategy-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .context-panel {
    max-height: 420px;
  }
  .chat-panel {
    min-height: 520px;
  }
  .nav-center { display: none; }
  .header-title { font-size: 30px; }
}

/* ── UTILITY ── */
.hidden { display: none !important; }