* {
    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 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

header h1 {
    font-size: 2.5em;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1em;
}

.status-panel {
    display: flex;
    justify-content: space-around;
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-label {
    font-weight: 600;
    color: #666;
}

.status-value {
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

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

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

.status-value.active {
    background: #2196f3;
    color: white;
}

.status-value.inactive {
    background: #9e9e9e;
    color: white;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-secondary {
    background: #9e9e9e;
    color: white;
}

.transcript-panel {
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.transcript-header {
    background: #667eea;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.transcript-header h2 {
    font-size: 1.5em;
}

.transcript-stats {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
}

.transcript-content {
    padding: 20px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    background: #fafafa;
    font-size: 1.1em;
    line-height: 1.6;
}

.transcript-content .placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 50px 20px;
}

.transcript-item {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

.transcript-item.final {
    border-left-color: #4caf50;
    font-weight: 500;
}

.transcript-item.interim {
    opacity: 0.7;
    font-style: italic;
}

.transcript-item .confidence {
    font-size: 0.8em;
    color: #666;
    margin-top: 5px;
}

.transcript-item .timestamp {
    font-size: 0.75em;
    color: #999;
    margin-top: 5px;
}

.ai-response-panel {
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.ai-response-header {
    background: #9c27b0;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ai-response-header h2 {
    font-size: 1.5em;
}

.ai-response-stats {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
}

.ai-response-content {
    padding: 20px;
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
    background: #fafafa;
    font-size: 1.1em;
    line-height: 1.6;
}

.ai-response-content .placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 50px 20px;
}

.ai-response-item {
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-left: 4px solid #9c27b0;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.ai-response-item.streaming {
    border-left-color: #ff9800;
    background: #fff9e6;
}

.ai-response-item.complete {
    border-left-color: #4caf50;
}

.ai-response-item.error {
    border-left-color: #f44336;
    background: #ffebee;
}

.ai-response-text {
    margin-bottom: 8px;
    color: #333;
}

.ai-response-text.error-text {
    color: #f44336;
}

.ai-response-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 0.8em;
    color: #666;
    margin-top: 8px;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
}

.status-badge.streaming {
    background: #ff9800;
    color: white;
    animation: pulse 1.5s infinite;
}

.status-badge.complete {
    background: #4caf50;
    color: white;
}

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

.chunk-count {
    color: #999;
    font-style: italic;
}

.metrics-panel {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.metrics-panel h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.metric-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-label {
    font-weight: 600;
    color: #666;
}

.metric-value {
    font-size: 1.2em;
    font-weight: 700;
    color: #667eea;
}

.log-panel {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 20px;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.log-panel h3 {
    color: #fff;
    margin-bottom: 15px;
}

.log-content {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.6;
}

.log-entry {
    margin-bottom: 8px;
    padding: 5px;
    border-left: 3px solid transparent;
    padding-left: 10px;
}

.log-entry.info {
    border-left-color: #2196f3;
}

.log-entry.success {
    border-left-color: #4caf50;
}

.log-entry.error {
    border-left-color: #f44336;
}

.log-entry.warning {
    border-left-color: #ff9800;
}

.log-entry .timestamp {
    color: #888;
    margin-right: 10px;
}

/* Scrollbar styling */
.transcript-content::-webkit-scrollbar,
.log-content::-webkit-scrollbar {
    width: 8px;
}

.transcript-content::-webkit-scrollbar-track,
.log-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.transcript-content::-webkit-scrollbar-thumb,
.log-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.transcript-content::-webkit-scrollbar-thumb:hover,
.log-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .status-panel {
        flex-direction: column;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

