/* Reset und Basis-Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: left;
    margin-bottom: 20px;
}

.header-logo {
    height: 60px;
    max-width: 300px;
    object-fit: contain;
    object-position: left center;
}

/* Fallback für alten H1-Text (falls verwendet) */
header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 300;
    margin: 0;
}

/* Controls Panel */
.controls-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.client-panel {
    max-width: 500px;
    margin: 0 auto;
}

.section {
    background: white;
    padding: 25px;
    border-radius: 3px;
}

.section h3 {
    margin-bottom: 8px;
    color: #34495e;
    font-size: 1.2rem;
    font-weight: 400;
}

/* Slider-Styles */
.slider-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.slider-group label {
    min-width: 80px;
    font-weight: 500;
}

.slider-group input[type="range"] {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #6c757d;
    border-radius: 3px;
    cursor: pointer;
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #6c757d;
    border-radius: 3px;
    cursor: pointer;
    border: none;
}

.slider-group span {
    min-width: 50px;
    font-weight: 600;
    color: #DEE2E6;
}

/* Checkbox-Styles */
.checkbox-group {
    margin-bottom: 15px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6c757d;
}

/* Select/Dropdown-Styles */
.slider-group select {
    flex: 1;
    padding: 8px 30px 8px 12px;
    border: none;
    border-radius: 3px;
    background: #4a4a4a;
    font-size: 0.9rem;
    font-weight: 500;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e0e0e0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}

.slider-group select:hover {
    background: #5a5a5a;
}

.slider-group select:focus {
    outline: none;
    background: #5a5a5a;
    box-shadow: none;
}

.slider-group select option {
    padding: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    background: #4a4a4a;
    color: #e0e0e0;
}

/* Audio-Qualitäts-Slider initial ausblenden */
#audio-quality-group {
    transition: all 0.3s ease;
}

#mic-quality-group {
    transition: all 0.3s ease;
}

/* Button-Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 3px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn.primary {
    background-color: #6c757d;
    color: white;
}

.btn.primary:hover:not(:disabled) {
    background-color: #5a6268;
}

.btn.secondary {
    background-color: #e9ecef;
    color: #495057;
}

.btn.secondary:hover:not(:disabled) {
    background-color: #dee2e6;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Copy-Button Styling */
#desktop-link-btn,
#mobile-link-btn {
    background: #4a4a4a !important;
    color: #e0e0e0 !important;
    border: none !important;
}

#desktop-link-btn:hover,
#mobile-link-btn:hover {
    background: #5a5a5a !important;
    color: #e0e0e0 !important;
}

/* Input-Styles */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: #6c757d;
}

/* Session-Info */
.session-info {
    text-align: center;
}

.session-id {
    margin-bottom: 20px;
}

.session-id input {
    background-color: #f8f9fa;
    font-family: monospace;
    font-size: 1.2rem;
    text-align: center;
    font-weight: bold;
}

.qr-code {
    margin-bottom: 20px;
}

.qr-code canvas {
    border: 1px solid #dee2e6;
    border-radius: 3px;
}

.mobile-link a {
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
}

.mobile-link a:hover {
    text-decoration: underline;
}

/* Video-Styles */
.video-section {
    background: #2D2D2D;
    padding: 25px;
    border-radius: 3px;
    text-align: center;
}

/* Lokales Video (nur auf Server-Seite) */
#local-video {
    width: 100%;
    height: 400px;
    border-radius: 3px;
    background: #000;
    object-fit: contain;
}

/* Remote Video (Client-Seite) - proportional */
#remote-video {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    border-radius: 3px;
    background: #000;
    object-fit: contain;
}

.video-status {
    margin-top: 15px;
    font-weight: 500;
    color: #DEE2E6;
}

.connection-status {
    margin: 20px 0;
    padding: 15px;
    background: #e9ecef;
    border-radius: 3px;
    text-align: center;
    font-weight: 500;
}

.remote-frame {
    position: relative;
    background: #000;
    border-radius: 3px;
    overflow: hidden;
    width: 100%;
}

.video-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    opacity: 0.8;
}

.video-controls:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .controls-panel {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .video-section {
        grid-column: span 2;
    }
    
    /* Nur lokales Video anpassen, Remote Video bleibt proportional */
    #local-video {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .controls-panel {
        grid-template-columns: 1fr;
    }
    
    .video-section {
        grid-column: span 1;
    }
    
    .section {
        padding: 20px;
    }
    
    .slider-group {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .slider-group label {
        min-width: auto;
    }
    
    .btn {
        width: 100%;
        margin-right: 0;
    }
    
    /* Nur lokales Video anpassen */
    #local-video {
        height: 250px;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

/* Theme Toggle Switch */
.theme-toggle-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.theme-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.theme-toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .theme-toggle-slider {
    background-color: #4073FF;
}

input:focus + .theme-toggle-slider {
    box-shadow: 0 0 1px #4073FF;
}

input:checked + .theme-toggle-slider:before {
    transform: translateX(26px);
}

header {
    position: relative;
}

/* Light Theme (Standard) */
.light-theme {
    background-color: #f8f9fa;
    color: #333;
    transition: all 0.3s ease;
}

.light-theme .section {
    background: white;
    color: #333;
}

.light-theme .section h3 {
    color: #34495e;
}

.light-theme .theme-toggle-slider {
    background-color: #ccc;
}

.light-theme input:checked + .theme-toggle-slider {
    background-color: #4073FF;
}

.light-theme .video-section {
    background: white;
}

.light-theme .video-status {
    color: #333;
}

.light-theme .input-group input[type="text"] {
    background: white;
    border-color: #dee2e6;
    color: #333;
}

.light-theme .connection-status {
    background: #e9ecef;
    color: #333;
}

.light-theme .session-id input {
    background-color: #f8f9fa;
    color: #007bff;
}

.light-theme .slider-group select {
    background-color: #4a4a4a;
    color: #e0e0e0;
}

.light-theme .slider-group span {
    color: #6c757d;
}

.light-theme .checkbox-group label {
    color: #333;
}

.light-theme .slider-group label {
    color: #333;
}

.light-theme .qr-code canvas {
    border: 1px solid #dee2e6;
}

/* Dark Theme */
.dark-theme {
    background-color: #1a1a1a;
    color: #e0e0e0;
    transition: all 0.3s ease;
}

.dark-theme .section {
    background: #2d2d2d;
    color: #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.dark-theme .section h3 {
    color: #e0e0e0;
}

.dark-theme .theme-toggle-slider {
    background-color: #555;
}

.dark-theme input:checked + .theme-toggle-slider {
    background-color: #4073FF;
}

.dark-theme .video-section {
    background: #2D2D2D;
}

.dark-theme .video-status {
    color: #DEE2E6;
}

.dark-theme .input-group input[type="text"] {
    background: #3d3d3d;
    border-color: #555;
    color: #e0e0e0;
}

.dark-theme .connection-status {
    background: #3d3d3d;
    color: #e0e0e0;
}

.dark-theme .session-id input {
    background-color: #3d3d3d;
    color: #e0e0e0;
}

.dark-theme .slider-group select {
    background-color: #3d3d3d;
    color: #e0e0e0;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e0e0e0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
}

.dark-theme .slider-group select:hover {
    background-color: #4a4a4a;
}

.dark-theme .slider-group select:focus {
    background-color: #4a4a4a;
}

.dark-theme .slider-group select option {
    background-color: #3d3d3d;
    color: #e0e0e0;
}

.dark-theme .slider-group span {
    color: #e0e0e0;
}

.dark-theme .checkbox-group label {
    color: #e0e0e0;
}

.dark-theme .slider-group label {
    color: #e0e0e0;
}

.dark-theme .qr-code canvas {
    border: 1px solid #555;
}

.dark-theme .slider-group input[type="range"] {
    background: #3d3d3d;
}

.dark-theme .slider-group input[type="range"]::-webkit-slider-thumb {
    background: #e0e0e0;
}

.dark-theme .slider-group input[type="range"]::-moz-range-thumb {
    background: #e0e0e0;
}

.dark-theme .mobile-link a {
    color: #e0e0e0;
}

/* Dark Mode Support für System-Präferenz (Fallback) */
@media (prefers-color-scheme: dark) {
    body:not(.light-theme):not(.dark-theme) {
        background-color: #1a1a1a;
        color: #e0e0e0;
    }
    
    body:not(.light-theme):not(.dark-theme) .section {
        background: #2d2d2d;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }
    
    body:not(.light-theme):not(.dark-theme) .section h3 {
        color: #e0e0e0;
    }
} 