/* PMQs — Design: Industrial Command Center */
/* Fonts: Syne (display) + JetBrains Mono (code/data) + Bitter (body) */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=JetBrains+Mono:wght@300;400;500&family=Bitter:ital,wght@0,300;0,400;0,600;1,300&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --bg:        #0c0e12;
    --bg2:       #13161d;
    --bg3:       #1a1e28;
    --surface:   #1f2433;
    --border:    #2a3045;
    --border2:   #3d4560;
    --accent:    #4f7fff;
    --accent2:   #2dd4bf;
    --accent3:   #f59e0b;
    --danger:    #ef4444;
    --success:   #22c55e;
    --text:      #e2e8f0;
    --text2:     #94a3b8;
    --text3:     #4b5870;
    --radius:    6px;
    --mono:      'JetBrains Mono', monospace;
    --sans:      'Syne', sans-serif;
    --serif:     'Bitter', serif;
    --col-left:  340px;
    --col-right: 320px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 15px; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--serif);
    font-weight: 300;
    height: 100%;
    overflow: hidden;
    line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
button { cursor: pointer; font-family: var(--sans); }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── Landing / Auth screens ─────────────────────────────────── */
#app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Landing */
.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.landing::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(79,127,255,.08) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(45,212,191,.06) 0%, transparent 70%);
    pointer-events: none;
}

.landing-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 48px 48px;
    opacity: 0.3;
}

.landing-card {
    position: relative;
    z-index: 1;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 12px;
    padding: 48px 56px;
    width: 440px;
    box-shadow: 0 32px 80px rgba(0,0,0,.5);
}

.landing-logo {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 2.4rem;
    letter-spacing: -.04em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.landing-logo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 20px var(--accent);
}

.landing-subtitle {
    font-family: var(--mono);
    font-size: .75rem;
    color: var(--text3);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 40px;
}

/* ── Form Inputs ────────────────────────────────────────────── */
.field { margin-bottom: 20px; }
.field label {
    display: block;
    font-family: var(--mono);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text3);
    margin-bottom: 8px;
}
.field input, .field select, .field textarea {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--text);
    font-family: var(--serif);
    font-size: .9rem;
    outline: none;
    transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(79,127,255,.15);
}
.field select { appearance: none; }
.field textarea { resize: vertical; min-height: 80px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-family: var(--sans);
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .01em;
    border: none;
    transition: all .15s;
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: #3d6be8; box-shadow: 0 4px 16px rgba(79,127,255,.35); }
.btn-secondary {
    background: transparent;
    color: var(--text2);
    border: 1px solid var(--border2);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover { opacity: .88; }
.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { opacity: .88; }
.btn-accent2 {
    background: var(--accent2);
    color: var(--bg);
}
.btn-accent2:hover { opacity: .88; }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: .75rem; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ── Main Menu ──────────────────────────────────────────────── */
.menu-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.menu-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 100% 60% at 50% 30%, rgba(79,127,255,.10) 0%, transparent 70%),
        var(--bg);
}

.menu-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(79,127,255,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79,127,255,.05) 1px, transparent 1px);
    background-size: 60px 60px;
}

.menu-header {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-bottom: 60px;
}

.menu-title {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 4rem;
    letter-spacing: -.06em;
    line-height: 1;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 60%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.menu-tagline {
    font-family: var(--mono);
    font-size: .78rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: var(--text3);
    margin-top: 10px;
}

.menu-cards {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.menu-card {
    width: 220px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}

.menu-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,.4), 0 0 0 1px var(--accent);
}

.menu-card-icon {
    font-size: 2rem;
    line-height: 1;
}

.menu-card-title {
    font-family: var(--sans);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.menu-card-desc {
    font-size: .8rem;
    color: var(--text2);
    line-height: 1.5;
}

.menu-user {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .8rem;
    color: var(--text2);
}

/* ── App Header ─────────────────────────────────────────────── */
#header {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header-logo {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -.03em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 7px;
}

.header-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.header-project {
    font-family: var(--mono);
    font-size: .72rem;
    color: var(--text3);
    padding: 3px 10px;
    background: var(--bg3);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.header-spacer { flex: 1; }

.session-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: .7rem;
    color: var(--text3);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text3);
}

.status-dot.live {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

/* ── Three-Column Layout ────────────────────────────────────── */
#workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 0;
}

.col {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border);
}

.col:last-child { border-right: none; }

.col-header {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.col-title {
    font-family: var(--mono);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--text3);
    flex: 1;
}

.col-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* ── Left: Claude Code Terminal ─────────────────────────────── */
#col-code {
    width: var(--col-left);
    flex-shrink: 0;
    background: var(--bg);
}

.code-output {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: var(--bg);
    font-family: var(--mono);
    font-size: .78rem;
    line-height: 1.7;
}

.code-entry {
    margin-bottom: 16px;
    animation: fadeIn .2s ease;
}

.code-entry-prompt {
    color: var(--accent);
    margin-bottom: 6px;
    display: flex;
    gap: 8px;
}

.code-entry-prompt::before {
    content: '❯';
    color: var(--accent2);
    flex-shrink: 0;
}

.code-entry-response {
    color: var(--text);
    padding-left: 18px;
    border-left: 2px solid var(--border);
    white-space: pre-wrap;
}

.code-entry-response.error { border-color: var(--danger); color: #fca5a5; }
.code-entry-response.pending { color: var(--text3); animation: blink 1s step-end infinite; }

@keyframes blink { 50% { opacity: .3; } }

.code-input-area {
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 12px;
    flex-shrink: 0;
}

.code-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.code-input-row textarea {
    flex: 1;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    color: var(--text);
    font-family: var(--mono);
    font-size: .8rem;
    resize: none;
    min-height: 60px;
    outline: none;
    transition: border-color .15s;
}

.code-input-row textarea:focus { border-color: var(--accent); }

/* ── Middle: Discussion Summary ─────────────────────────────── */
#col-summary {
    flex: 1;
    background: var(--bg);
    min-width: 0;
}

.summary-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.summary-editor {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    color: var(--text);
    font-family: var(--serif);
    font-size: .9rem;
    line-height: 1.7;
    min-height: 200px;
    resize: none;
    outline: none;
    transition: border-color .15s;
}

.summary-editor:focus { border-color: var(--accent2); }

.summary-meta {
    font-family: var(--mono);
    font-size: .68rem;
    color: var(--text3);
    margin-bottom: 10px;
    padding: 6px 10px;
    background: var(--bg2);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.summary-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* ── Right: Live Transcript ─────────────────────────────────── */
#col-transcript {
    width: var(--col-right);
    flex-shrink: 0;
    background: var(--bg);
}

.transcript-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.transcript-entry {
    margin-bottom: 12px;
    animation: slideIn .2s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.transcript-speaker {
    font-family: var(--mono);
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent2);
    margin-bottom: 3px;
}

.transcript-text {
    font-size: .82rem;
    color: var(--text2);
    line-height: 1.55;
}

.transcript-time {
    font-family: var(--mono);
    font-size: .6rem;
    color: var(--text3);
    margin-top: 2px;
}

.transcript-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text3);
    font-size: .8rem;
    gap: 8px;
}

.transcript-empty .icon { font-size: 2rem; }

/* ── Meeting URL bar ────────────────────────────────────────── */
.meeting-bar {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.meeting-bar input {
    flex: 1;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 12px;
    color: var(--text);
    font-family: var(--mono);
    font-size: .75rem;
    outline: none;
}

.meeting-bar input:focus { border-color: var(--accent2); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 10px;
    padding: 32px;
    width: 480px;
    max-width: 90vw;
    box-shadow: 0 32px 80px rgba(0,0,0,.5);
    animation: modalIn .2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(.95); }
    to   { opacity: 1; transform: scale(1); }
}

.modal-title {
    font-family: var(--sans);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ── Admin Dashboard ────────────────────────────────────────── */
.admin-layout {
    display: flex;
    height: 100vh;
}

.admin-sidebar {
    width: 220px;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    flex-shrink: 0;
}

.admin-sidebar-logo {
    padding: 0 20px 24px;
    font-family: var(--sans);
    font-weight: 800;
    font-size: 1rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.admin-nav-item {
    padding: 9px 20px;
    font-size: .83rem;
    color: var(--text2);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    transition: all .12s;
    border-left: 2px solid transparent;
}

.admin-nav-item:hover { color: var(--text); background: var(--bg3); }
.admin-nav-item.active { color: var(--accent); border-color: var(--accent); background: rgba(79,127,255,.07); }

.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.admin-section-title {
    font-family: var(--sans);
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.settings-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.settings-card-title {
    font-family: var(--mono);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text3);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 7px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 99px;
    font-family: var(--mono);
    font-size: .65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.badge-ok { background: rgba(34,197,94,.15); color: var(--success); }
.badge-error { background: rgba(239,68,68,.15); color: var(--danger); }
.badge-warning { background: rgba(245,158,11,.15); color: var(--accent3); }

/* ── Toast notifications ────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: .82rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    animation: toastIn .2s ease;
    max-width: 320px;
}

.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--danger); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Project list ───────────────────────────────────────────── */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.project-item {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    transition: all .12s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-item:hover { border-color: var(--accent); }

.project-item-name {
    font-family: var(--sans);
    font-weight: 600;
    font-size: .9rem;
}

.project-item-meta {
    font-family: var(--mono);
    font-size: .65rem;
    color: var(--text3);
    margin-top: 2px;
}

.project-item-arrow { margin-left: auto; color: var(--text3); }

/* ── Responsive tweaks ──────────────────────────────────────── */
@media (max-width: 900px) {
    :root {
        --col-left: 260px;
        --col-right: 260px;
    }
}

/* Utility */
.hidden { display: none !important; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.text-mono { font-family: var(--mono); }
.text-sm { font-size: .8rem; }
.text-muted { color: var(--text3); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.w-full { width: 100%; }
