/* =========================================================
   ASTRA AI
   COMPLETE STYLE
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: #ffffff;
    color: #222222;

    overflow: hidden;
}


/* =========================================================
   APP
   ========================================================= */

.app {
    width: 100%;
    height: 100vh;

    display: flex;

    background: #ffffff;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    width: 270px;
    min-width: 270px;

    height: 100vh;

    display: flex;
    flex-direction: column;

    padding: 16px 12px;

    background: #f7f7f8;

    border-right: 1px solid #e5e5e5;

    overflow: hidden;
}


/* =========================================================
   LOGO
   ========================================================= */

.sidebar-logo {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 4px 8px 18px;
}

.logo-icon {
    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: #111111;
    color: #ffffff;

    font-size: 20px;
    font-weight: 800;
}

.logo-info {
    min-width: 0;
}

.logo-text {
    font-size: 18px;
    font-weight: 800;
    color: #111111;
}

.logo-subtitle {
    margin-top: 1px;

    font-size: 11px;
    color: #888888;
}


/* =========================================================
   NEW CHAT
   ========================================================= */

.new-chat-btn {
    width: 100%;
    height: 44px;

    display: flex;
    align-items: center;

    gap: 9px;

    padding: 0 13px;

    border: 1px solid #dddddd;
    border-radius: 10px;

    background: #ffffff;

    color: #222222;

    font-size: 13px;
    font-weight: 600;

    cursor: pointer;

    transition: 0.2s ease;
}

.new-chat-btn:hover {
    background: #eeeeee;
}

.new-chat-icon {
    width: 23px;
    height: 23px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 6px;

    background: #111111;
    color: #ffffff;

    font-size: 17px;
}


/* =========================================================
   RECENT TITLE
   ========================================================= */

.recent-title {
    margin-top: 22px;
    margin-bottom: 8px;

    padding: 0 9px;

    font-size: 11px;
    font-weight: 700;

    color: #888888;

    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* =========================================================
   CHAT LIST
   ========================================================= */

.chat-list {
    flex: 1;

    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    padding-right: 2px;
}

.chat-list::-webkit-scrollbar {
    width: 5px;
}

.chat-list::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 10px;
}


/* =========================================================
   CHAT ITEM
   ========================================================= */

.saved-chat-wrapper {
    position: relative;

    width: 100%;
    height: 39px;

    margin-bottom: 4px;

    display: flex;
    align-items: center;

    gap: 2px;
}


/* TITLE */

.saved-chat {
    flex: 1;

    min-width: 0;

    height: 37px;

    display: flex;
    align-items: center;

    padding: 0 9px;

    border: 0;
    border-radius: 8px;

    background: transparent;

    color: #333333;

    font-size: 12px;

    text-align: left;

    cursor: pointer;

    overflow: hidden;
}

.saved-chat:hover {
    background: #eeeeee;
}

.saved-chat.active {
    background: #e7e7e7;
}


/* TITLE TEXT */

.saved-chat-title {
    display: block;

    width: 100%;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* =========================================================
   THREE DOT
   ========================================================= */

.chat-dots {
    width: 30px;
    min-width: 30px;

    height: 30px;

    flex: 0 0 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 7px;

    background: transparent;

    color: #555555;

    font-size: 18px;
    line-height: 1;

    cursor: pointer;
}

.chat-dots:hover {
    background: #dedede;
}


/* =========================================================
   CHAT MENU
   ========================================================= */

.chat-menu {
    position: absolute;

    right: 3px;
    top: 34px;

    width: 125px;

    padding: 5px;

    background: #ffffff;

    border: 1px solid #dddddd;
    border-radius: 9px;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.12);

    z-index: 9999;

    display: none;
}

.chat-menu.show {
    display: block;
}

.chat-menu button {
    width: 100%;

    height: 34px;

    border: 0;
    border-radius: 6px;

    background: transparent;

    text-align: left;

    padding: 0 9px;

    font-size: 12px;

    cursor: pointer;
}

.chat-menu button:hover {
    background: #f1f1f1;
}


/* =========================================================
   DOWNLOAD APP
   ========================================================= */

.download-app-box {
    width: 100%;

    margin-top: auto;

    padding-top: 12px;

    border-top: 1px solid #e2e2e2;

    flex-shrink: 0;
}


.download-app-btn {
    width: 100%;
    min-height: 60px;

    display: flex;
    align-items: center;

    gap: 10px;

    padding: 9px 10px;

    border: 1px solid #dddddd;
    border-radius: 12px;

    background: #ffffff;

    color: #222222;

    text-decoration: none;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.download-app-btn:hover {
    background: #f4f4f4;

    transform: translateY(-1px);

    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.08);
}


.download-app-icon {
    width: 37px;
    min-width: 37px;

    height: 37px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: #eeeeee;

    font-size: 19px;
}


.download-app-text {
    min-width: 0;

    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 2px;
}


.download-app-text strong {
    font-size: 13px;
    font-weight: 700;

    color: #222222;
}


.download-app-text small {
    font-size: 10px;

    color: #888888;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


.download-app-arrow {
    width: 28px;
    min-width: 28px;

    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 7px;

    background: #111111;

    color: #ffffff;

    font-size: 16px;
    font-weight: 700;
}


/* =========================================================
   MAIN
   ========================================================= */

.main {
    position: relative;

    flex: 1;

    min-width: 0;
    height: 100vh;

    display: flex;
    flex-direction: column;

    background: #ffffff;
}


/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
    width: 100%;
    height: 58px;

    min-height: 58px;

    display: flex;
    align-items: center;

    justify-content: space-between;

    padding: 0 18px;

    border-bottom: 1px solid #eeeeee;

    background: #ffffff;

    flex-shrink: 0;
}


.topbar-title {
    font-size: 15px;
    font-weight: 700;

    color: #222222;
}


/* =========================================================
   DEVICE SWITCH
   ========================================================= */

.device-switch {
    height: 38px;

    display: flex;
    align-items: center;

    gap: 3px;

    padding: 3px;

    border: 1px solid #dddddd;

    border-radius: 10px;

    background: #f6f6f6;

    z-index: 10000;
}


.device-btn {
    width: 38px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;
    border-radius: 7px;

    background: transparent;

    font-size: 16px;

    cursor: pointer;

    transition: 0.2s ease;
}

.device-btn:hover {
    background: #e9e9e9;
}

.device-btn.active {
    background: #111111;
    color: #ffffff;
}


/* =========================================================
   MESSAGES
   ========================================================= */

.messages {
    flex: 1;

    min-height: 0;

    overflow-x: hidden;
    overflow-y: auto;

    padding: 30px 20px 150px;
}

.messages::-webkit-scrollbar {
    width: 7px;
}

.messages::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 20px;
}


/* =========================================================
   WELCOME
   ========================================================= */

.welcome {
    width: 100%;
    max-width: 720px;

    margin: 60px auto 0;

    text-align: center;
}


.welcome-icon {
    width: 55px;
    height: 55px;

    margin: 0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 16px;

    background: #f2f2f2;

    font-size: 25px;
}


.welcome h1 {
    font-size: 28px;

    color: #181818;

    margin-bottom: 8px;
}


.welcome p {
    font-size: 14px;

    color: #888888;

    line-height: 1.6;
}


/* =========================================================
   SUGGESTIONS
   ========================================================= */

.suggestions {
    width: 100%;

    max-width: 680px;

    margin: 30px auto 0;

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 10px;
}


.suggestion {
    min-height: 58px;

    display: flex;
    align-items: center;

    gap: 9px;

    padding: 10px 12px;

    border: 1px solid #e3e3e3;

    border-radius: 10px;

    background: #ffffff;

    color: #333333;

    font-size: 12px;

    text-align: left;

    cursor: pointer;

    transition: 0.2s ease;
}


.suggestion:hover {
    background: #f7f7f7;

    border-color: #cccccc;

    transform: translateY(-1px);
}


.suggestion-icon {
    font-size: 17px;
}


/* =========================================================
   MESSAGE ROW
   ========================================================= */

.message-row {
    width: 100%;
    max-width: 900px;

    margin: 0 auto 22px;

    display: flex;

    gap: 10px;
}


.message-row.user {
    justify-content: flex-end;
}


.message-row.assistant {
    justify-content: flex-start;
}


/* =========================================================
   AVATAR
   ========================================================= */

.message-avatar {
    width: 32px;
    height: 32px;

    min-width: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: #111111;

    color: #ffffff;

    font-size: 13px;
    font-weight: 700;
}


/* =========================================================
   BUBBLE
   ========================================================= */

.message-bubble {
    max-width: min(760px, 82%);

    padding: 11px 14px;

    border-radius: 12px;

    font-size: 14px;

    line-height: 1.65;

    overflow-wrap: anywhere;
}


.message-row.user .message-bubble {
    background: #111111;

    color: #ffffff;

    border-bottom-right-radius: 4px;
}


.message-row.assistant .message-bubble {
    background: #f4f4f4;

    color: #222222;

    border-bottom-left-radius: 4px;
}


/* =========================================================
   THINKING
   ========================================================= */

.thinking {
    display: flex;
    align-items: center;

    gap: 5px;

    padding: 5px 2px;
}


.thinking span {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #777777;

    animation: thinking 1.2s infinite ease-in-out;
}


.thinking span:nth-child(2) {
    animation-delay: 0.15s;
}

.thinking span:nth-child(3) {
    animation-delay: 0.3s;
}


@keyframes thinking {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}


/* =========================================================
   MARKDOWN
   ========================================================= */

.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
    margin: 12px 0 7px;
}


.message-bubble p {
    margin-bottom: 8px;
}


.message-bubble ul,
.message-bubble ol {
    margin: 8px 0 8px 20px;
}


.message-bubble li {
    margin-bottom: 4px;
}


.message-bubble strong {
    font-weight: 700;
}


/* =========================================================
   CODE
   ========================================================= */

.code-wrapper {
    margin: 12px 0;

    overflow: hidden;

    border: 1px solid #dddddd;

    border-radius: 9px;

    background: #ffffff;
}


.code-header {
    height: 34px;

    display: flex;
    align-items: center;

    justify-content: space-between;

    padding: 0 9px;

    border-bottom: 1px solid #dddddd;

    background: #f6f6f6;
}


.code-language {
    font-size: 10px;

    color: #777777;

    font-weight: 700;

    text-transform: uppercase;
}


.copy-code-btn {
    border: 1px solid #d8d8d8;

    border-radius: 6px;

    background: #ffffff;

    padding: 4px 8px;

    font-size: 10px;

    cursor: pointer;
}


.copy-code-btn:hover {
    background: #eeeeee;
}


.code-wrapper pre {
    margin: 0;

    padding: 13px;

    overflow-x: auto;

    background: #ffffff;
}


.code-wrapper code {
    color: #111111;

    font-family:
        Consolas,
        Monaco,
        "Courier New",
        monospace;

    font-size: 12px;

    line-height: 1.55;
}


/* =========================================================
   GENERATED IMAGES
   ========================================================= */

.astra-generated-images {
    width: 100%;

    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px;

    margin-top: 10px;
}


.astra-generated-image {
    overflow: hidden;

    border: 1px solid #dddddd;

    border-radius: 12px;

    background: #ffffff;
}


.astra-generated-image img {
    display: block;

    width: 100%;
    height: auto;

    max-width: 100%;
}


.generated-image-footer {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 8px;

    padding: 8px;

    border-top: 1px solid #eeeeee;
}


.generated-image-name {
    font-size: 10px;

    color: #777777;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}


.download-image-btn {
    flex-shrink: 0;

    padding: 6px 9px;

    border: 0;

    border-radius: 6px;

    background: #111111;

    color: #ffffff;

    font-size: 10px;

    text-decoration: none;
}


/* =========================================================
   COMPOSER
   ========================================================= */

.composer-wrapper {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    width: 100%;

    padding: 10px 20px 14px;

    background:
        linear-gradient(
            to top,
            #ffffff 78%,
            rgba(255, 255, 255, 0)
        );

    z-index: 100;
}


.composer {
    width: 100%;
    max-width: 850px;

    min-height: 54px;

    margin: 0 auto;

    display: flex;
    align-items: flex-end;

    gap: 7px;

    padding: 7px;

    border: 1px solid #d9d9d9;

    border-radius: 14px;

    background: #ffffff;

    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.07);
}


/* =========================================================
   ATTACH
   ========================================================= */

.attach-btn {
    width: 38px;
    height: 38px;

    min-width: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    cursor: pointer;

    font-size: 18px;
}


.attach-btn:hover {
    background: #eeeeee;
}


/* =========================================================
   TEXTAREA
   ========================================================= */

#messageInput {
    flex: 1;

    min-width: 0;

    max-height: 150px;

    resize: none;

    border: 0;
    outline: 0;

    background: transparent;

    color: #222222;

    font-family: inherit;

    font-size: 14px;

    line-height: 1.5;

    padding: 8px 4px;
}


#messageInput::placeholder {
    color: #999999;
}


/* =========================================================
   SEND
   ========================================================= */

.send-btn {
    width: 38px;
    height: 38px;

    min-width: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;

    border-radius: 9px;

    background: #111111;

    color: #ffffff;

    font-size: 17px;

    cursor: pointer;

    transition: 0.2s ease;
}


.send-btn:hover {
    background: #333333;
}


.send-btn:disabled {
    opacity: 0.5;

    cursor: not-allowed;
}


/* =========================================================
   NOTE
   ========================================================= */

.composer-note {
    max-width: 850px;

    margin: 7px auto 0;

    text-align: center;

    color: #999999;

    font-size: 9px;
}


/* =========================================================
   IMAGE PREVIEW
   ========================================================= */

.image-preview {
    position: relative;

    width: 100%;

    max-width: 850px;

    margin: 0 auto 7px;

    padding: 5px;

    display: flex;
    align-items: center;

    background: #ffffff;

    border: 1px solid #dddddd;

    border-radius: 10px;
}


.image-preview.hidden {
    display: none;
}


.image-preview img {
    width: 55px;
    height: 55px;

    object-fit: cover;

    border-radius: 7px;
}


.remove-image {
    position: absolute;

    left: 48px;
    top: -7px;

    width: 21px;
    height: 21px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 0;

    border-radius: 50%;

    background: #111111;

    color: #ffffff;

    cursor: pointer;

    font-size: 15px;
}


/* =========================================================
   IMAGE POPUP
   ========================================================= */

.image-popup {
    position: fixed;

    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.35);

    z-index: 999999;
}


.image-popup.hidden {
    display: none;
}


.image-popup-box {
    width: 100%;
    max-width: 360px;

    padding: 25px;

    border-radius: 17px;

    background: #ffffff;

    text-align: center;

    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.2);
}


.image-popup-icon {
    font-size: 38px;

    margin-bottom: 12px;
}


.image-popup-box h3 {
    font-size: 18px;

    margin-bottom: 8px;
}


.image-popup-box p {
    color: #777777;

    font-size: 13px;

    line-height: 1.5;

    margin-bottom: 18px;
}


.image-popup-box button {
    width: 100%;

    height: 40px;

    border: 0;

    border-radius: 9px;

    background: #111111;

    color: #ffffff;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;
}


/* =========================================================
   PHONE PREVIEW
   ========================================================= */

body.phone-preview {
    width: 100%;
    height: 100vh;

    margin: 0;

    background: #111111;

    overflow: hidden;
}


body.phone-preview .app {
    width: 390px !important;
    max-width: 390px !important;

    height: 100vh !important;

    min-height: 100vh !important;

    margin: 0 auto !important;

    display: flex !important;

    overflow: hidden !important;

    background: #ffffff;
}


body.phone-preview .sidebar {
    display: none !important;
}


body.phone-preview .main {
    width: 100% !important;

    max-width: 100% !important;

    min-width: 0 !important;

    height: 100vh !important;

    min-height: 100vh !important;

    flex: 1 !important;

    display: flex !important;

    flex-direction: column !important;

    overflow: hidden !important;
}


body.phone-preview .topbar {
    width: 100% !important;

    height: 58px !important;

    min-height: 58px !important;

    padding: 0 10px !important;

    display: flex !important;

    align-items: center !important;

    justify-content: space-between !important;

    flex-shrink: 0 !important;

    overflow: visible !important;
}


body.phone-preview .device-switch {
    display: flex !important;

    visibility: visible !important;

    opacity: 1 !important;

    position: relative !important;

    width: auto !important;

    min-width: 84px !important;

    height: 38px !important;

    z-index: 99999 !important;
}


body.phone-preview .device-btn {
    display: flex !important;

    visibility: visible !important;

    opacity: 1 !important;
}


body.phone-preview .messages {
    width: 100% !important;

    min-width: 0 !important;

    flex: 1 !important;

    overflow-x: hidden !important;

    overflow-y: auto !important;

    padding: 18px 11px 130px !important;
}


body.phone-preview .welcome {
    width: 100% !important;

    max-width: 100% !important;

    margin-top: 25px !important;

    padding: 20px 5px !important;
}


body.phone-preview .welcome h1 {
    font-size: 23px;
}


body.phone-preview .welcome p {
    font-size: 13px;
}


body.phone-preview .suggestions {
    width: 100% !important;

    display: flex !important;

    flex-direction: column !important;

    gap: 9px !important;
}


body.phone-preview .suggestion {
    width: 100% !important;

    max-width: 100% !important;
}


body.phone-preview .message-row {
    width: 100% !important;

    max-width: 100% !important;
}


body.phone-preview .message-bubble {
    max-width: calc(100% - 42px) !important;

    overflow-wrap: anywhere !important;

    word-break: break-word !important;
}


body.phone-preview .astra-generated-images {
    width: 100% !important;

    display: flex !important;

    flex-direction: column !important;

    gap: 10px !important;
}


body.phone-preview .astra-generated-image {
    width: 100% !important;

    max-width: 100% !important;
}


body.phone-preview .astra-generated-image img {
    width: 100% !important;

    max-width: 100% !important;

    height: auto !important;
}


body.phone-preview .composer-wrapper {
    position: absolute !important;

    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;

    width: 100% !important;

    padding: 8px 9px !important;

    background: #ffffff !important;

    z-index: 100 !important;
}


body.phone-preview .composer {
    width: 100% !important;

    max-width: 100% !important;

    box-sizing: border-box !important;
}


body.phone-preview #messageInput {
    min-width: 0 !important;

    font-size: 14px !important;
}


body.phone-preview .download-app-box {
    display: none !important;
}


/* =========================================================
   SMALL SCREEN
   ========================================================= */

@media (max-width: 700px) {

    .sidebar {
        display: none;
    }

    .main {
        width: 100%;
    }

    .topbar {
        padding: 0 10px;
    }

    .device-switch {
        display: flex;
    }

    .messages {
        padding-left: 11px;
        padding-right: 11px;
    }

    .suggestions {
        grid-template-columns: 1fr;
    }

    .welcome {
        margin-top: 30px;
    }

    .welcome h1 {
        font-size: 23px;
    }

    .message-bubble {
        max-width: 88%;
    }

    .astra-generated-images {
        grid-template-columns: 1fr;
    }

    .composer-wrapper {
        padding-left: 8px;
        padding-right: 8px;
    }
}