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

body {
    background-color: #36393f;
    color: #dcddde;
    font-family: 'Inter', sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header#chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 900px;
    padding: 1rem 2rem;
    box-sizing: border-box;
    background-color: #2f3136;
    border-bottom: 1px solid #202225;
}

header#chat-header h1 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

#sort-button {
    background-color: #7289da;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

#sort-button:hover {
    background-color: #677bc4;
}

#chat-container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    padding-top: 0;
    box-sizing: border-box;
}

.chat-message {
    display: flex;
    margin-bottom: 1.5rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #7289da;
    margin-right: 1rem;
    flex-shrink: 0;
    /* Simple AI icon with CSS */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
}

.message-content {
    display: flex;
    flex-direction: column;
}

.message-header {
    display: flex;
    align-items: baseline;
    margin-bottom: 0.25rem;
}

.username {
    color: #fff;
    font-weight: 500;
    margin-right: 0.5rem;
}

.timestamp {
    color: #72767d;
    font-size: 0.75rem;
}

.message-body {
    font-size: 0.95rem;
    line-height: 1.4;
}

.embed {
    background-color: #2f3136;
    border-left: 4px solid; /* Color will be set based on action */
    border-radius: 4px;
    padding: 1rem;
    margin-top: 0.5rem;
    display: grid;
    gap: 0.5rem;
}

.embed.buy {
    border-color: #43b581; /* Green for buy */
}

.embed.sell {
    border-color: #f04747; /* Red for sell */
}

.embed-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.embed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.embed-field {
    font-size: 0.9rem;
}

.embed-field-title {
    font-weight: 700;
    color: #b9bbbe;
    margin-bottom: 0.25rem;
}

.reason-text {
    max-height: 4.2em; /* 3 lines */
    overflow: hidden;
    cursor: pointer;
    transition: max-height 0.3s ease;
}

.reason-text.expanded {
    max-height: 1000px;
}

.loading-message {
    text-align: center;
    padding: 2rem;
    color: #72767d;
}