/* public/assets/css/style.css */

:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --bg-color: #dfe6e9;
    --chat-bg: #ffffff;
    --text-color: #2d3436;
    --message-sent: #6c5ce7;
    --message-received: #f1f2f6;
    --danger: #d63031;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    /* Stack items vertically */
    justify-content: center;
    /* align-items: center; Removed to allow footer to stretch */
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 480px;
    background: var(--chat-bg);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(90vh - 60px);
    /* Adjust for footer */
    margin: 20px auto;
    /* Center vertically and horizontally */
}

/* Header */
header {
    background: var(--primary-color);
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.2rem;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

/* Auth Forms */
.auth-form {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-radius: 6px;
    font-size: 1rem;
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

input,
textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
}

button {
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #5649c0;
}

.link {
    text-align: center;
    font-size: 0.9rem;
}

.link a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Chat UI */
#chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 75%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.sent {
    align-self: flex-end;
    background: var(--message-sent);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received {
    align-self: flex-start;
    background: var(--message-received);
    color: var(--text-color);
    border-bottom-left-radius: 4px;
}

.system-message {
    align-self: center;
    background: rgba(0, 0, 0, 0.05);
    color: #636e72;
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 10px;
}

#input-area {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

#input-area input {
    flex: 1;
}

#controls {
    padding: 10px;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
}

.btn-danger {
    background: var(--danger);
}

.btn-secondary {
    background: var(--secondary-color);
}

/* Footer Styles */
.site-footer {
    width: 100%;
    padding: 20px 0;
    margin-top: auto;
    background-color: #f5f6fa;
    text-align: center;
    font-size: 0.9rem;
    color: #636e72;
    border-top: 1px solid #dfe6e9;
}

.site-footer a {
    color: #6c5ce7;
    text-decoration: none;
    font-weight: 500;
}

.site-footer a:hover {
    text-decoration: underline;
}

.site-footer p {
    margin: 5px 0;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .container {
        height: calc(100vh - 80px);
        /* Leave space for footer on mobile */
        min-height: auto;
        border-radius: 0;
        margin: 0;
    }

    body {
        justify-content: flex-start;
    }
}