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

body {
    font-family: var(--ta-font);
    background: #f8f9fa;
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: #2c3e50;
}

.header {
    /* color and background unified via shared.css (--ta-brand) */
    padding: 20px 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header h1 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
}

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

/* Session menu moved to session.css */

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #27ae60;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status::before {
    content: "●";
    font-size: 12px;
}

.status.disconnected {
    background: #fee;
    color: #e74c3c;
}

.status.connected {
    background: #eafaf1;
    color: #27ae60;
}

.status.connecting {
    background: #fef9e7;
    color: #f39c12;
}

.status.listening {
    background: #e8f4fd;
    color: #003f63;
    /* 003f63; */
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Important for flexbox scrolling */
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    padding: 0 24px;
    min-height: 0; /* Important for flexbox scrolling */
}

/* transcript scrollbars unified in shared.css */

/* message layout unified in shared.css */

/* avatars not used; removed */

/* message bubble unified in shared.css */

/* user message bubble color unified in shared.css using --ta-brand */

/* system bubble unified in shared.css */

/* message text unified in shared.css */

/* message meta unified in shared.css */

/* controls unified in shared.css */

/* voice-controls unified in shared.css */

/* connect button unified in shared.css */

/* text input + send button unified in shared.css */

/* transcript empty state unified in shared.css */

/* audio display unified in shared.css */

/* Responsive design */
@media (max-width: 768px) {
    .header {
        padding: 16px 20px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .chat-container {
        padding: 0 16px;
    }
    
    .transcript {
        padding: 16px 0;
    }
    
    .controls {
        padding: 12px 16px;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    .text-input-container {
        max-width: 100%;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

.transcript {
    scroll-behavior: smooth;
    overflow-anchor: none; /* Prevent scroll anchoring issues */
}

/* Responsive adjustments for session menu */
@media (max-width: 768px) {
    .session-menu {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: calc(100vw - 32px);
        max-width: 320px;
        margin-top: 0;
    }
}

/* Typing animation styles */
.typing-text.typing::after {
    content: '|';
    animation: blink 1s infinite;
    color: var(--ta-brand, #007bff);
    font-weight: bold;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Typing message specific styles */
.message.ai.typing-message .message-bubble {
    background: var(--ta-brand, #007bff);
    color: white;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.message.ai.typing-message .message-bubble:hover {
    opacity: 1;
}
