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


* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
}


body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #0b0d10;

    color: #f4f4f5;

    overflow: hidden;
}


.app {
    display: flex;

    width: 100%;
    height: 100vh;
}


/* =========================
   SIDEBAR
========================= */

.sidebar {
    width: 245px;
    height: 100vh;

    display: flex;
    flex-direction: column;

    padding: 18px 14px;

    background: #101216;

    border-right: 1px solid #202329;
}


.brand {
    display: flex;
    align-items: center;

    gap: 11px;

    padding: 7px 8px 20px;
}


.brand-icon {
    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;

    color: #111318;

    border-radius: 10px;

    font-size: 18px;
}


.brand h2 {
    margin: 0;

    font-size: 14px;

    font-weight: 600;

    letter-spacing: -0.2px;
}


.brand span {
    display: block;

    margin-top: 3px;

    font-size: 10px;

    color: #737780;
}


.new-chat {
    width: 100%;

    padding: 10px 12px;

    border: 1px solid #292d34;

    border-radius: 9px;

    background: #181b20;

    color: #e9eaec;

    text-align: left;

    font-family: inherit;

    font-size: 12px;

    font-weight: 500;

    cursor: pointer;

    transition: 0.15s ease;
}


.new-chat:hover {
    background: #20242a;
}


.sidebar-section {
    margin-top: 28px;
}


.sidebar-section > p {
    margin: 0 0 8px 9px;

    font-size: 9px;

    font-weight: 600;

    letter-spacing: 1.2px;

    color: #60656e;
}


.side-button {
    width: 100%;

    display: flex;
    align-items: center;

    padding: 9px 10px;

    margin-bottom: 2px;

    border: 0;

    border-radius: 7px;

    background: transparent;

    color: #969ba4;

    font-family: inherit;

    font-size: 12px;

    text-align: left;

    cursor: pointer;

    transition: 0.15s ease;
}


.side-button:hover {
    background: #181b20;

    color: #e8e9eb;
}


/* =========================
   SIDEBAR BOTTOM
========================= */

.sidebar-bottom {
    margin-top: auto;
}


.status {
    display: flex;
    align-items: center;

    gap: 9px;

    padding: 10px;

    background: #15181d;

    border: 1px solid #20242a;

    border-radius: 9px;
}


.status-dot {
    width: 7px;
    height: 7px;

    flex-shrink: 0;

    border-radius: 50%;

    background: #39d98a;

    box-shadow:
        0 0 8px
        rgba(57, 217, 138, 0.5);
}


.status strong {
    display: block;

    font-size: 11px;

    font-weight: 500;

    color: #d9dbe0;
}


.status small {
    display: block;

    margin-top: 2px;

    font-size: 9px;

    color: #666b74;
}


.creator {
    margin: 13px 0 0;

    text-align: center;

    font-size: 9px;

    color: #4f545d;
}


/* =========================
   MAIN
========================= */

.main {
    position: relative;

    display: flex;
    flex-direction: column;

    flex: 1;

    min-width: 0;

    height: 100vh;

    background: #0b0d10;
}


/* =========================
   TOP BAR
========================= */

.topbar {
    height: 62px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 28px;

    border-bottom: 1px solid #1c1f24;

    background: #0b0d10;
}


.topbar h1 {
    margin: 0;

    font-size: 13px;

    font-weight: 600;

    letter-spacing: -0.15px;
}


.topbar p {
    margin: 4px 0 0;

    font-size: 10px;

    color: #646972;
}


.offline {
    display: flex;
    align-items: center;

    gap: 6px;

    padding: 5px 9px;

    border: 1px solid #25292f;

    border-radius: 20px;

    background: #111419;

    font-size: 9px;

    color: #858a93;
}


.offline span {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #39d98a;
}


/* =========================
   CHAT
========================= */

.chat {
    flex: 1;

    width: 100%;

    overflow-y: auto;

    padding: 30px 25px 140px;
}


.chat::-webkit-scrollbar {
    width: 5px;
}


.chat::-webkit-scrollbar-thumb {
    background: #292d33;

    border-radius: 10px;
}


/* =========================
   WELCOME
========================= */

.welcome {
    width: min(680px, 100%);

    margin: 70px auto 0;

    text-align: center;
}


.welcome-icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 18px;

    background: #15181d;

    border: 1px solid #272b31;

    border-radius: 14px;

    font-size: 22px;
}


.welcome h2 {
    margin: 0;

    font-size: 24px;

    font-weight: 600;

    letter-spacing: -0.7px;
}


.welcome > p {
    max-width: 430px;

    margin: 9px auto 25px;

    font-size: 12px;

    line-height: 1.6;

    color: #70757e;
}


/* =========================
   MESSAGES
========================= */

.message {
    width: min(760px, 100%);

    margin: 0 auto 25px;
}


.message > strong {
    display: block;

    margin-bottom: 7px;

    font-size: 10px;

    font-weight: 600;

    color: #777c85;
}


.message p {
    margin: 0;

    font-size: 13px;

    line-height: 1.7;

    white-space: pre-wrap;
}


.message.user {
    text-align: right;
}


.message.user p {
    display: inline-block;

    max-width: 75%;

    padding: 10px 13px;

    background: #20242a;

    border: 1px solid #2a2e35;

    border-radius:
        12px 12px 3px 12px;

    color: #e8e9eb;

    text-align: left;
}


.message.bot p {
    max-width: 90%;

    color: #d2d4d8;
}


/* =========================
   BOT MARKDOWN
========================= */

.message.bot > strong {
    margin-bottom: 12px;

    font-size: 13px;

    font-weight: 700;

    letter-spacing: 0.2px;
}


.message.bot p {
    line-height: 1.65;
}


.message.bot h2,
.message.bot h3,
.message.bot h4 {
    display: block;

    margin: 18px 0 7px;

    font-weight: 700;

    line-height: 1.3;
}


.message.bot h2 {
    font-size: 17px;
}


.message.bot h3 {
    font-size: 15px;
}


.message.bot h4 {
    font-size: 14px;
}


.message.bot p strong {
    font-weight: 700;
}


.message.bot ul {
    margin: 8px 0 12px;

    padding-left: 22px;
}


.message.bot li {
    margin: 6px 0;

    padding-left: 3px;
}


.message.bot code {
    padding: 2px 6px;

    border-radius: 5px;

    font-family: monospace;

    font-size: 0.9em;

    background: #171a1f;
}


/* =========================
   SMOOTH CHARACTER FADE
========================= */

.fade-char {
    display: inline;

    opacity: 0;

    animation:
        fadeCharacter
        0.18s
        ease-out
        forwards;
}


@keyframes fadeCharacter {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


/* =========================
   THINKING
========================= */

.ai-thinking {
    display: inline-flex;

    align-items: center;

    gap: 8px;

    font-size: 12px;

    color: #858a93;
}


.status-spinner {
    width: 10px;
    height: 10px;

    border: 2px solid #30343b;

    border-top-color: #39d98a;

    border-radius: 50%;

    animation:
        spin
        0.8s
        linear
        infinite;
}


@keyframes spin {

    to {
        transform: rotate(360deg);
    }

}


/* =========================
   INPUT
========================= */

.input-area {
    position: absolute;

    left: 50%;

    bottom: 0;

    transform: translateX(-50%);

    width: min(
        780px,
        calc(100% - 40px)
    );

    padding: 15px 0 17px;

    background:
        linear-gradient(
            to top,
            #0b0d10 75%,
            rgba(11, 13, 16, 0)
        );
}


#chat-form {
    display: flex;

    align-items: center;

    padding:
        5px 5px 5px 13px;

    border: 1px solid #2a2e35;

    border-radius: 13px;

    background: #15181d;

    box-shadow:
        0 10px 35px
        rgba(0, 0, 0, 0.35);
}


#message {
    flex: 1;

    min-width: 0;

    padding: 9px 0;

    border: 0;

    outline: 0;

    background: transparent;

    color: #eeeeef;

    font-family: inherit;

    font-size: 12px;
}


#message::placeholder {
    color: #5e636c;
}


.send {
    width: 32px;
    height: 32px;

    display: flex;

    align-items: center;
    justify-content: center;

    border: 0;

    border-radius: 9px;

    background: #eeeeef;

    color: #101216;

    font-size: 14px;

    cursor: pointer;

    transition: 0.15s ease;
}


.send:hover {
    background: white;

    transform: translateY(-1px);
}


.send.pause {
    background: #eeeeef;

    font-size: 13px;
}


.disclaimer {
    margin: 7px 0 0;

    text-align: center;

    font-size: 8px;

    color: #464b53;
}


/* =========================
   COLLEGE SETUP MODAL
========================= */

.setup-overlay {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: none;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background:
        rgba(0, 0, 0, 0.65);

    backdrop-filter: blur(5px);
}


.setup-overlay.open {
    display: flex;
}


.setup-modal {
    width: min(720px, 100%);

    max-height: 90vh;

    display: flex;
    flex-direction: column;

    background: #101216;

    border: 1px solid #292d34;

    border-radius: 14px;

    box-shadow:
        0 25px 80px
        rgba(0, 0, 0, 0.55);

    overflow: hidden;
}


.setup-header {
    display: flex;

    align-items: flex-start;
    justify-content: space-between;

    padding: 20px 22px;

    border-bottom: 1px solid #24282e;
}


.setup-header h2 {
    margin: 0;

    font-size: 16px;

    font-weight: 600;
}


.setup-header p {
    margin: 5px 0 0;

    font-size: 10px;

    color: #70757e;
}


.close-setup {
    width: 30px;
    height: 30px;

    border: 0;

    border-radius: 7px;

    background: transparent;

    color: #858a93;

    font-size: 22px;

    cursor: pointer;
}


.close-setup:hover {
    background: #1b1f24;

    color: white;
}


.setup-body {
    padding: 20px 22px;

    overflow-y: auto;
}


.setup-body::-webkit-scrollbar {
    width: 5px;
}


.setup-body::-webkit-scrollbar-thumb {
    background: #292d33;

    border-radius: 10px;
}


.setup-section {
    padding-bottom: 22px;

    margin-bottom: 22px;

    border-bottom: 1px solid #20242a;
}


.setup-section:last-child {
    border-bottom: 0;

    margin-bottom: 0;
}


.setup-section h3 {
    margin: 0 0 14px;

    font-size: 12px;

    font-weight: 600;

    color: #e1e3e6;
}


.setup-section label {
    display: block;

    margin:
        12px 0 6px;

    font-size: 10px;

    color: #858a93;
}


.setup-section input,
.setup-section textarea {
    width: 100%;

    padding: 10px 11px;

    border: 1px solid #292d34;

    border-radius: 8px;

    outline: none;

    background: #15181d;

    color: #eeeeef;

    font-family: inherit;

    font-size: 11px;

    resize: vertical;
}


.setup-section input:focus,
.setup-section textarea:focus {
    border-color: #454b54;
}


.setup-help {
    margin:
        -7px 0 12px;

    font-size: 9px;

    color: #60656e;
}


.day-grid,
.syllabus-grid {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 12px;
}


.day-card,
.syllabus-card {
    padding: 12px;

    border: 1px solid #24282e;

    border-radius: 9px;

    background: #13161a;
}


.day-card h4,
.syllabus-card h4 {
    margin: 0 0 8px;

    font-size: 10px;

    font-weight: 600;

    color: #bfc2c8;
}


.day-card textarea,
.syllabus-card textarea {
    min-height: 70px;
}


.setup-footer {
    display: flex;

    align-items: center;

    gap: 8px;

    padding: 14px 22px;

    border-top: 1px solid #24282e;

    background: #101216;
}


.save-status {
    flex: 1;

    font-size: 10px;

    color: #39d98a;
}


.cancel-button,
.save-button {
    padding: 9px 13px;

    border-radius: 8px;

    font-family: inherit;

    font-size: 10px;

    cursor: pointer;
}


.cancel-button {
    border: 1px solid #292d34;

    background: #181b20;

    color: #aeb2b9;
}


.cancel-button:hover {
    background: #20242a;
}


.save-button {
    border: 1px solid #eeeeef;

    background: #eeeeef;

    color: #101216;

    font-weight: 600;
}


.save-button:hover {
    background: white;
}


/* =========================
   MOBILE
========================= */

/* =========================
   MOBILE
========================= */

@media (max-width: 700px) {

    /* Main app */
    .app {
        width: 100%;
        height: 100dvh;
    }

    .main {
        width: 100%;
        height: 100dvh;
        min-height: 0;
    }

    /* =========================
       TOP BAR
    ========================= */

    .topbar {
        height: 58px;
        min-height: 58px;
        flex-shrink: 0;
        padding: 0 14px;
    }

    .topbar h1 {
        font-size: 13px;
    }

    .topbar p {
        font-size: 9px;
    }

    .offline {
        padding: 5px 7px;
        font-size: 8px;
    }


    /* =========================
       MOBILE TOOLS BAR
    ========================= */

    .sidebar {
        position: fixed;

        top: 58px;
        left: 0;
        right: 0;

        width: 100%;
        height: 48px;

        display: flex;
        flex-direction: row;
        align-items: center;

        padding: 5px 8px;

        z-index: 200;

        background: #101216;

        border: 0;
        border-bottom: 1px solid #202329;

        overflow-x: auto;
        overflow-y: hidden;

        -webkit-overflow-scrolling: touch;
    }

    /* Hide desktop-only sidebar elements */
    .brand,
    .new-chat,
    .sidebar-bottom {
        display: none;
    }

    /* Tools container */
    .sidebar-section {
        width: 100%;
        height: 100%;

        display: flex;
        align-items: center;

        margin: 0;
    }

    .sidebar-section > p {
        display: none;
    }

    /* Tool buttons */
    .side-button {
        flex: 1;

        min-width: 0;

        height: 36px;

        display: flex;
        align-items: center;
        justify-content: center;

        margin: 0 3px;
        padding: 7px 5px;

        border-radius: 7px;

        background: transparent;

        color: #969ba4;

        font-size: 11px;

        white-space: nowrap;

        cursor: pointer;

        -webkit-tap-highlight-color: transparent;
    }

    .side-button:hover,
    .side-button:active {
        background: #181b20;
        color: #e8e9eb;
    }


    /* =========================
       CHAT
    ========================= */

    .chat {
        width: 100%;
        height: auto;

        min-height: 0;

        flex: 1;

        overflow-y: auto;

        padding:
    125px
    15px
    160px;

        -webkit-overflow-scrolling: touch;
    }

    .welcome {
        width: 100%;
        margin-top: 35px;
    }

    .welcome h2 {
        font-size: 22px;
    }

    .welcome > p {
        font-size: 11px;
    }


    /* =========================
       MESSAGES
    ========================= */

    .message {
        width: 100%;
        margin-bottom: 22px;
    }

    .message.bot p {
        max-width: 100%;
    }

    .message.user p {
        max-width: 88%;
    }


    /* =========================
       INPUT
    ========================= */

    .input-area {
    position: fixed;

    left: 0;
    bottom: 0;

    width: 100%;

    transform: none;

    padding:
        10px
        12px
        calc(10px + env(safe-area-inset-bottom));

    z-index: 300;

    background:
        linear-gradient(
            to top,
            #0b0d10 82%,
            rgba(11, 13, 16, 0)
        );

    transition:
        bottom 0.1s ease;
}

    #chat-form {
        width: 100%;

        min-height: 46px;

        padding: 5px 5px 5px 12px;

        border-radius: 13px;
    }

    #message {
        min-width: 0;

        padding: 10px 0;

        font-size: 14px;
    }

    .send {
        width: 36px;
        height: 36px;

        flex-shrink: 0;
    }

    .disclaimer {
        margin: 6px 0 0;

        font-size: 8px;
    }


    /* =========================
       COLLEGE SETUP
    ========================= */

    .setup-overlay {
        padding: 10px;
        align-items: center;
    }

    .setup-modal {
        width: 100%;
        max-width: 100%;

        max-height: 94dvh;

        border-radius: 12px;
    }

    .setup-header {
        padding: 15px;
    }

    .setup-body {
        padding: 15px;

        overflow-y: auto;

        -webkit-overflow-scrolling: touch;
    }

    .setup-footer {
        padding: 11px 15px;

        flex-shrink: 0;
    }

    .day-grid,
    .syllabus-grid {
        grid-template-columns: 1fr;
    }

    .setup-section input,
    .setup-section textarea {
        font-size: 13px;
    }

    .save-button,
    .cancel-button {
        padding: 10px 13px;

        font-size: 11px;
    }
}

.message.bot sub {
    font-size: 0.75em;
    vertical-align: sub;
}

.message.bot sup {
    font-size: 0.75em;
    vertical-align: super;
}