/* ─── NeuroCLI AI — Shared Module Stylesheet ─────────────────────────────── */
/* Used by all pages in Medical & Pro Tools section                            */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Map to existing variable names AND add aliases the modules use */
    --bg-primary:      #0b0f19;
    --bg-secondary:    #111827;
    --bg-tertiary:     #1a2236;
    --surface-color:   rgba(255, 255, 255, 0.03);
    --surface-hover:   rgba(255, 255, 255, 0.07);
    --border-color:    rgba(255, 255, 255, 0.1);
    --text-primary:    #ffffff;
    --text-secondary:  #94a3b8;
    --text-muted:      #4b5563;
    --accent-primary:  #8b5cf6;
    --accent-secondary:#3b82f6;
    --font-family:     'Inter', sans-serif;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    display: flex;
}

/* Scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(139,92,246,0.4); }

/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
    width: 240px;
    min-width: 240px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
}
.sidebar-brand img { width: 32px; height: 32px; }
.sidebar-brand span { font-weight: 700; font-size: 1rem; color: var(--text-primary); }

.nav-divider {
    font-size: 0.68rem;
    color: var(--text-muted);
    padding: 14px 20px 6px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    margin: 2px 10px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}
.nav-item i { font-size: 1.1rem; flex-shrink: 0; }
.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}
.nav-item.active {
    background: linear-gradient(135deg, rgba(139,92,246,0.18), rgba(59,130,246,0.18));
    color: var(--text-primary);
    border-left: 3px solid var(--accent-primary);
    padding-left: 17px;
}

/* ─── Main Content Area ───────────────────────────────────────────────────── */
.main {
    flex: 1;
    overflow-y: auto;
    padding: 40px 48px;
    background: var(--bg-primary);
    position: relative;
}

/* ─── Page Header ────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 36px; }
.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-header h1 i { font-size: 1.8rem; }
.page-header p { color: var(--text-secondary); margin: 0; font-size: 1rem; line-height: 1.5; }

/* ─── Upload Zone ────────────────────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed rgba(139,92,246,0.35);
    border-radius: 16px;
    padding: 52px 40px;
    text-align: center;
    background: rgba(139,92,246,0.03);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 24px;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent-primary);
    background: rgba(139,92,246,0.08);
    transform: translateY(-2px);
}
.upload-zone i { font-size: 3rem; color: var(--accent-primary); display: block; margin-bottom: 14px; }
.upload-zone h3 { font-size: 1.15rem; margin-bottom: 6px; color: var(--text-primary); }
.upload-zone p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 20px; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border: none;
    padding: 13px 28px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    font-family: var(--font-family);
    line-height: 1;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(139,92,246,0.35); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 13px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: var(--font-family);
}
.btn-secondary:hover { background: var(--surface-hover); }

.btn-download {
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.3);
    color: #10b981;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: var(--font-family);
}
.btn-download:hover { background: rgba(16,185,129,0.15); }

/* ─── Progress Bar ───────────────────────────────────────────────────────── */
.progress-section { margin: 20px 0; }
.progress-label { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 8px; }
.progress-bar-wrap {
    background: rgba(255,255,255,0.06);
    border-radius: 100px;
    height: 6px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 100px;
    transition: width 0.3s ease;
    width: 0%;
}

/* ─── Form Controls ──────────────────────────────────────────────────────── */
input[type="text"],
input[type="number"],
select,
textarea {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 11px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: var(--font-family);
    transition: border-color 0.2s;
    width: 100%;
}
input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(139,92,246,0.5);
    background: rgba(255,255,255,0.06);
}
select option { background: #1a2236; color: var(--text-primary); }

/* ─── Cards & Panels ────────────────────────────────────────────────────── */
.card {
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 24px;
    transition: all 0.2s;
}
.card:hover { background: rgba(255,255,255,0.04); }

.panel {
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.panel-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.15);
    flex-shrink: 0;
}
.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* ─── Status / Streaming Text ────────────────────────────────────────────── */
.streaming-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.75;
    white-space: pre-wrap;
}

.status-msg {
    color: var(--accent-primary);
    font-size: 0.875rem;
    margin-top: 8px;
}

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-purple  { background: rgba(139,92,246,0.15); color: #a78bfa; border: 1px solid rgba(139,92,246,0.3); }
.badge-blue    { background: rgba(59,130,246,0.15);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.badge-green   { background: rgba(16,185,129,0.15);  color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.badge-red     { background: rgba(239,68,68,0.15);   color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.badge-yellow  { background: rgba(245,158,11,0.15);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.badge-teal    { background: rgba(45,212,191,0.15);  color: #2dd4bf; border: 1px solid rgba(45,212,191,0.3); }

/* ─── Spinner ────────────────────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.75s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Two Column Layout ──────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

/* ─── Gradient text helper ───────────────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Meta info grid ─────────────────────────────────────────────────────── */
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 14px; margin-bottom: 24px; }
.meta-item { background: rgba(0,0,0,0.25); border-radius: 10px; padding: 14px; }
.meta-item label { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 5px; }
.meta-item span { font-weight: 700; font-size: 1.05rem; color: var(--text-primary); }

/* ─── Timeline ───────────────────────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 14px; }
.timeline-item {
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
}
.timeline-time { color: var(--accent-primary); font-weight: 700; font-size: 0.8rem; white-space: nowrap; font-family: monospace; padding-top: 2px; }
.timeline-content h4 { margin: 0 0 5px; font-size: 0.92rem; }
.timeline-content p { margin: 0; color: var(--text-secondary); font-size: 0.83rem; line-height: 1.55; }

/* ─── Mobile Header ──────────────────────────────────────────────────────── */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 40;
}
.mobile-header .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: var(--text-primary);
}
.mobile-header img { width: 28px; height: 28px; }
.mobile-nav-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Mobile Responsiveness ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    body {
        flex-direction: column;
        overflow-y: auto;
    }
    
    .mobile-header {
        display: flex;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: none;
    }
    
    .sidebar.open {
        left: 0;
        box-shadow: 0 0 0 100vw rgba(0,0,0,0.6);
    }
    
    .sidebar-brand {
        display: none; /* Hide brand in sidebar since it's in mobile header */
    }

    .main {
        padding: 20px 15px;
        height: auto;
        overflow: visible;
    }
    
    .page-header {
        margin-bottom: 24px;
    }
    
    .page-header h1 {
        font-size: 1.6rem;
    }
    
    .upload-zone {
        padding: 30px 20px;
    }
    
    .card {
        padding: 16px;
    }
    
    .meta-grid {
        grid-template-columns: 1fr;
    }
    
    .two-col { 
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}
