html {
    height: -webkit-fill-available;
    background: #343541;
}

body {
    height: 100%;
}

body {
    display: flex;
    overflow: hidden;
    font-family: Arial, sans-serif;
    margin: 0;
    position: fixed;
    width: 100%;
}

.hidden {
    display: none !important;
}

.sidebar {
    width: 260px;
    background-color: #202123;
    color: white;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.new-chat-btn {
    background-color: #343541;
    border: 1px solid #565869;
    border-radius: 5px;
    color: white;
    padding: 10px;
    margin-bottom: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.new-chat-btn:hover {
    background-color: #40414f;
}

.chat-sessions {
    overflow-y: auto;
    flex-grow: 1;
}

.chat-session {
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.session-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
}

.delete-chat {
    opacity: 0.5;
    cursor: pointer;
    padding: 0 5px;
}

.delete-chat:hover {
    opacity: 1;
}

.chat-session:hover {
    background-color: #343541;
}

.chat-session.active {
    background-color: #343541;
}

.main-content {
    flex-grow: 1;
    background-color: #343541;
    display: flex;
    flex-direction: column;
    color: white;
}

.chat-select-prompt {
    font-size: 2em;
    color: #565869;
    display: flex;
    flex-grow: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 15px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .chat-select-prompt .desktop-text {
        display: none;
    }
}

@media (min-width: 769px) {
    .chat-select-prompt .mobile-text {
        display: none;
    }
}

.chat-select-prompt i {
    font-size: 1.5em;
}

.chat-top-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: #40414f;
    border-bottom: 1px solid #565869;
}

@media not all and (max-width: 768px) {
    .chat-top-bar-hidden {
        display: none !important;
    }
}

.chat-top-bar-hidden > div {
    display: none !important;
}

.menu-button {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px;
}

@media (max-width: 768px) {
    .chat-top-bar {
        display: flex;
    }

    .menu-button {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -285px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
        width: 100vw;
    }
}

.drag-drop-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #676a7e;
}

.drag-drop-indicator i {
    font-size: 1.2em;
}

@media (max-width: 768px) {
    .drag-drop-indicator span {
        display: none;
    }
    .drag-drop-indicator svg {
        border: 1px solid #565869;
        padding: 8px;
        border-radius: 4px;
    }
}

.progress-bar {
    width: 200px;
    height: 4px;
    margin-left: auto;
    background-color: #565869;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar > div {
    height: 100%;
    background-color: #10a37f;
    transition: width 0.3s ease;
}

.progress-numbers {
    color: #676a7e;
    font-size: 0.9em;
}

.status-icon {
    width: 1.2em;
    text-align: center;
    color: #676a7e;
}

.status-icon.complete {
    color: #10a37f;
}

.chat-area {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 5px;
    -webkit-overflow-scrolling: touch;
}

#messages-container {
    display: flex;
    flex-direction: column;

    margin: auto;
    max-width: 800px;
    min-height: 100%;
    justify-content: flex-end;
}

.input-area {
    padding: 20px;
    background-color: #343541;
    border-top: 1px solid #565869;
}

.input-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.send-button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #676a7e;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 1.2em;
}

.send-button:hover {
    color: white;
}

.message-input {
    font-family: Arial, sans-serif;
    width: 100%;
    padding-right: 40px;
    /* vertical padding doubles because setting height to scrollHeight */
    box-sizing: border-box;
    padding: 10px 10px;
    align-content: center;
    border-radius: 15px;
    border: 1px solid #565869;
    background-color: #40414f;
    color: white;
    font-size: 1em;

    resize: none;
    overflow: hidden;
}

.message-input:focus {
    outline: none;
}

.message-input::placeholder {
    color: #676a7e;
}

.csv-container {
    overflow-x: auto;
    max-height: 300px;
}

.csv-table {
    border-collapse: collapse;
    margin: 10px 0;
    width: 100%;
    background: #40414f;
}

.csv-table th, .csv-table td {
    border: 1px solid #565869;
    padding: 8px;
    text-align: left;
}

.csv-table th {
    background: #494b5b;
}

md-block {
    word-break: break-word;
}

md-block table {
    border-collapse: collapse;
    margin: 10px 0;
}

md-block thead {
    background-color: #40414f;
}

md-block th {
    border: 1px solid #565869;
    padding: 8px;
}

md-block td {
    border: 1px solid #565869;
    padding: 8px;
}

.message {
    margin: 10px;
    padding: 10px;
    border-radius: 5px;
}

.user-message {
    background-color: #494b5b;
    margin-left: auto;
    max-width: 80%;
    text-align: left;
    word-break: break-word;
    white-space: pre-wrap;
}

.ai-logo {
    width: 2em;
    padding: 15px;
    padding-left: 0px;
    margin-bottom: auto;
}

.ai-message {
    display: flex;
    padding-left: 0px;
    align-items: flex-start;
}

.loading-message {
    display: flex;
    align-items: flex-start;
    margin-left: auto;
    margin-right: auto;
}

.message-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    max-width: 100%;
    margin-top: 5px;
}

.loader {
    width: 1.5em;
    height: 1.5em;
    margin-left: 15px;
    margin-right: 15px;

    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #555555;
}

.spin {
    -webkit-animation: spin 1s linear infinite;
    animation: spin 1s linear infinite;
}

@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    color: red;
    margin: 10px 0;
}

.drop-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.drop-overlay.active {
    display: flex;
}

.drop-message {
    background-color: #40414f;
    padding: 20px 40px;
    border-radius: 8px;
    color: white;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.drop-message i {
    font-size: 1.5em;
}
