* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

/* Login View */
.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

#loginForm {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input[type="text"],
input[type="password"],
#customScenario {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

button {
    padding: 0.75rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #2980b9;
}

.hint {
    text-align: center;
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
}

/* Chat View */
.chat-container {
    background: white;
    width: 90%;
    max-width: 800px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chat-header {
    padding: 1rem;
    background: #2c3e50;
    color: white;
    border-radius: 8px 8px 0 0;
}

.chat-header h2 {
    font-size: 1.25rem;
}

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

#scenarioSelect {
    flex: 1;
    padding: 0.5rem;
    border-radius: 4px;
    border: none;
}

#logoutBtn {
    background: #e74c3c;
    padding: 0.5rem 1rem;
}

#logoutBtn:hover {
    background: #c0392b;
}

#customScenarioInput {
    padding: 1rem;
    background: #f8f9fa;
    display: flex;
    gap: 0.5rem;
}

#customScenario {
    flex: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f9f9f9;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    background: white;
}

.message.system {
    background: #e8f4f8;
    color: #2c3e50;
}

.message.you {
    background: #e3f2fd;
    margin-left: 20%;
}

.message.ai {
    background: #f5f5f5;
    margin-right: 20%;
}

.correction {
    background: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
    border-bottom: 2px solid #ffc107;
    cursor: help;
}

.chat-input {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-top: 1px solid #eee;
}

#messageInput {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.voice-btn {
    background: #27ae60;
    width: 50px;
    font-size: 1.25rem;
}

.voice-btn:hover {
    background: #229954;
}

.voice-controls {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    text-align: center;
}

.voice-controls label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .chat-container {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .chat-header {
        border-radius: 0;
    }
    
    .message.you,
    .message.ai {
        margin: 0;
    }
}