* {
    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;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 30px;
}

h1 {
    color: #667eea;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2em;
}

h2 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.connection-controls,
.call-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

button:not(:disabled) {
    background: #667eea;
    color: white;
}

button:not(:disabled):hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

.status {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.status.connected {
    background: #4caf50;
    color: white;
}

.status.disconnected {
    background: #f44336;
    color: white;
}

.audio-indicators {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: white;
    border-radius: 8px;
    border: 2px solid #ddd;
    min-width: 180px;
}

.indicator.active {
    border-color: #4caf50;
    background: #e8f5e9;
}

.indicator .icon {
    font-size: 20px;
}

.indicator .text {
    font-weight: 600;
    color: #555;
}

.chat-controls {
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
}

.chat-display {
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-empty {
    color: #999;
    text-align: center;
    padding: 40px;
    font-style: italic;
}

.chat-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    animation: fadeIn 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.chat-bubble.user {
    background: #667eea;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-bubble.agent {
    background: white;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid #e0e0e0;
}

.chat-bubble-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 11px;
    opacity: 0.8;
}

.chat-bubble.user .chat-bubble-header {
    color: rgba(255, 255, 255, 0.9);
}

.chat-bubble.agent .chat-bubble-header {
    color: #666;
}

.chat-bubble-speaker {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chat-bubble-time {
    font-size: 10px;
    margin-left: 8px;
}

.chat-bubble-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-bubble-text {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-bubble-audio {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-bubble.agent .chat-bubble-audio {
    border-top-color: rgba(0, 0, 0, 0.1);
}

.play-audio-btn,
.download-audio-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    font-size: 14px;
}

.chat-bubble.agent .play-audio-btn,
.chat-bubble.agent .download-audio-btn {
    background: #667eea;
    color: white;
}

.chat-bubble.user .play-audio-btn,
.chat-bubble.user .download-audio-btn {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.play-audio-btn:hover,
.download-audio-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
}

.chat-bubble.agent .play-audio-btn:hover,
.chat-bubble.agent .download-audio-btn:hover {
    background: #5568d3;
}

.play-audio-btn.playing {
    background: rgba(255, 255, 255, 0.4);
}

.chat-bubble.agent .play-audio-btn.playing {
    background: #5568d3;
}

.play-icon,
.download-icon {
    display: inline-block;
    margin-left: 2px;
}

.audio-duration {
    font-size: 11px;
    opacity: 0.7;
}

.chat-bubble audio {
    display: none;
}

/* Legacy transcript styles for backward compatibility */
.transcript-display {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
}

.transcript-empty {
    color: #999;
    text-align: center;
    padding: 40px;
    font-style: italic;
}

.transcript-message {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 8px;
    animation: fadeIn 0.3s;
}

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

.transcript-message.agent {
    background: #f5f5f5;
    border-left: 4px solid #757575;
}

.transcript-message-header {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.transcript-message-text {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.transcript-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
}

.logs-controls {
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
}

.logs-display {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.log-entry {
    margin-bottom: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #333;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: #858585;
    margin-right: 10px;
}

.log-level {
    font-weight: 600;
    margin-right: 10px;
}

.log-level.info {
    color: #4ec9b0;
}

.log-level.warn {
    color: #dcdcaa;
}

.log-level.error {
    color: #f48771;
}

.log-level.success {
    color: #4ec9b0;
}

.log-message {
    color: #d4d4d4;
}

/* Scrollbar styling */
.chat-display::-webkit-scrollbar,
.transcript-display::-webkit-scrollbar,
.logs-display::-webkit-scrollbar {
    width: 8px;
}

.chat-display::-webkit-scrollbar-track,
.transcript-display::-webkit-scrollbar-track,
.logs-display::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chat-display::-webkit-scrollbar-thumb,
.transcript-display::-webkit-scrollbar-thumb,
.logs-display::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.chat-display::-webkit-scrollbar-thumb:hover,
.transcript-display::-webkit-scrollbar-thumb:hover,
.logs-display::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.logs-display::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.logs-display::-webkit-scrollbar-thumb {
    background: #555;
}

.logs-display::-webkit-scrollbar-thumb:hover {
    background: #777;
}

