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

/* Color Palette Variables */
:root {
    --primary: #e91e63;
    --secondary: #f06292;
    --light: #fce4ec;
    --dark: #880e4f;
    --text-color: #36454F;
    --accent: #ff80ab;
    --highlight-bg: #ffdce5;
    --active-link: #ff80ab;
}

/* Theme support (light/dark) */
.light-theme {
    --primary: #e91e63;
    --secondary: #f06292;
    --light: #fce4ec;
    --dark: #880e4f;
    --text-color: #4a0040;
    --accent: #ff80ab;
    --highlight-bg: #ffdce5;
    --active-link: #ffffff;
    background: var(--light);
    color: var(--text-color);
}

.dark-theme {
    --primary: #ff80ab;
    --secondary: #f06292;
    --light: #1e1e2f;
    --dark: #fce4ec;
    --text-color: #fce4ec;
    --accent: #ff4081;
    --highlight-bg: #2c2c3a;
    --active-link: #ffbcd4;
    background: var(--light);
    color: var(--text-color);
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    width: 100vw;
    max-width: 100vw;
    overflow: hidden; /* Prevent *page* scroll! */
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-family: 'Nunito', 'Inter', 'Work Sans', Arial, sans-serif;
    font-size: 16px;
    color: var(--text-color); /* No *page* scroll */
}

.bg-primary {
    background-color: var(--primary) !important;
    color: #fff !important;
}

.bg-secondary {
    background-color: var(--secondary) !important;
    color: #fff !important;
}

.container, .cover-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

img, .img-fluid {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Navbar */
.navbar {
    background: var(--primary);
    padding: 0.75rem 1.5rem;
}

.navbar-brand, .nav-link {
    color: var(--text-color) !important;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-link.active, .nav-link:focus, .nav-link:hover {
    color: white !important;
    background: var(--active-link) !important;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
}


/* Chat messages area scrollable and fills available space */
#list-wrapper {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    max-height: 85vh;
    padding-bottom: 10px;
    padding-top: 10px;
    scrollbar-width: thin;
}

@media (max-width: 590px) {
    #list-wrapper, .chatgpt-messages {
        max-height: 50vh;
        padding-left: 0;
        padding-right: 0;
    }
}

/* Chat Messages */
.chatgpt-message {
    max-width: 90vw;
    padding: 12px 10px;
    font-size: 1rem;
    box-shadow: 0 1px 3px rgba(233, 30, 99, 0.08);
    word-break: break-word;
}

.chatgpt-message_user {
    align-self: flex-end;
    color: var(--text-color);
    margin-right: 10px;
}

.chatgpt-message_user p {
    background: var(--primary);
    color: #fff;
    border-radius: 20px 20px 0 20px;
    padding: 10px 16px;
    font-size: 1.08rem;
    margin: 0;
    word-break: break-word;
    box-shadow: 0 1px 4px rgba(233, 30, 99, 0.06);
}

.chatgpt-message_bot {
    align-self: flex-start;
    margin-top: 2px;
    background: #fff;
    color: var(--text-color);
    border: 1px solid var(--highlight-bg);
    border-radius: 18px 18px 18px 0;
    padding: 8px 12px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(236, 64, 122, 0.08);
}

.message-content {
    word-break: break-word;
    font-size: 1.05rem;
    padding-bottom: 2px;
}

@media (max-width: 600px) {
    .chatgpt-message_user p, .chatgpt-message_bot {
        font-size: 1em;
        padding: 8px 10px;
        margin-bottom: 7px;
    }
}

/* Chat input area - always visible at bottom, not too tall */
.chatgpt-input {
    background: #fff;
    border-top: 1px solid var(--highlight-bg);
    padding: 16px 8px 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    bottom: 0;
    width: 100%;
    z-index: 10;
}

.chatgpt-input form {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: stretch;
    position: relative;
}

.chatgpt-input input[type="text"] {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--light);
    border-radius: 8px;
    outline: none;
    font-size: 1rem;
    background: #fff;
    color: var(--text-color);
    transition: border 0.2s;
    min-width: 0;
}

.chatgpt-input input[type="text"]:focus {
    border-color: var(--primary);
}

.chatgpt-input button, .submit-btn {
    min-width: 108px;
    height: 50px;
    padding: 0 18px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.22s, transform 0.1s;
    box-shadow: 0 4px 16px -8px var(--primary);
}

.chatgpt-input button:active, .submit-btn:active {
    background: var(--dark);
}

/* Responsive layout tighten for input @mobile */
@media (max-width: 600px) {
    .chatgpt-input {
        padding: 9px 4px !important;
        gap: 5px;
    }

    .chatgpt-input form {
        flex-direction: column;
        gap: 6px;
    }

    .submit-btn, .chatgpt-input button {
        min-width: 80px;
        height: 46px;
        font-size: 1rem;
        width: 100%;
    }
}

/* Sample Questions/Chips - Responsive and Compact */
.sample-questions {
    display: flex;
    flex-wrap: wrap;
    margin: 8px 0;
}

/* Mobile: super compact, horizontal scroll, 1 line only */
@media (max-width: 600px) {
    .sample-questions {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: scroll;
        gap: 8px;
        margin-bottom: 2px;
        padding-bottom: 2px;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        height: auto !important;
        max-height: 50px; /* encourages single line */
    }

    .chip {
        flex-shrink: 0;
        font-size: small;
        padding: 6px 15px;
    }

}

/* Chips */
.chip {
    padding: 6px 16px;
    background: var(--accent);
    color: #fff;
    border-radius: 16px;
    font-size: 0.98rem;
    cursor: pointer;
    user-select: none;
    margin-bottom: 3px;
    transition: background .15s, box-shadow .14s;
}

.chip:hover, .chip:focus {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 3px 14px -7px var(--primary);
    outline: none;
}

/* Chat feedback buttons adapt on mobile */
.feedback-btn {
    min-width: 38px;
    min-height: 38px;
    font-size: 1.1em;
    padding: 2px 9px;
}

/* Progress Spinner Overlay (centered over form, always visible as overlay) */
.progress-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

/* Footer */
footer {
    color: var(--text-color);
    background: transparent;
    padding: 1.5rem 0 0.5rem 0;
    text-align: center;
    font-size: 14px;
    width: 100%;
}

/* Improve footer spacing on mobile */
@media (max-width: 576px) {
    footer {
        padding: 1rem 0 0.3rem 0;
        font-size: 13px;
    }
}

/* Card Styles for Information Boxes */
.card {
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 1rem;
}

.card-header {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}

.card-body {
    background: #fff;
    color: var(--text-color);
    padding: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

a:hover {
    color: var(--dark);
}

/* Responsive – Stack buttons, messages, container on small screens */
@media (max-width: 590px) {
    .container {
        max-width: 100vw;
        padding: 8px;
    }

    .chatgpt-container {
        max-width: 90vw;
        padding: 8px;
        border-radius: 0 0 12px 12px;
        overflow-y: hidden;
    }

    .chatgpt-message {
        max-width: 98vw;
        padding: 9px 5px;
        font-size: 0.95em;
    }

    .chatgpt-messages {
        padding: 10px 4px;
        gap: 8px;
    }

    .chatgpt-input {
        flex-direction: column;
        gap: 6px;
        padding: 10px 4px;
    }

    main, .main-content {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }
}

/* Misc – model lists and sidebar styling */
.model-list .list-group-item {
    color: var(--text-color);
    font-weight: 500;
    transition: background-color 0.2s;
}

.model-list .list-group-item:hover {
    background-color: var(--highlight-bg);
    cursor: pointer;
}

.model-list .badge.bg-primary {
    background-color: var(--secondary) !important;
}

.model-list .badge.bg-secondary {
    background-color: var(--accent);
}

.model-list .badge.bg-dark {
    background-color: var(--dark);
    color: white;
}

.offcanvas.bg-primary .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.drawer-link {
    color: #fff !important;
}

.drawer-link.active, .drawer-link:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
}

/* Sidebar (if present) */
.sidebar {
    background-color: var(--secondary) !important;
    color: #fff !important;
    min-height: 100vh;
    padding-top: 1rem;
}

/* Miscellaneous Utility and Accessibility */
*:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

::-webkit-input-placeholder {
    color: #bbb;
}

::-moz-placeholder {
    color: #bbb;
}

:-ms-input-placeholder {
    color: #bbb;
}

::placeholder {
    color: #bbb;
}

/* Further mobile tweaks */
@media (max-width: 490px) {
    h1 img {
        max-width: 80vw;
        height: auto;
    }

    h3, .lead {
        font-size: 1rem !important;
    }

    .chip {
        font-size: x-small;
    }

    .sample-questions {
        height: 50%;
    }

    .submit-btn {
        width: 100%;
        height: 100%;
    }

    .auth-form {
        width: 100%;
        max-width: 400px;
        max-height: 80vh;
        overflow-y: scroll !important;
        margin: 0 auto;
        padding: 20px;
        background: var(--light);
        border-radius: 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }

}


/* Button color consistency */
.btn-primary, .btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);

}

.auth-form {
    width: 100%;
    max-width: 400px;
    overflow-y: scroll;
    padding: 20px;
    background: var(--light);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo_home {
    width: 150px;
    height: auto;
}
