/* Serenzer Conversation Styles - Design Moderne */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --surface: #ffffff;
    --background: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --radius: 16px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text-primary);
}

.container {
    display: flex;
    height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 12px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conversation-item {
    padding: 12px 16px;
    margin: 4px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.conversation-item:hover {
    background: var(--background);
}

.conversation-item.active {
    background: var(--primary);
    color: white;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface);
}

.chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.mode-toggle {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.mode-toggle:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

.mode-toggle svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Messages */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.msg {
    display: flex;
    gap: 12px;
    max-width: 70%;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg.assistant {
    align-self: flex-start;
}

.coach-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.msg-content {
    padding: 12px 18px;
    border-radius: var(--radius);
    line-height: 1.5;
    word-wrap: break-word;
}

.msg.user .msg-content {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.msg.assistant .msg-content {
    background: #f1f5f9;
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

/* Loader */
.loader {
    display: none;
    padding: 16px 24px;
}

.loader.active {
    display: block;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 18px;
    background: #f1f5f9;
    border-radius: var(--radius);
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* Input Area */
.input-area {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    background: var(--surface);
}

#messageInput {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

#messageInput:focus {
    border-color: var(--primary);
}

.send-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-light);
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Modal Vocal */
.vocal-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.vocal-modal.active {
    display: flex;
}

.vocal-content {
    background: var(--surface);
    border-radius: 24px;
    padding: 48px;
    text-align: center;
    position: relative;
    max-width: 400px;
    width: 90%;
}

.close-vocal {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.avatar-large {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    border-radius: 50%;
    overflow: hidden;
}

.avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vocal-status {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.vocal-btn {
    padding: 16px 32px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 24px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 auto;
    transition: all 0.3s;
}

.vocal-btn:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}

.vocal-btn.recording {
    background: #ef4444;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 200px;
    }
    
    .msg {
        max-width: 85%;
    }
    
    .chat-header h1 {
        font-size: 20px;
    }
}
