
/* ============================================================
   RESET
   ============================================================ */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}


/* ============================================================
   WEBPAGE BACKGROUND
   ============================================================ */

body {
    font-family: Arial, Helvetica, sans-serif;

    background-image: url("/background.png");
    background-repeat: repeat-y;
    background-position: center top;
    background-size: 100% auto;

    min-height: 100vh;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 30px;
}


/* ============================================================
   CHATBOT CONTAINER
   ============================================================ */

.chat-container {
    width: min(900px, 100%);
    height: min(850px, calc(100vh - 60px));

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border-radius: 18px;

    background-color: #e8f5e9;

    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.18);
}


/* ============================================================
   HEADER
   ============================================================ */

.chat-header {
    position: relative;

    width: 100%;
    min-height: 125px;

    background-color: #36655f;

    display: flex;
    justify-content: center;
    align-items: center;

    padding: 15px 30px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.15);

    flex-shrink: 0;
}


/* ============================================================
   LOGO CROPPING
   ============================================================ */

/*
 * The original logo is cropped so that:
 *
 * 2/7 is removed from the top
 * 2/7 is removed from the bottom
 *
 * leaving the middle 3/7.
 */

.logo-crop {
    width: 260px;
    height: 85px;

    overflow: hidden;

    display: flex;
    justify-content: center;
    align-items: center;
}


/*
 * Make the image substantially larger than
 * the visible crop area.
 */

.rebloom-logo {
    display: block;

    width: 260px;
    height: auto;

    /*
     * Move the image vertically so the
     * middle portion is visible.
     */
    transform: translateY(0);

    object-fit: contain;
}


/* ============================================================
   ONLINE STATUS
   ============================================================ */

.status {
    position: absolute;

    right: 25px;

    display: flex;
    align-items: center;

    gap: 7px;

    font-size: 14px;
    font-weight: 600;

    color: white;
}

.status-dot {
    width: 9px;
    height: 9px;

    border-radius: 50%;

    background-color: #8fc9a8;
}


/* ============================================================
   ACTUAL CHAT AREA
   ============================================================ */

.chat-box {
    flex: 1;

    overflow-y: auto;

    padding: 25px;

    /*
     * LIGHT GREEN CHAT AREA
     *
     * This is intentionally NOT #36655f.
     */
    background-color: #e8f5e9;
}


/* ============================================================
   MESSAGES
   ============================================================ */

.message {
    display: flex;

    gap: 12px;

    margin-bottom: 20px;

    max-width: 85%;
}

.ai-message {
    align-self: flex-start;
}

.user-message {
    margin-left: auto;

    flex-direction: row-reverse;
}


/* ============================================================
   AVATAR
   ============================================================ */

.avatar {
    width: 38px;
    height: 38px;

    min-width: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background-color: white;

    color: #36655f;

    font-weight: 700;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.12);
}


/* ============================================================
   MESSAGE CARD
   ============================================================ */

.message-content {
    max-width: 100%;

    background-color: white;

    color: #26352c;

    padding: 13px 16px;

    border-radius: 14px;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.10);
}

.message-content > strong {
    display: block;

    margin-bottom: 5px;

    color: #36655f;
}


/* ============================================================
   MESSAGE TEXT
   ============================================================ */

.message-text {
    font-size: 15px;

    line-height: 1.6;

    color: #26352c;
}

.message-text p {
    margin: 0 0 10px 0;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text strong {
    display: inline;

    margin: 0;

    font-weight: 700;

    color: inherit;
}

.message-text em {
    font-style: italic;
}

.message-text ul,
.message-text ol {
    margin: 8px 0 8px 20px;

    padding: 0;
}

.message-text li {
    margin-bottom: 4px;
}


/* ============================================================
   MARKDOWN CODE
   ============================================================ */

.message-text code {
    background-color: rgba(0, 0, 0, 0.07);

    padding: 2px 5px;

    border-radius: 4px;

    font-family: monospace;
}

.message-text pre {
    background-color: #1f2937;

    color: white;

    padding: 12px;

    border-radius: 8px;

    overflow-x: auto;

    margin: 10px 0;
}

.message-text pre code {
    background-color: transparent;

    padding: 0;
}


/* ============================================================
   USER MESSAGE
   ============================================================ */

.user-message .message-content {
    background-color: white;

    color: #26352c;
}

.user-message .message-content > strong {
    color: #36655f;
}

.user-message .message-text {
    color: #26352c;
}


/* ============================================================
   TYPING INDICATOR
   ============================================================ */

.typing {
    padding: 8px 25px;

    font-size: 13px;

    color: #36655f;

    background-color: #e8f5e9;
}

.hidden {
    display: none;
}


/* ============================================================
   INPUT AREA
   ============================================================ */

.input-area {
    display: flex;

    gap: 10px;

    padding: 16px 20px;

    /*
     * STAYS DARK GREEN
     */
    background-color: #36655f;

    border-top: 1px solid rgba(255, 255, 255, 0.15);

    flex-shrink: 0;
}


/* ============================================================
   TEXT INPUT
   ============================================================ */

#message-input {
    flex: 1;

    min-height: 45px;
    max-height: 120px;

    resize: none;

    border: none;

    border-radius: 12px;

    padding: 12px 14px;

    font-family: inherit;

    font-size: 15px;

    background-color: white;

    color: #26352c;

    outline: none;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.08);
}

#message-input::placeholder {
    color: #6f7f77;
}

#message-input:focus {
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.25);
}


/* ============================================================
   SEND BUTTON
   ============================================================ */

#send-button {
    min-width: 80px;

    border: none;

    border-radius: 12px;

    padding: 0 20px;

    background-color: white;

    color: #36655f;

    font-family: inherit;

    font-size: 15px;

    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease,
        box-shadow 0.15s ease;
}

#send-button:hover {
    opacity: 0.92;

    transform: translateY(-1px);

    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.12);
}

#send-button:active {
    transform: translateY(0);
}


/* ============================================================
   SCROLLBAR
   ============================================================ */

.chat-box::-webkit-scrollbar {
    width: 8px;
}

.chat-box::-webkit-scrollbar-track {
    background: transparent;
}

.chat-box::-webkit-scrollbar-thumb {
    background-color: rgba(54, 101, 95, 0.35);

    border-radius: 10px;
}

.chat-box::-webkit-scrollbar-thumb:hover {
    background-color: rgba(54, 101, 95, 0.55);
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 600px) {

    body {
        padding: 0;
    }

    .chat-container {
        width: 100%;
        height: 100vh;

        border-radius: 0;
    }

    .chat-header {
        min-height: 105px;

        padding: 12px 20px;
    }

    .logo-crop {
        width: 220px;
        height: 75px;
    }

    .rebloom-logo {
        width: 220px;
    }

    .status {
        right: 15px;

        font-size: 12px;
    }

    .chat-box {
        padding: 18px;
    }

    .message {
        max-width: 92%;
    }

    .input-area {
        padding: 12px;
    }

    #send-button {
        min-width: 65px;

        padding: 0 14px;
    }
}
