/* Common styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 20px;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    margin: 0;
    color: #333;
}

.logout-btn, .back-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
}

.back-btn {
    background: #6c757d;
}

.logout-btn:hover, .back-btn:hover {
    opacity: 0.9;
}

.empty {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Conversations list styles */
.conversations {
    padding: 20px;
}

.conversation {
    border: 1px solid #ddd;
    border-radius: 6px;
    margin-bottom: 15px;
    padding: 15px;
    background: #fafafa;
    cursor: pointer;
    transition: background-color 0.2s;
}

.conversation:hover {
    background: #f0f0f0;
}

.conv-subject {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.conv-meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
}

.conv-preview {
    font-size: 0.9em;
    color: #555;
}

.bot-message {
    color: #007bff;
    font-weight: 500;
}

/* Conversation detail styles */
.container.conversation-detail {
    max-width: 800px;
}

.header h1 {
    font-size: 1.5em;
}

.messages {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.message {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 8px;
}

.message.user {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.message.bot {
    background: #f1f8e9;
    border-left: 4px solid #4caf50;
}

.message-header {
    font-weight: bold;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-time {
    font-size: 0.8em;
    color: #666;
    font-weight: normal;
}

.message-body {
    white-space: pre-wrap;
    line-height: 1.4;
}

.message.bot .message-body {
    font-family: 'Courier New', monospace;
}

/* Message composition styles */
.compose-section {
    border-top: 1px solid #eee;
    padding: 20px;
    background: #fafafa;
}

.compose-form {
    display: flex;
    gap: 10px;
    flex-direction: column;
}

.compose-textarea {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.compose-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.compose-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

.compose-submit {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.compose-submit:hover {
    background: #0056b3;
}

.compose-submit:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.compose-info {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.sending-indicator {
    display: none;
    color: #007bff;
    font-weight: 500;
}

/* Login page styles */
.login-container {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
    margin-top: 10vh;
}

.login-container h1 {
    color: #333;
    margin-bottom: 20px;
}

.login-container p {
    color: #666;
    line-height: 1.5;
    margin-bottom: 20px;
}

.email-example {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    font-family: monospace;
    margin: 20px 0;
    text-align: left;
}

.login-info {
    margin-top: 30px;
}

.login-info h3 {
    color: #333;
    margin-bottom: 15px;
}

.login-info ul {
    list-style: none;
    padding: 0;
    text-align: left;
}

.login-info li {
    padding: 5px 0;
    color: #666;
}

/* Loading and error states */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    border: 1px solid #f5c6cb;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
    border: 1px solid #c3e6cb;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    .header {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .conversations, .messages {
        padding: 15px;
    }
    
    .compose-section {
        padding: 15px;
    }
    
    .login-container {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}