:root {
    --primary: #2563eb;
    --bg: #f3f4f6;
    --card: #ffffff;
    --text: #1f2937;
    --border: #e5e7eb;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hidden { display: none !important; }

/* Login */
.login-box {
    padding: 40px;
    text-align: center;
    margin: auto;
}

.login-box h2 { margin-bottom: 10px; color: var(--primary); }
.login-box input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.error { color: #ef4444; font-size: 0.9rem; margin-top: 10px; }

/* Chat Header */
header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.header-info h1 { font-size: 1.2rem; }
.status { font-size: 0.8rem; color: #10b981; }

.logout-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.2rem;
}

/* Chat Messages */
.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f9fafb;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
}

.message.assistant {
    align-self: flex-start;
    background: white;
    border: 1px solid var(--border);
}

.message.system {
    align-self: center;
    background: #e5e7eb;
    font-size: 0.85rem;
    color: #4b5563;
    text-align: center;
}

/* Status Bar */
.status-bar {
    padding: 10px 20px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.9rem;
    border-top: 1px solid #fde68a;
}

/* Input Area */
.input-area {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid var(--border);
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    color: #6b7280;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
}

textarea {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 10px 15px;
    resize: none;
    outline: none;
    max-height: 150px;
}

#send-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-area {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.remove-file {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.7rem;
}

.download-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #10b981;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
}
