html {
    overflow-y: initial;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#container {
    background-color: initial;
}

#container,
#content {
    height: 100%;
}

.main-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-container * {
    font-family: AlbertaSans, Roboto, sans-serif;
    box-sizing: border-box;
}

.chat-container {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(to right, #F23047, #FE7007);
    color: white;
    padding: 20px;
    border-bottom-left-radius: 23px;
    display: flex;
    gap: 16px;
}

#doc_ai-icon {
    background-image: url(/images/UI_icons/white/file_sparkle.svg);
    width: 18px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    display: inline-block;
    margin-right: 10px;
}

.chat-header h1 {
    font-size: 16px;
    font-weight: bold;
    line-height: 20px;
    display: inline-block;
    vertical-align: middle;
}

.chat-header p {
    opacity: 0.9;
    font-size: 14px;
}

#doc_ai-header-title {
    margin-right: auto;
}

#doc_ai-close-icon, #doc_ai-refresh-icon {
    width: 16px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

#doc_ai-close-icon {
    background-image: url(/images/UI_icons/white/close.svg);
}

#doc_ai-refresh-icon {
    background-image: url(/images/UI_icons/white/reload.svg);
}

#doc_ai-close-icon:hover, #doc_ai-refresh-icon:hover {
    opacity: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
    font-size: 16px;

    background-image: url(/images/UI_icons/light_grey/file_sparkle.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100px;
}

.chat-container.chat-started .chat-messages {
    background-image: none;
}

.message {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
}

.message.user {
    flex-direction: row-reverse;
}

.message-content {
    background: white;
    padding: 15px 20px;
    border-radius: 18px;
    max-width: 70%;
    position: relative;
}

.message.user .message-content {
    background: linear-gradient(to right, #F7F2F3, #F5E4E7);
    color: black;
}

.message.assistant .message-content {
    background: transparent;
    box-shadow: none;
}

.copy-button {
    border: 1px solid #D9D9D9;
    border-radius: 8px;
    display: inline-block;
    width: 30px;
    height: 30px;
    cursor: pointer;
    background: url( '/images/UI_icons/copy.svg' ) center/contain no-repeat;
    background-origin: content-box;
    padding: 8px;
    transition: background-color 0.2s ease;
}

.copy-button:hover {
    background-image: url( '/images/UI_icons/white/copy.svg' );
    background-color: #000;
}

.copy-button.copied {
    background-image: url( '/images/UI_icons/white/check.svg' );
    background-color: #28CC90;
}

.message-text {
    line-height: 1.5;
}

.message.assistant .message-text {
    margin-bottom: 5px;
}

.message-text p {
    margin: 0 0 10px 0;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text strong, .message-text b {
    font-weight: bold;
}

.message-text em, .message-text i {
    font-style: italic;
}

.message-text ul, .message-text ol {
    margin: 10px 0;
    padding-left: 20px;
}

.message-text li {
    margin: 5px 0;
}

.message-text a {
    color: #667eea;
    text-decoration: none;
}

.message-text a:hover {
    text-decoration: underline;
}

.chat-input-container {
    padding: 0 30px 30px 30px;
    position: relative;
}

.common-borders-button-like-container > * {
    cursor: pointer;
    border: 1px solid #D8D8D8;
    border-radius: 10px;
    height: 40px;
    transition: border-color 0.2s ease;
}

.common-borders-button-like-container > *:hover {
    border-color: #242424;
}

.fade-overlay {
    position: absolute;
    width: 100%;
    height: 60px;
    left: 0;
    top: -60px;
    background: linear-gradient(to top, white, transparent);
}

/* Document Indicator Styles */
.document-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

.document-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(to right, #F23047, #FE7007);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-label {
    color: #333;
    font-weight: 500;
}

.document-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    max-width: 60%;
}

.document-icon {
    width: 16px;
    height: 16px;
    background-image: url(/images/UI_icons/file.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    flex-shrink: 0;
}

.document-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
}

.suggested-prompts {
    position: absolute;
    top: -55px;
    left: 0;
    right: 0;
    padding: 0 30px;
    display: flex;
    gap: 10px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease, margin-bottom 0.3s ease;
}

.suggested-prompts > * {
    line-height: 40px;
}

.suggested-prompts:not(.show) {
    opacity: 0;
    transform: translateY(10px);
    margin-bottom: 0;
}

.chat-container.chat-started .suggested-prompts {
    display: none !important;
}

.prompt-btn {
    font-size: 14px;
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: auto 16px;
    padding-left: 35px;
    padding-right: 20px;
    white-space: nowrap;
}

.prompt-btn.summarize {
    background-image: url(/images/UI_icons/file.svg);
}

.prompt-btn.insights {
    background-image: url(/images/UI_icons/key-insights.svg);
}

.prompt-btn.translate {
    background-image: url(/images/UI_icons/translate.svg);
}

.chat-input-form {
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 20px;
    box-shadow: 0px 0px 40px rgba(4, 30, 77, 0.16);
    background: white;
}

.chat-input {
    width: 100%;
    flex: 1;
    border: none;
    border-radius: 20px;
    padding: 20px;
    padding-bottom: 70px;
    padding-top: 15px;
    font-size: 16px;
    outline: none;
    resize: none;
    min-height: 125px;
    max-height: 250px;
    line-height: 20px;
    background: white;
}

/* When document indicator is present, adjust textarea border radius */
.chat-input-form.has-document .chat-input {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    padding-top: 15px;
}

.send-btn {
    position: absolute;
    right: 15px;
    bottom: 15px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background:
        url(/images/UI_icons/white/arrow_up.svg) center no-repeat,
        linear-gradient(to right, #F23047, #FE7007);
    z-index: 10;
}

.send-btn:disabled {
    background:
        url(/images/UI_icons/white/arrow_up.svg) center no-repeat,
        linear-gradient(#B5B5B5, #B5B5B5);
}

.typing-indicator {
    display: none;
    padding-left: 20px;
    margin-bottom: 20px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #242424;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.model-selector {
    position: absolute;
    left: 45px;
    bottom: 45px;
}

/* Custom Select Dropdown Styles */
.custom-select {
    position: relative;
    width: 100%;
}

.select-trigger {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 15px;
}

.selected-value {
    font-size: 14px;
    color: #333;
}

.select-arrow {
    transition: transform 0.2s ease;
}

.custom-select.open .select-arrow {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    margin-bottom: 8px;
    min-width: max-content;
}

.custom-select.open .select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.select-group {
    margin: 8px 0;
}

.group-label {
    padding: 8px 16px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.select-option {
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    white-space: nowrap;
}

.select-option:last-child {
    border-bottom: none;
}

.select-option:hover {
    background: #F7F7F7;
}

.select-option.selected {
    background: #e3f2fd;
    color: #007bff;
    font-weight: 500;
}

.select-option.selected::before {
    content: "";
    position: absolute;
    right: 16px;
    width: 14px;
    height: 14px;
    background-image: url(/images/UI_icons/blue/check.svg);
    background-size: contain;
    background-repeat: no-repeat;
}

/* Focus states for accessibility */
.select-option:focus {
    outline: none;
    background: #e3f2fd;
    color: #007bff;
}

/* Animation for option selection */
.select-option {
    transform: translateX(0);
    transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.select-option:active {
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .chat-container {
        height: 100vh;
        border-radius: 0;
        overflow: visible;
    }

    body {
        padding: 0;
    }

    .message-content {
        max-width: 85%;
    }

    .suggested-prompts {
        overflow-y: hidden;
    }
}

@media (max-width: 650px) {
    .document-indicator {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 15px;
    }

    .document-info {
        max-width: 100%;
    }

    .chat-input {
        padding: 15px;
        padding-bottom: 70px;
        padding-top: 10px;
    }
}

.markdownit,
.markdownit *:not(table):not(table *) {
    all: revert !important;
}

table th,
table td {
    padding: 10px;
}

table thead th {
    background-color: #f8f9fa;
    font-weight: 600;
}

table tbody tr:nth-of-type(odd) {
    background-color: #f2f2f2;
}

table tbody tr:hover {
    background-color: #e6e6e6;
}
