/* ─── NULSTILLING & FONTS ─── */
:root {
    --bg-dark: #0B0A0F;
    --bg-panel: #0F0E14;
    --accent: #B185FF;
    --text: #FFF;
    --text-dim: #94A3B8;
    --border: rgba(255,255,255,0.1);
    --radius-lg: 20px;
}

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

html, body { 
    height: 100%; 
    width: 100%; 
    background: var(--bg-dark); 
    color: var(--text); 
    font-family: 'Inter', sans-serif; 
    overflow: hidden; 
}

/* Tvinger alle profilbilleder til at være små */
img.avatar-small { 
    width: 40px !important; 
    height: 40px !important; 
    border-radius: 50% !important; 
    object-fit: cover !important; 
}

#portal-app { 
    display: flex; 
    width: 100vw; 
    height: 100vh; 
}

/* SIDEBAR */
#sidebar { 
    width: 320px; 
    background: var(--bg-panel); 
    border-right: 1px solid var(--border); 
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0; 
    z-index: 2000;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header { 
    padding: 25px; 
    border-bottom: 1px solid var(--border); 
}

.logo { 
    font-family: 'Outfit', sans-serif; 
    font-size: 1.4rem; 
    font-weight: 900; 
}
.logo span { color: var(--accent); }

.scroll-area { 
    flex: 1; 
    overflow-y: auto; 
    padding-bottom: 40px; 
}

.section-title { 
    padding: 20px 25px 10px; 
    font-size: 0.7rem; 
    color: var(--text-dim); 
    text-transform: uppercase; 
    letter-spacing: 1px; 
}

.agent-list { 
    display: flex; 
    flex-direction: column; 
    padding: 0 10px; 
}

.agent-item { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    padding: 10px; 
    border-radius: 12px; 
    cursor: pointer; 
    transition: 0.2s; 
}
.agent-item:hover { background: rgba(255,255,255,0.05); }
.agent-item.active { background: rgba(177,133,255,0.1); border-left: 3px solid var(--accent); }
.agent-item img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.agent-info strong { display: block; font-size: 0.85rem; }
.agent-info span { font-size: 0.7rem; color: var(--text-dim); }

/* CHAT */
#chat-window { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    min-width: 0; 
    background: var(--bg-dark); 
}

.chat-header { 
    height: 70px; 
    padding: 0 20px; 
    border-bottom: 1px solid var(--border); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
}

.header-left { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    min-width: 0; 
}

.header-text h2 { 
    font-size: 1rem; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}
.header-text p { 
    font-size: 0.75rem; 
    color: var(--text-dim); 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
}

.credits { 
    background: rgba(177,133,255,0.1); 
    padding: 6px 12px; 
    border-radius: 50px; 
    color: var(--accent); 
    font-weight: 700; 
    font-size: 0.8rem; 
    border: 1px solid rgba(177,133,255,0.2); 
}

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

/* MESSAGE BUBBLES */
.message {
    max-width: 85%;
    padding: 15px 20px;
    border-radius: 20px;
    line-height: 1.4;
    font-size: 0.95rem;
}

.message p { margin-bottom: 8px; }
.message p:last-child { margin-bottom: 0; }
.message h2, .message h3 { margin: 15px 0 8px 0; color: var(--accent); }

.message pre {
    background: #000 !important;
    padding: 20px;
    border-radius: 12px;
    margin: 15px 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
    overflow-x: auto;
}

.copy-btn, .download-btn {
    position: absolute;
    top: 10px;
    background: var(--accent);
    color: #000;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    transition: 0.2s;
}
.copy-btn { right: 10px; }
.download-btn { right: 85px; background: #FFF; }
.deploy-help-btn { 
    right: 180px; 
    background: #000; 
    color: var(--accent); 
    border: 1px solid var(--accent);
}

.mockup-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.mockup-item {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: 0.3s;
}
.mockup-item:hover { transform: translateY(-5px); border-color: var(--accent); }
.mockup-item img {
    width: 100%;
    border-radius: 8px;
    margin-top: 8px;
    aspect-ratio: 16/9;
    object-fit: cover;
}
.mockup-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.message img {
    max-width: 100%;
    width: auto;
    max-height: 400px;
    border-radius: 12px;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.msg-user, .bubble-u { 
    align-self: flex-end; 
    background: var(--accent); 
    color: #000; 
    border-bottom-right-radius: 4px; 
}
.msg-ai, .bubble-a { 
    align-self: flex-start; 
    background: #1A1922; 
    border: 1px solid var(--border); 
    border-bottom-left-radius: 4px; 
}
.system-msg, .sys-msg { 
    align-self: center; 
    text-align: center; 
    color: var(--text-dim); 
    font-size: 0.8rem; 
}

.footer { 
    padding: 15px 20px calc(15px + env(safe-area-inset-bottom)); 
    border-top: 1px solid var(--border); 
}

.input-wrap { 
    display: flex; 
    gap: 10px; 
    align-items: flex-end; 
}

#chat-input { 
    flex: 1; 
    background: #1A1922; 
    border: 1px solid var(--border); 
    border-radius: 12px; 
    padding: 12px; 
    color: #FFF; 
    font-size: 1rem; 
    resize: none; 
    min-height: 48px; 
    max-height: 120px; 
}

.btn-send { background: var(--accent); color: #000; padding: 0 20px; border-radius: 10px; border: none; font-weight: 700; height: 48px; cursor: pointer; }

/* SHARED BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.btn--primary { background: var(--accent); color: #000; }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(177,133,255,0.4); }

.btn--ghost { background: rgba(255,255,255,0.05); color: #FFF; border: 1px solid rgba(255,255,255,0.1); }
.btn--ghost:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); }

/* MOBILE EXTREME */
.menu-btn { 
    display: none; 
    background: rgba(177,133,255,0.1); 
    border: 1px solid var(--accent); 
    padding: 8px 12px; 
    border-radius: 10px; 
    color: var(--accent); 
    font-weight: 800; 
    font-size: 0.7rem; 
    cursor: pointer; 
}

@media (max-width: 800px) {
    #sidebar { 
        position: fixed; 
        left: -100%; 
        top: 0; 
        height: 100%; 
        width: 300px; 
        box-shadow: 20px 0 50px rgba(0,0,0,0.8); 
    }
    #sidebar.open { left: 0; }
    #sidebar.is-open { left: 0; }
    
    .menu-btn { display: block; }
    .message, .bubble { max-width: 95%; }
    .chat-header { padding: 0 12px; }
}

/* LOGIN */
#login-overlay { 
    position: fixed; 
    inset: 0; 
    z-index: 5000; 
    background: var(--bg-dark); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.login-box { 
    background: var(--bg-panel); 
    border: 1px solid var(--border); 
    border-radius: 25px; 
    padding: 40px; 
    width: 90%; 
    max-width: 380px; 
    text-align: center; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.5); 
}
.input-field { 
    width: 100%; 
    padding: 12px; 
    background: rgba(0,0,0,0.3); 
    border: 1px solid var(--border); 
    border-radius: 10px; 
    color: #FFF; 
    margin-bottom: 10px; 
    font-size: 1rem; 
}

/* CV MODAL */
/* ─── CV MODAL (Landing Page Sync) ─── */
.cv-modal {
  position: fixed; inset: 0; z-index: 10001;
  display: none; align-items: center; justify-content: center;
}
.cv-modal.is-active { display: flex; }
.cv-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(12px); }
.cv-modal__box {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 25px;
  width: min(680px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  box-shadow: 0 30px 60px rgba(0,0,0,0.8);
}
.modal__close {
  position: absolute; top: 16px; right: 20px;
  background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 1.8rem;
  z-index: 10;
}
.modal__close:hover { color: #FFF; }

.cv-header { display: flex; gap: 24px; align-items: center; margin-bottom: 32px; }
.cv-avatar-small { 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    object-fit: cover; 
}

.sub-agent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-dark);
    margin-left: -12px;
    z-index: 1;
    transition: transform 0.2s;
}
.sub-agent-avatar:hover {
    transform: translateY(-2px);
    z-index: 10;
}

.cv-avatar { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); flex-shrink: 0; }
.cv-name { font-size: 1.8rem; font-weight: 800; color: #FFF; }
.cv-title { color: var(--text-dim); margin-top: 4px; }
.cv-badge { display: inline-block; margin-top: 8px; font-size: 0.72rem; font-weight: 700; padding: 4px 12px; border-radius: 50px; background: rgba(16,185,129,0.1); color: #10B981; border: 1px solid rgba(16,185,129,0.2); }

.cv-stats-row {
  display: flex; margin-bottom: 24px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border);
  border-radius: 15px; overflow: hidden;
}
.cv-stat {
  flex: 1; text-align: center; padding: 16px 10px;
  border-right: 1px solid var(--border);
}
.cv-stat:last-child { border-right: none; }
.cv-stat strong { display: block; font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.cv-stat span { font-size: 0.75rem; color: var(--text-dim); }

.cv-tabs { display: flex; gap: 10px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.cv-tab {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 0.9rem; font-weight: 600; padding: 10px 15px;
  border-bottom: 2px solid transparent; transition: 0.2s;
}
.cv-tab--active { color: var(--accent); border-bottom-color: var(--accent); }

.cv-price-box {
  display: grid; grid-template-columns: 1fr 1fr; gap: 15px;
  border-top: 1px solid var(--border); padding-top: 25px; margin-top: 25px;
}
.price-option { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 15px; padding: 20px; text-align: center; }
.price-option h5 { font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; margin-bottom: 10px; }
.price-option .big-price { font-size: 2rem; font-weight: 800; color: #FFF; margin-bottom: 5px; }
.price-option p { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 15px; }

@media (max-width: 600px) {
    .cv-header { flex-direction: column; text-align: center; }
    .cv-price-box { grid-template-columns: 1fr; }
}

/* MILESTONE / HIRE CARDS */
.hire-card { 
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 20px 0;
    max-width: 380px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    transition: transform 0.2s ease;
}
.hire-card:hover { transform: translateY(-3px); border-color: var(--accent); }

.hire-card__header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }

.hire-card__avatar-box { position: relative; width: 64px; height: 64px; }
.hire-card__avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); }
.hire-card__dot { 
    position: absolute; bottom: 2px; right: 2px; width: 14px; height: 14px; 
    background: #10B981; border: 2px solid var(--bg-panel); border-radius: 50%; 
}

.hire-card__name { font-weight: 700; font-size: 1.1rem; color: #FFF; margin-bottom: 2px; }
.hire-card__title { font-size: 0.8rem; color: var(--text-dim); }

.hire-card__actions { display: flex; gap: 10px; }

.hire-card__btn { 
    flex: 1; height: 44px; border-radius: 10px; border: none; 
    font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: 0.2s; 
}
.hire-card__btn--ghost { background: rgba(255,255,255,0.05); color: #FFF; border: 1px solid rgba(255,255,255,0.1); }
.hire-card__btn--ghost:hover { background: rgba(255,255,255,0.1); }
.hire-card__btn--primary { background: var(--accent); color: #000; }
.hire-card__btn--primary:hover { transform: scale(1.02); filter: brightness(1.1); }
