/* style.css */

:root {
    --bg-color:      #f8f9fa;
    --text-color:    #212529;
    --bubble-user:   #d1e7dd;
    --bubble-admin:  #cfe2ff;
    --primary:       #198754;
    --primary-hover: #157347;
    --border:        #dee2e6;
    --input-bg:      #ffffff;
    --muted:         #6c757d;
}

body.dark {
    --bg-color:      #212529;
    --text-color:    #e9ecef;
    --bubble-user:   #2a9d8f;
    --bubble-admin:  #5c7cfa;
    --primary:       #2ecc71;
    --primary-hover: #27ae60;
    --border:        #495057;
    --input-bg:      #343a40;
    --muted:         #adb5bd;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.35s ease, color 0.35s ease;
}

.container, .admin-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

h1, h2, h3 {
    margin-top: 0.4em;
    color: var(--text-color);
}

form {
    margin: 1.5rem 0;
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 0.75rem;
    margin: 0.5rem 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

button:hover {
    background: var(--primary-hover);
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.chat-window {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    height: 60vh;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

#chat-messages {
    flex: 1;
}

.message {
    margin: 0.8rem 0;
    max-width: 80%;
    padding: 0.9rem 1.2rem;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-bubble {
    background: var(--bubble-user);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.admin-bubble {
    background: var(--bubble-admin);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    color: white;
}

.message small {
    display: block;
    margin-top: 0.3rem;
    opacity: 0.7;
    font-size: 0.82rem;
}

.admin-container {
    display: flex;
    gap: 1.5rem;
}

.left-panel {
    width: 320px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    padding-right: 1rem;
}

.right-panel {
    flex: 1;
}

.user-section {
    margin: 1.2rem 0;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.user-section h3 {
    margin: 0 0 0.6rem 0;
    font-size: 1.1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.theme-toggle-area {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    z-index: 10;
}

@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    .left-panel {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 1rem;
    }
}
