body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

input {
    width: 200px;
    padding: 12px;
    margin: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

input:focus {
    border-color: #007bff;
}

button {
    padding: 12px 24px;
    margin: 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

button:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button.danger {
    background: #dc3545;
}

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

video {
    width: 320px;
    height: 240px;
    background: #000;
    margin: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.video-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.video-item {
    text-align: center;
}

.video-label {
    margin-top: 8px;
    font-weight: 500;
    color: #333;
}

.controls {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    margin: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.control-btn.disabled {
    background: #dc3545;
}

.status {
    padding: 12px;
    margin: 15px 0;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.connected {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.disconnected {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

#remoteVideos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.room-title {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.preview-section {
    text-align: center;
    margin: 20px 0;
}

.main-video {
    width: 400px;
    height: 300px;
}

/* Модальное окно */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 25px;
}

.screen-sources {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.screen-source {
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.screen-source:hover {
    border-color: #007bff;
    background: #e3f2fd;
    transform: translateY(-2px);
}

.screen-source.selected {
    border-color: #007bff;
    background: #e3f2fd;
}

.screen-source img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #000;
}

.screen-source-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}

.screen-source-type {
    font-size: 12px;
    color: #666;
}

.modal-actions {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.screen-sharing-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

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

    video {
        width: 280px;
        height: 210px;
    }

    .main-video {
        width: 320px;
        height: 240px;
    }

    .video-container {
        justify-content: center;
    }

    .modal-content {
        width: 95%;
        margin: 10px;
    }

    .screen-sources {
        grid-template-columns: 1fr;
    }
}
