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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    color: #667eea;
    font-size: 2rem;
    font-weight: 700;
}

/* Main Layout */
main {
    display: flex;
    flex: 1;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Left Side: Controls */
.controls-panel {
    flex: 0 0 400px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.instructions {
    text-align: center;
    color: #4a5568;
    line-height: 1.6;
}

/* Mic Button */
.mic-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.mic-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.mic-button:hover {
    transform: scale(1.05);
}

.mic-button:active {
    transform: scale(0.95);
}

.mic-button.ready {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.mic-button.recording {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
    animation: pulse 1.5s infinite;
}

.mic-button.processing,
.mic-button.playing {
    background: linear-gradient(135deg, #a0aec0, #718096);
    color: white;
    cursor: not-allowed;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 5px 30px rgba(245, 101, 101, 0.6);
    }
}

.mic-icon {
    width: 40px;
    height: 40px;
}

.mic-label {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Mode Controls */
.mode-controls {
    display: flex;
    justify-content: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: #4a5568;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Audio Visualizer */
.audio-visualizer {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
}

.visualizer-bars {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 50px;
}

.bar {
    width: 6px;
    background: linear-gradient(to top, #667eea, #764ba2);
    border-radius: 3px;
    transition: height 0.1s ease;
    height: 10px;
}

.bar.active {
    animation: visualize 0.5s ease-in-out infinite alternate;
}

.bar:nth-child(1) { animation-delay: 0s; }
.bar:nth-child(2) { animation-delay: 0.1s; }
.bar:nth-child(3) { animation-delay: 0.2s; }
.bar:nth-child(4) { animation-delay: 0.3s; }
.bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes visualize {
    from { height: 10px; }
    to { height: 50px; }
}

/* Status Text */
.status-text {
    text-align: center;
    color: #4a5568;
    font-size: 1rem;
    font-weight: 500;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 10px;
}

/* Right Side: Chat */
.chat-panel {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex: 1;
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

/* Chat Bubbles */
.message {
    display: flex;
    margin-bottom: 0.5rem;
    animation: slideIn 0.3s ease;
}

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

.message.user {
    justify-content: flex-end;
}

.message.ai {
    justify-content: flex-start;
}

.bubble {
    max-width: 70%;
    padding: 1rem 1.25rem;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-bubble {
    background: #ccfbf1 !important;
    color: #0f766e !important;
    border-bottom-left-radius: 4px;
}

/* Scrollbar Styling */
.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Design */
@media (max-width: 1024px) {
    main {
        flex-direction: column;
    }
    
    .controls-panel {
        flex: 0 0 auto;
        width: 100%;
    }
}

/* Live Transcript Styling */
.message.live-message {
    animation: none !important;
}

.bubble.live-transcript {
    opacity: 0.7 !important;
}
