/* TURN Configuration Dialog */
.turn-config-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    visibility: visible !important;
    opacity: 1 !important;
}

.turn-config-dialog {
    background: rgba(40, 40, 45, 0.95);
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: max-width 0.3s ease;
}

.turn-config-dialog.expanded {
    max-width: 800px;
}

.turn-config-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.turn-config-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.turn-config-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.turn-config-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.turn-config-content {
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.turn-config-fields {
    flex: 1;
    min-width: 300px;
}

.turn-config-field {
    margin-bottom: 20px;
}

.turn-config-field:last-child {
    margin-bottom: 0;
}

.turn-config-field label {
    display: block;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.turn-config-field input[type="text"],
.turn-config-field input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    padding-right: 48px;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.7);
}

.password-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.password-toggle-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* 保存配置行样式 */
.turn-config-save-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.turn-config-save-row .turn-config-checkbox {
    flex: 1;
}

/* 测试按钮样式 */
.turn-config-test {
    background-color: #007bff;
    color: white;
    padding: 8px 16px;
    font-size: 14px;
    min-width: 100px;
    white-space: nowrap;
}

.turn-config-test:hover {
    background-color: #0056b3;
}

.turn-config-test:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 测试结果区域样式 */
.turn-config-test-results {
    flex: 1;
    min-width: 300px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow-y: auto;
    margin-left: 0;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
    width: 0;
    min-width: 0;
    padding: 0;
    border: none;
    overflow: hidden;
    align-self: stretch;
}

.turn-config-test-results.visible {
    opacity: 1;
    transform: translateX(0);
    width: auto;
    min-width: 300px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 400px;
    overflow-y: auto;
    background: rgba(30, 30, 35, 0.95);
}

.turn-config-test-results h4 {
    margin: 0 0 10px 0;
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.test-results-content {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.9);
}

.test-result-item {
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    background-color: rgba(50, 50, 55, 0.8);
    border-left: 4px solid #28a745;
    color: rgba(255, 255, 255, 0.9);
}

.test-result-item.error {
    border-left-color: #dc3545;
    background-color: rgba(40, 40, 45, 0.8);
    color: #ffb3b3;
}

.test-result-item.warning {
    border-left-color: #ffc107;
    background-color: rgba(40, 40, 45, 0.8);
    color: #ffe066;
}

.test-result-item.info {
    border-left-color: #17a2b8;
    background-color: rgba(40, 40, 45, 0.8);
    color: #87ceeb;
}

.test-result-timestamp {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    margin-right: 8px;
}

.test-result-message {
    color: rgba(255, 255, 255, 0.9);
}

.turn-config-field input[type="text"]:focus,
.turn-config-field input[type="password"]:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.6);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.turn-config-field input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.turn-config-checkbox {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.turn-config-checkbox input[type="checkbox"] {
    display: none;
}

.turn-config-checkbox .checkmark {
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s ease;
}

.turn-config-checkbox input[type="checkbox"]:checked+.checkmark {
    background: rgba(59, 130, 246, 0.8);
    border-color: rgba(59, 130, 246, 1);
}

.turn-config-checkbox input[type="checkbox"]:checked+.checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.turn-config-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.turn-config-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.turn-config-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.turn-config-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.turn-config-save {
    background: rgba(59, 130, 246, 0.8);
    color: white;
    border: 1px solid rgba(59, 130, 246, 1);
}

.turn-config-save:hover {
    background: rgba(59, 130, 246, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .video-control-bar {
        width: 95%;
        padding: 10px;
    }

    .control-btn {
        width: 36px;
        height: 36px;
    }

    .control-group {
        gap: 4px;
    }

    .control-divider {
        margin: 0 4px;
    }

    .turn-config-dialog {
        width: 95%;
        margin: 20px;
    }

    .turn-config-header,
    .turn-config-content,
    .turn-config-footer {
        padding: 16px 20px;
    }

    .turn-config-footer {
        flex-direction: column;
    }

    .turn-config-btn {
        width: 100%;
    }
}