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

body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
}

#app {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#room-controls {
    display: flex;
    gap: 10px;
}

input[type="text"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

#main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Полноэкранный режим */
body.fullscreen-mode header,
body.fullscreen-mode #chat-container,
body.fullscreen-mode #media-controls {
    display: none !important;
}

body.fullscreen-mode #app {
    padding: 0;
    margin: 0;
    max-width: 100%;
    height: 100vh;
    overflow: hidden;
}

body.fullscreen-mode #main-content {
    gap: 0;
    height: 100%;
}

body.fullscreen-mode #video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    z-index: 9999;
    aspect-ratio: auto;
}

#remote-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    cursor: pointer;
}

#local-video-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 150px;
    aspect-ratio: 16/9;
    background: #333;
    border: 2px solid #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    z-index: 10000;
    transition: transform 0.3s ease;
}

#local-video-container:hover {
    transform: scale(1.05);
}

#local-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#media-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10000;
    background: rgba(0,0,0,0.5);
    padding: 10px 20px;
    border-radius: 20px;
}

#media-controls button {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
}

#media-controls button:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

#chat-container {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 300px;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #fafafa;
}

.message {
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 4px;
    background: #e9ecef;
}

.message.self {
    background: #d4edda;
    text-align: right;
}

#chat-controls {
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    #app {
        padding: 10px;
    }

    header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    #room-controls {
        flex-direction: column;
    }

    #video-container {
        border-radius: 4px;
    }

    #local-video-container {
        width: 100px;
        bottom: 70px;
        right: 10px;
        border-width: 1px;
    }

    #media-controls {
        bottom: 15px;
        gap: 10px;
        padding: 8px 15px;
        width: 90%;
        justify-content: center;
    }

    #media-controls button {
        font-size: 14px;
        padding: 8px 10px;
        flex: 1;
    }

    #chat-container {
        height: 250px;
    }
}
