* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: #f5f7fa;
    height: 100vh;
    display: flex;
    justify-content: center;
}

.main-view {
    max-width: 800px;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.chat-header {
    padding: 0 20px;
    background-color: #007bff;
    color: white;
    font-weight: bold;
    font-size: 18px;
    border-bottom: 1px solid #0069d9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header button {
    float: right;
    border-radius: 5px;
    padding: 8px 12px;
    margin: 10px;
    border: none;
}

#chat-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    width: 70%;
    padding: 12px 15px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.received {
    align-self: flex-start;
    background-color: #f0f0f0;
    border-bottom-left-radius: 5px;
    color: #333;
}

.sent {
    align-self: flex-end;
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 5px;
}

.error {
    align-self: flex-start;
    background-color: #ffeeee;
    border: 1px solid #ffcccc;
    color: #d83030;
    border-radius: 5px;
    padding: 10px;
    width: 100%;
    font-size: 14px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
    text-align: right;
}

.input-area {
    display: flex;
    padding: 15px;
    border-top: 1px solid #eaeaea;
    background-color: white;
    align-items: flex-end;
    width: 100%;
}

#message-input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    margin-right: 10px;
    resize: none;
    height: 160px; /* Fixed height for 3 lines */
    min-height: 80px;
    max-height: 150px;
    transition: border-color 0.3s;
    font-family: inherit;
    line-height: 1.4;
    width: calc(100% - 100px); /* Take remaining space minus send button */
}

#message-input:focus {
    outline: none;
    border-color: #007bff;
}

#send-button {
    padding: 12px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 500;
}

#send-button:hover {
    background-color: #0069d9;
}

#send-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.typing-indicator {
    align-self: flex-start;
    background-color: #f0f0f0;
    padding: 8px 15px;
    border-radius: 18px;
    color: #666;
    font-style: italic;
    margin-bottom: 10px;
    display: none;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #888;
    height: 100%;
    text-align: center;
    padding: 20px;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #ddd;
}

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 7px 10px;
    border-radius: 6px;
    outline: none;
    margin: 10px;
    min-width: 150px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='16' viewBox='0 0 20 20' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M7 7l3 3 3-3z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
    text-align: center;
  }
  
  .custom-select:focus {
    border-color: #5b9bd5;
    box-shadow: 0 0 0 2px rgba(91, 155, 213, 0.3);
  }
  