/* General resets and sterile layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    overflow: hidden;
}

.app-container {
    display: grid;
    grid-template-columns: 20% 50% 30%;
    height: 100vh;
    width: 100vw;
}

/* Common sidebar and layout styling */
aside, main {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-right: 1px solid #2d2d2d;
    background-color: #1e1e1e;
}

aside:last-child {
    border-right: none;
}

/* Left Sidebar (Contacts) */
.sidebar-header {
    padding: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    color: #888888;
    border-bottom: 1px solid #2d2d2d;
}

.contact-list {
    list-style: none;
    overflow-y: auto;
}

.contact-item {
    padding: 15px;
    border-bottom: 1px solid #2d2d2d;
    cursor: pointer;
    background-color: #1e1e1e;
}

.contact-item:hover {
    background-color: #2a2a2a;
}

.contact-item.active {
    background-color: #333333;
}

.contact-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.contact-status {
    font-size: 0.8rem;
    color: #888888;
    margin-top: 4px;
}

/* Middle Column (Chat Thread) */
.chat-main {
    background-color: #151515;
}

.chat-header {
    padding: 15px;
    font-weight: bold;
    border-bottom: 1px solid #2d2d2d;
    background-color: #1e1e1e;
    font-size: 1rem;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Messages styling */
.message {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.whale {
    align-self: flex-start;
    background-color: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #3d3d3d;
}

.message.creator {
    align-self: flex-end;
    background-color: #1f3a52;
    color: #e0f2fe;
    border: 1px solid #2b5275;
}

/* Chat input area at the bottom (sticky) */
.chat-input-area {
    padding: 15px;
    background-color: #1e1e1e;
    border-top: 1px solid #2d2d2d;
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    height: 60px;
    background-color: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #3d3d3d;
    border-radius: 4px;
    padding: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: none;
    outline: none;
}

#chat-input:focus {
    border-color: #555555;
}

#send-btn {
    width: 80px;
    background-color: #333333;
    color: #e0e0e0;
    border: 1px solid #444444;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: background-color 0.2s;
}

#send-btn:hover {
    background-color: #444444;
}

#send-btn:active {
    background-color: #222222;
}

/* Right Sidebar (Profile & AI Injection Zone) */
.profile-section {
    padding: 20px;
    border-bottom: 1px solid #2d2d2d;
}

.profile-section h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #ffffff;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-field {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.field-label {
    color: #888888;
}

.field-value {
    font-weight: bold;
}

#aia-injection-zone {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}
