
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f0f4f8;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

h1, h2, h3 {
    color: #2c3e50;
    text-align: center;
}

a {
    color: #3498db;
    text-decoration: none;
}

h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    text-align: center;
    color: #2c3e50;
}

.search-box, #searchHistory, #searchResultsContainer, #chat-container {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.col {
    flex: 1;
    margin-right: 10px;
}

.col:last-child {
    margin-right: 0;
}

input[type="text"], input[type="number"], select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    color: #333;
    box-sizing: border-box;
}

input::placeholder, select, textarea::placeholder {
    color: #999;
}

button {
    background-color: #3498db;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

button:hover {
    background-color: #2980b9;
}

#historyList {
    padding: 0;
    margin: 0;
    list-style-type: none;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.history-item span {
    cursor: pointer;
    flex-grow: 1;
}

.delete-history {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 3px;
}

#chat-messages {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 10px;
}

#historyContainer {
    max-height: 0px;
    overflow-y: hidden;
    transition: max-height 0.3s ease-out;
}

#historyContainer.expanded {
    max-height: 400px;
    overflow-y: auto;
}

#showMoreHistory {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 10px;
}

.user-message, .assistant-message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
}

.user-message {
    background: #e8f4fd;
    text-align: right;
}

.assistant-message {
    background: #f0f0f0;
    text-align: left;
}

.auto-resize {
    min-height: 40px;
    overflow-y: hidden;
    resize: none;
}

#chatToSearchGroup, #chatFormGroup {
    display: flex;
    align-items: flex-start;
}

#searchFormGroup {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-button_input {
    flex: 1;
    border-radius: 5px 0 0 5px;
}

.input-button_button {
    border-radius: 0 5px 5px 0;
}

#results {
    transition: max-height 0.3s ease-out;
}

#results.collapsed {
    max-height: 200px;
    overflow-y: auto;
}

#results.expanded {
    max-height: none;
}

/* Tablet styles */
@media (max-width: 1024px) and (min-width: 768px) {
    .container {
        max-width: 90%;
    }

    h1 {
        font-size: 2.5rem;
    }

    .row {
        flex-wrap: wrap;
    }

    .col {
        flex-basis: calc(50% - 10px);
        margin-bottom: 10px;
    }
}

/* Mobile styles */
@media (max-width: 767px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .row {
        flex-direction: column;
    }

    .col {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }

    input[type="text"], input[type="number"], select, textarea, button {
        width: 100%;
        margin-bottom: 10px;
    }

    #chatToSearchGroup, #chatFormGroup, #searchFormGroup {
        flex-direction: column;
    }

    .input-button_input, .input-button_button {
        width: 100%;
        border-radius: 5px;
    }

    .input-button_button {
        margin-top: 10px;
    }

    #historyContainer.expanded {
        max-height: 300px;
    }
}