
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* =========================================
   NEURALDOCS - PROFESSIONAL AI DASHBOARD
   Navy + White + Blue
========================================= */

:root {
    --navy: #111c30;
    --navy-light: #1b2b45;
    --blue: #2675e8;
    --blue-dark: #155bc0;
    --blue-light: #eaf2ff;

    --bg: #f5f8fd;
    --white: #ffffff;
    --text: #172033;
    --muted: #78849a;
    --border: #e4eaf2;
    --card: #ffffff;
}

/* RESET */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

button,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

/* =========================================
   MAIN APP LAYOUT
========================================= */

.app-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
}

/* =========================================
   SIDEBAR
========================================= */

.sidebar {
    display: flex;
    flex-direction: column;
    flex: 0 0 260px;
    width: 260px;
    min-width: 260px;
    height: 100vh;
    padding: 24px 17px;
    background: var(--navy);
    color: white;
    overflow-y: auto;
    border-right: 1px solid #26344a;
}

/* BRAND */

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 35px;
}

.brand-icon {
    width: 49px;
    height: 49px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(135deg, #4295ff, #1761cf);
    color: white;
    font-size: 28px;
    font-weight: 800;
    box-shadow: 0 5px 15px rgba(20, 105, 220, .25);
}

.brand-info h2 {
    color: white;
    font-size: 17px;
    font-weight: 700;
}

.brand-info span {
    display: block;
    color: #a9b8ce;
    font-size: 10px;
    margin-top: 5px;
}

/* NEW CHAT BUTTON */

.new-chat {
    width: 100%;
    padding: 15px;
    margin-bottom: 34px;
    border: none;
    border-radius: 11px;
    background: var(--blue);
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    transition: .2s ease;
}

.new-chat span {
    font-size: 23px;
    margin-right: 11px;
    vertical-align: middle;
}

.new-chat:hover {
    background: #3987f5;
    transform: translateY(-2px);
}

/* SIDEBAR SECTIONS */

.sidebar-section {
    margin-bottom: 30px;
}

.section-title {
    color: #8191aa;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding-left: 10px;
    margin-bottom: 13px;
}

/* NAVIGATION */

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 12px;
    margin-bottom: 6px;
    border-radius: 9px;
    color: #bac7d9;
    font-size: 13px;
    cursor: pointer;
    transition: .2s ease;
}

.nav-item span {
    width: 26px;
    display: inline-flex;
    justify-content: center;
    font-size: 22px;
}

.nav-item:hover {
    background: var(--navy-light);
    color: white;
}

.nav-item.active {
    background: #243d62;
    color: #ffffff;
    font-weight: 600;
}

/* CHAT HISTORY */

.history-section {
    flex: 1;
    min-height: 80px;
    overflow-y: auto;
}

#historyList {
    margin-top: 8px;
}

.history-item {
    padding: 12px;
    color: #aebbd0;
    font-size: 12px;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.history-item:hover {
    background: var(--navy-light);
    color: white;
}

/* PROFILE */

.sidebar-bottom {
    margin-top: 20px;
}

.profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 19px;
    border-top: 1px solid #304057;
}

.avatar {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #2675e8;
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.profile-info strong {
    display: block;
    color: white;
    font-size: 12px;
}

.profile-info small {
    display: block;
    color: #a9b8ce;
    font-size: 11px;
    margin-top: 5px;
}

.profile-arrow {
    margin-left: auto;
    color: #a9b8ce;
    font-size: 20px;
}

/* =========================================
   MAIN CONTENT
========================================= */

.main-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    height: 100vh;
    overflow: hidden;
    background: var(--bg);
}

/* TOPBAR */

.topbar {
    flex: 0 0 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: white;
    border-bottom: 1px solid var(--border);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.connection {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #526078;
    font-size: 12px;
    font-weight: 500;
}

.status-dot {
    width: 9px;
    height: 9px;
    display: inline-block;
    border-radius: 50%;
    background: #20bd80;
    box-shadow: 0 0 0 4px #e7f8f0;
}

.topbar-divider {
    height: 24px;
    width: 1px;
    background: var(--border);
}

.document-count {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #64738b;
    font-size: 12px;
}

.document-count span {
    font-size: 20px;
    color: var(--blue);
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* TOPBAR BUTTONS */

.icon-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: white;
    color: #334155;
    font-size: 23px;
    transition: .2s ease;
}

.icon-btn:hover {
    background: var(--blue-light);
    color: var(--blue);
}

.upload-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px 19px;
    border: none;
    border-radius: 10px;
    background: var(--blue);
    color: white;
    font-size: 13px;
    font-weight: 600;
    transition: .2s ease;
}

.upload-btn span {
    font-size: 22px;
}

.upload-btn:hover {
    background: var(--blue-dark);
    transform: translateY(-2px);
}

/* =========================================
   CHAT AREA
========================================= */

.chat-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 35px 25px;
    background: #f5f8fd;
}

/* WELCOME SCREEN */

.welcome-screen {
    max-width: 790px;
    margin: 35px auto 45px;
    text-align: center;
}

/* WELCOME BRAND ICON */

.welcome-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
}

.welcome-icon {
    width: 65px;
    height: 65px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(135deg, #3188f5, #145ac1);
    color: white;
    font-size: 36px;
    font-weight: 800;
    box-shadow: 0 9px 25px rgba(38, 117, 232, .22);
}

/* WELCOME TEXT */

.welcome-screen h1 {
    color: #172033;
    font-size: clamp(32px, 4vw, 45px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1.5px;
    margin-bottom: 17px;
}

.welcome-screen h1 span {
    color: var(--blue);
}

.welcome-screen > p {
    color: #78849a;
    font-size: 14px;
    line-height: 1.8;
}

/* =========================================
   SUGGESTION CARDS
========================================= */

.suggestion-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    margin-top: 35px;
}

.suggestion {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 155px;
    padding: 21px;
    border: 1px solid #e3eaf4;
    border-radius: 14px;
    background: white;
    color: var(--text);
    text-align: left;
    box-shadow: 0 3px 12px rgba(20, 40, 75, .035);
    transition: .25s ease;
}

.suggestion:hover {
    transform: translateY(-4px);
    border-color: #9fc4fa;
    box-shadow: 0 9px 24px rgba(38, 117, 232, .09);
}

/* LARGE COLOURED ICONS */

.suggestion-icon {
    width: 49px;
    height: 49px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 27px;
    margin-bottom: 16px;
}

.blue-icon {
    background: #e7f0ff;
    color: #1769e0;
}

.purple-icon {
    background: #f0eaff;
    color: #8058d6;
}

.green-icon {
    background: #e4f8ef;
    color: #159b68;
}

.orange-icon {
    background: #fff0e2;
    color: #df842e;
}

.suggestion strong {
    color: #202b40;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 7px;
}

.suggestion small {
    color: #8591a5;
    font-size: 12px;
}

.card-arrow {
    position: absolute;
    right: 19px;
    bottom: 18px;
    color: var(--blue);
    font-size: 21px;
}

/* =========================================
   EMPTY STATE ILLUSTRATION
========================================= */

.empty-state {
    margin-top: 43px;
    text-align: center;
}

.document-illustration {
    position: relative;
    width: 145px;
    height: 115px;
    margin: 0 auto 17px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.illustration-glow {
    position: absolute;
    width: 115px;
    height: 95px;
    border-radius: 50%;
    background: #e4efff;
    filter: blur(13px);
}

.document-paper {
    position: relative;
    z-index: 1;
    width: 70px;
    height: 88px;
    padding: 20px 11px;
    border: 2px solid #8bb7f3;
    border-radius: 9px;
    background: white;
    box-shadow: 0 7px 20px rgba(30, 80, 150, .09);
    transform: rotate(-7deg);
}

.document-paper span {
    display: block;
    height: 4px;
    margin-bottom: 8px;
    border-radius: 5px;
    background: #d4e5fc;
}

.document-paper span:first-child {
    width: 75%;
    background: #6ca5f0;
}

.document-paper span:nth-child(2) {
    width: 100%;
}

.document-paper span:nth-child(3) {
    width: 65%;
}

.chat-bubble {
    position: absolute;
    z-index: 2;
    right: 5px;
    bottom: 12px;
    padding: 8px 11px;
    border-radius: 10px;
    background: #2675e8;
    color: white;
    font-size: 17px;
    letter-spacing: 2px;
    box-shadow: 0 5px 13px rgba(38, 117, 232, .2);
}

.sparkle {
    position: absolute;
    color: #2675e8;
    font-size: 20px;
}

.sparkle-one {
    top: 7px;
    right: 13px;
}

.sparkle-two {
    left: 7px;
    bottom: 20px;
    font-size: 14px;
}

.empty-state h3 {
    color: #26334a;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 9px;
}

.empty-state p {
    color: #8994a7;
    font-size: 12px;
}

/* =========================================
   CHAT MESSAGES
========================================= */

#messages {
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
}

.message {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.message.user {
    justify-content: flex-end;
}

.message-content {
    max-width: 80%;
    padding: 16px 19px;
    border: 1px solid #e4eaf2;
    border-radius: 15px;
    background: white;
    color: #26334a;
    font-size: 14px;
    line-height: 1.8;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    box-shadow: 0 3px 10px rgba(20, 40, 75, .035);
}

.message.user .message-content {
    background: #e8f1ff;
    border-color: #d5e5fc;
    color: #173e72;
}

.message-label {
    color: #8b97a9;
    font-size: 11px;
    margin-bottom: 7px;
}

/* SOURCES */

.sources {
    margin-top: 15px;
    padding: 14px;
    border: 1px solid #e2eaf5;
    border-radius: 11px;
    background: #f5f9ff;
}

.sources h4 {
    color: var(--blue);
    font-size: 12px;
    margin-bottom: 10px;
}

.source-item {
    color: #68768d;
    font-size: 12px;
    line-height: 1.7;
    margin-top: 8px;
}

.typing {
    color: var(--blue);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    50% {
        opacity: .35;
    }
}

/* =========================================
   CHAT INPUT
========================================= */

.chat-footer {
    flex-shrink: 0;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 12px 25px 17px;
    background: transparent;
}

.upload-status {
    color: var(--blue);
    font-size: 12px;
    margin-bottom: 8px;
}

.input-container {
    padding: 16px 18px;
    border: 1px solid #dce5f1;
    border-radius: 17px;
    background: white;
    box-shadow: 0 5px 22px rgba(20, 40, 75, .055);
    transition: .2s ease;
}

.input-container:focus-within {
    border-color: #82b3f5;
    box-shadow: 0 0 0 3px rgba(38, 117, 232, .09);
}

.input-container textarea {
    width: 100%;
    min-height: 45px;
    max-height: 130px;
    resize: none;
    border: none;
    outline: none;
    background: transparent;
    color: #202b40;
    font-size: 14px;
    line-height: 1.6;
}

.input-container textarea::placeholder {
    color: #9aa5b6;
}

.input-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.input-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #8390a5;
    font-size: 11px;
}

.input-tools button {
    width: 43px;
    height: 40px;
    border: 1px solid #e3eaf3;
    border-radius: 10px;
    background: #f4f7fc;
    color: #42648e;
    font-size: 21px;
}

.input-tools button:hover {
    background: #eaf2ff;
    color: var(--blue);
}

.powered-label {
    font-size: 11px;
}

/* SEND BUTTON */

.send-btn {
    width: 45px;
    height: 45px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 12px;
    background: var(--blue);
    color: white;
    font-size: 27px;
    transition: .2s ease;
}

.send-btn:hover {
    background: var(--blue-dark);
    transform: translateY(-2px);
}

.send-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.footer-note {
    margin-top: 12px;
    color: #929db0;
    text-align: center;
    font-size: 10px;
    line-height: 1.5;
}

/* =========================================
   SCROLLBARS
========================================= */

.chat-area::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.history-section::-webkit-scrollbar {
    width: 6px;
}

.chat-area::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.history-section::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #3b4b63;
}

/* =========================================
   RESPONSIVE DESIGN
========================================= */

@media (max-width: 900px) {
    .sidebar {
        flex-basis: 225px;
        width: 225px;
        min-width: 225px;
    }

    .topbar {
        padding: 0 18px;
    }

    .welcome-screen {
        margin-top: 30px;
    }
}

@media (max-width: 750px) {
    .sidebar {
        display: none !important;
    }

    .main-content {
        width: 100%;
        flex: 1;
    }

    .topbar {
        flex-basis: 65px;
        height: 65px;
        padding: 0 12px;
    }

    .document-count,
    .topbar-divider {
        display: none;
    }

    .upload-btn {
        padding: 11px;
        font-size: 11px;
    }

    .chat-area {
        padding: 20px 13px;
    }

    .welcome-screen {
        margin: 25px auto 35px;
    }

    .welcome-screen h1 {
        font-size: 32px;
    }

    .suggestion-grid {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .suggestion {
        min-height: 130px;
    }

    .chat-footer {
        padding: 10px;
    }

    .message-content {
        max-width: 90%;
    }

    .powered-label {
        font-size: 9px;
    }
}
