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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    padding: clamp(8px, 2vw, 20px);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

h1 {
    margin-bottom: clamp(15px, 3vw, 20px);
    font-size: clamp(18px, 4vw, 24px);
}

.controls {
    background: #2a2a2a;
    padding: clamp(12px, 3vw, 20px);
    border-radius: 8px;
    margin-bottom: 20px;
}

.controls h3,
.metrics h3,
.transcriptions h3 {
    margin: 0 0 clamp(10px, 2vw, 15px) 0;
    font-size: clamp(14px, 3vw, 16px);
    color: #fff;
}

.dispatch-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #1a1a1a;
    border-radius: 4px;
    margin-top: 15px;
}

.dispatch-info {
    color: #fff;
    font-size: 14px;
}

.dispatch-item button {
    padding: 5px 10px;
    font-size: 12px;
}

.control-group {
    margin-bottom: 15px;
}

.control-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #aaa;
}

input {
    width: 100%;
    padding: clamp(10px, 2vw, 12px);
    border: 1px solid #444;
    border-radius: 4px;
    background: #1a1a1a;
    color: #fff;
    font-size: clamp(14px, 2.5vw, 16px);
    min-height: 44px;
}

.display-value {
    width: 100%;
    padding: clamp(10px, 2vw, 12px);
    border: 1px solid #444;
    border-radius: 4px;
    background: #2a2a2a;
    color: #aaa;
    font-size: clamp(14px, 2.5vw, 16px);
    font-family: monospace;
    user-select: text;
    min-height: 44px;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

button {
    padding: clamp(10px, 2vw, 12px) clamp(16px, 3vw, 20px);
    border: none;
    border-radius: 4px;
    font-size: clamp(14px, 2.5vw, 16px);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

button.primary {
    background: #4CAF50;
    color: white;
}

button.primary:hover {
    background: #45a049;
}

button.primary:disabled {
    background: #666;
    cursor: not-allowed;
}

button.danger {
    background: #f44336;
    color: white;
}

button.danger:hover {
    background: #da190b;
}

button.secondary {
    background: #2196F3;
    color: white;
}

button.secondary:hover {
    background: #0b7dda;
}

.metrics {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

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

.metric {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.metric-label {
    color: #aaa;
    font-size: 12px;
}

.metric-value {
    font-size: 18px;
    font-weight: 600;
    color: #4CAF50;
}

.participants {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr));
    gap: 20px;
}

.participant {
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.participant video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
    min-height: 300px;
}

.participant-info {
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.participant-name {
    font-weight: 500;
}

.logs {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
}

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

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

.log-time {
    color: #888;
}

.log-message {
    color: #fff;
}

.transcriptions {
    background: #2a2a2a;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.transcriptions-content {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.transcription-entry {
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    max-width: 75%;
    word-wrap: break-word;
}

.transcription-entry.user {
    align-self: flex-end;
    background: #2196F3;
}

.transcription-entry.other {
    align-self: flex-start;
    background: #3a3a3a;
}

.transcription-entry.interim {
    opacity: 0.6;
    font-style: italic;
}

.transcription-entry.user .transcription-speaker {
    color: #e3f2fd;
}

.transcription-entry.other .transcription-speaker {
    color: #4CAF50;
}

.transcription-speaker {
    font-weight: 600;
    font-size: 12px;
    display: block;
    margin-bottom: 2px;
}

select {
    width: 100%;
    padding: clamp(10px, 2vw, 12px);
    border: 1px solid #444;
    border-radius: 4px;
    background: #1a1a1a;
    color: #fff;
    font-size: clamp(14px, 2.5vw, 16px);
    cursor: pointer;
    min-height: 44px;
}

.latency-display {
    margin-top: 10px;
    padding: 10px;
    background: #3a3a3a;
    border-radius: 4px;
    font-size: 14px;
}

.latency-label {
    color: #aaa;
}

.latency-value {
    color: #4CAF50;
    font-weight: 600;
}

/* Video overlay controls */
.video-container {
    position: relative;
    margin-bottom: 20px;
}

.video-controls-overlay {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    border-radius: 30px;
    z-index: 10;
}

.overlay-btn {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.overlay-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.overlay-btn.muted {
    background: rgba(244, 67, 54, 0.4);
    border-color: rgba(244, 67, 54, 0.6);
}

/* Mobile: stack buttons vertically */
@media (max-width: 768px) {
    .button-group {
        flex-direction: column;
    }

    .button-group button {
        width: 100%;
    }
}
