/* Marketing Stack Finder – Frontend Widget */

.msf-widget {
    max-width: 720px;
    margin: 0 auto;
    font-family: Georgia, 'Times New Roman', serif;
    border-radius: 20px;
    overflow: hidden;
}

/* ── Dark theme ─────────────────────────────────────────────── */
.msf-theme-dark {
    background: linear-gradient(135deg, #0a0a0f 0%, #0f0f1a 50%, #0a1020 100%);
    color: #f0f0f8;
    border: 1px solid rgba(255,255,255,0.08);
}
.msf-theme-dark .msf-header     { border-bottom: 1px solid rgba(255,255,255,0.07); }
.msf-theme-dark .msf-eyebrow    { color: #00d4ff; }
.msf-theme-dark .msf-title      { color: #f0f0f8; }
.msf-theme-dark .msf-divider    { background: linear-gradient(90deg, #00d4ff, var(--msf-accent,#7b2fff)); }
.msf-theme-dark .msf-bot-bubble { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); color: #f0f0f8; }
.msf-theme-dark .msf-user-bubble{ background: linear-gradient(135deg, var(--msf-accent,#7b2fff), #00d4ff); color: #fff; }
.msf-theme-dark .msf-option     { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.12); color: #c0c0d0; }
.msf-theme-dark .msf-option:hover{ background: rgba(123,47,255,0.15); border-color: var(--msf-accent,#7b2fff); color: #d0a0ff; }
.msf-theme-dark .msf-option.selected{ background: rgba(0,212,255,0.15); border-color: #00d4ff; color: #00d4ff; }
.msf-theme-dark .msf-result-box { background: rgba(255,255,255,0.03); border: 1px solid rgba(0,212,255,0.2); }
.msf-theme-dark .msf-stack-vis  { background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.06); }
.msf-theme-dark .msf-stack-row  { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); }
.msf-theme-dark .msf-alt-item   { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); }
.msf-theme-dark .msf-next-steps { background: rgba(0,212,255,0.05); border: 1px solid rgba(0,212,255,0.15); }
.msf-theme-dark .msf-restart    { background: transparent; border: 1px solid rgba(123,47,255,0.4); color: var(--msf-accent,#7b2fff); }
.msf-theme-dark .msf-restart:hover{ background: rgba(123,47,255,0.1); }
.msf-theme-dark .msf-section-label { color: var(--msf-accent,#7b2fff); }
.msf-theme-dark .msf-reason-bullet::before { color: #00d4ff; }
.msf-theme-dark .msf-bot-icon   { background: linear-gradient(135deg, #00d4ff, var(--msf-accent,#7b2fff)); }

/* ── Light theme ─────────────────────────────────────────────── */
.msf-theme-light {
    background: #f8f8ff;
    color: #1a1a2e;
    border: 1px solid #e0e0f0;
    box-shadow: 0 4px 24px rgba(123,47,255,0.08);
}
.msf-theme-light .msf-header     { border-bottom: 1px solid #e8e8f0; }
.msf-theme-light .msf-eyebrow    { color: var(--msf-accent,#7b2fff); }
.msf-theme-light .msf-title      { color: #1a1a2e; }
.msf-theme-light .msf-divider    { background: linear-gradient(90deg, var(--msf-accent,#7b2fff), #00d4ff); }
.msf-theme-light .msf-bot-bubble { background: #fff; border: 1px solid #e0e0f0; color: #1a1a2e; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.msf-theme-light .msf-user-bubble{ background: linear-gradient(135deg, var(--msf-accent,#7b2fff), #00d4ff); color: #fff; }
.msf-theme-light .msf-option     { background: #fff; border: 1px solid #dde; color: #333; }
.msf-theme-light .msf-option:hover{ background: #f0ebff; border-color: var(--msf-accent,#7b2fff); color: var(--msf-accent,#7b2fff); }
.msf-theme-light .msf-option.selected{ background: #e8f8ff; border-color: #00a8cc; color: #007a99; }
.msf-theme-light .msf-result-box { background: #fff; border: 1px solid #dde; box-shadow: 0 2px 12px rgba(123,47,255,0.06); }
.msf-theme-light .msf-stack-vis  { background: #f4f4ff; border: 1px solid #e0e0f0; }
.msf-theme-light .msf-stack-row  { background: #fafafe; border: 1px solid #eee; }
.msf-theme-light .msf-alt-item   { background: #fafafe; border: 1px solid #eee; }
.msf-theme-light .msf-next-steps { background: #eaf7ff; border: 1px solid #bee3f8; }
.msf-theme-light .msf-restart    { background: transparent; border: 1px solid var(--msf-accent,#7b2fff); color: var(--msf-accent,#7b2fff); }
.msf-theme-light .msf-restart:hover{ background: #f0ebff; }
.msf-theme-light .msf-section-label { color: var(--msf-accent,#7b2fff); }
.msf-theme-light .msf-reason-bullet::before { color: #00a8cc; }
.msf-theme-light .msf-bot-icon   { background: linear-gradient(135deg, var(--msf-accent,#7b2fff), #00d4ff); }

/* ── Shared ─────────────────────────────────────────────────── */
.msf-header    { padding: 28px 28px 20px; }
.msf-eyebrow   { font-family: 'Courier New', monospace; font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; display: block; margin-bottom: 6px; }
.msf-title     { margin: 0 0 10px; font-size: 24px; font-weight: 400; letter-spacing: -0.01em; }
.msf-divider   { width: 56px; height: 2px; border-radius: 2px; }

.msf-chat      { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; min-height: 80px; }

.msf-msg       { display: flex; align-items: flex-start; gap: 10px; animation: msfFadeUp 0.35s ease both; }
.msf-msg-user  { flex-direction: row-reverse; }

.msf-bot-icon  { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; margin-top: 2px; color: #fff; }

.msf-bubble-wrap { display: flex; flex-direction: column; gap: 8px; max-width: 82%; }
.msf-msg-user .msf-bubble-wrap { align-items: flex-end; }

.msf-bot-bubble,
.msf-user-bubble {
    padding: 11px 15px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.6;
}
.msf-bot-bubble  { border-radius: 4px 18px 18px 18px; }
.msf-user-bubble { border-radius: 18px 18px 4px 18px; }

.msf-options { display: flex; flex-direction: column; gap: 6px; }
.msf-option  {
    padding: 9px 14px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.02em;
    background: none;
}
.msf-option:disabled { cursor: default; }
.msf-option.selected { cursor: default; }

/* Result */
.msf-result     { padding: 0 20px 20px; }
.msf-result-box { border-radius: 16px; padding: 24px; }
.msf-result-eyebrow { font-family: 'Courier New', monospace; font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; margin-bottom: 4px; }
.msf-result-title   { font-size: 20px; font-weight: 400; margin: 0 0 18px; }

.msf-section-label  { font-family: 'Courier New', monospace; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 10px; display: block; }

/* Stack visual */
.msf-stack-vis {
    border-radius: 10px;
    padding: 14px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.msf-snode       { flex-shrink: 0; }
.msf-snode-lbl   { font-size: 10px; color: #888; margin-bottom: 3px; }
.msf-snode-val   { border-radius: 6px; padding: 5px 10px; font-size: 12px; }
.msf-sarrow      { font-size: 16px; color: #555; flex-shrink: 0; }

/* Stack rows */
.msf-stack-rows { display: grid; gap: 10px; margin-bottom: 20px; }
.msf-stack-row  { display: flex; gap: 12px; border-radius: 8px; padding: 10px 12px; align-items: flex-start; }
.msf-row-icon   { font-size: 18px; flex-shrink: 0; }
.msf-row-lbl    { font-family: 'Courier New', monospace; font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase; color: #888; margin-bottom: 2px; }
.msf-row-val    { font-size: 14px; }

/* Reasons */
.msf-reasons { margin-bottom: 20px; }
.msf-reason-bullet { display: flex; gap: 8px; margin-bottom: 7px; font-size: 14px; line-height: 1.5; }
.msf-reason-bullet::before { content: "✦"; flex-shrink: 0; margin-top: 1px; }

/* Alternatives */
.msf-alts { margin-bottom: 20px; }
.msf-alt-item  { border-radius: 8px; padding: 10px 12px; margin-bottom: 7px; display: flex; gap: 10px; }
.msf-alt-num   { font-family: 'Courier New', monospace; font-size: 13px; color: #f97316; flex-shrink: 0; }
.msf-alt-name  { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.msf-alt-desc  { font-size: 13px; color: #888; }

/* Next steps */
.msf-next-steps { border-radius: 10px; padding: 14px; margin-bottom: 18px; }
.msf-next-step  { display: flex; gap: 10px; margin-bottom: 6px; font-size: 14px; }
.msf-next-num   { font-family: 'Courier New', monospace; font-size: 13px; color: #00a8cc; flex-shrink: 0; }

/* Provider link */
.msf-plink { font-size: 11px; margin-left: 6px; opacity: 0.7; text-decoration: none; }
.msf-plink:hover { opacity: 1; }

/* Restart */
.msf-restart {
    display: block;
    margin: 0 20px 20px;
    padding: 10px 24px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.2s;
}

/* Loading dots */
.msf-loading::after {
    content: '';
    animation: msfDots 1.2s infinite;
}
@keyframes msfDots {
    0%   { content: '.'; }
    33%  { content: '..'; }
    66%, 100% { content: '...'; }
}
@keyframes msfFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
