/* P2P Video Chat Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: white;
    min-height: 100vh;
}

/* Header */
.header {
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.room-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.room-key {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-family: monospace;
    font-size: 0.9rem;
}

.participant-count {
    font-size: 0.9rem;
    opacity: 0.8;
}

.controls {
    display: flex;
    gap: 0.5rem;
}

.btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.primary {
    background: #ff6b6b;
    border-color: #ff6b6b;
}

.btn.primary:hover {
    background: #ee5a24;
}

.btn.danger {
    background: #ff4757;
    border-color: #ff4757;
}

.btn.danger:hover {
    background: #ff3838;
}

/* Videos */
.videos-container {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    align-content: flex-start;
}

.video-container {
    flex: 1;
    min-width: 300px;
    min-height: 225px;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    background: #2a2a2a;
    transition: all 0.3s ease;
    border: none;
}

.video-container.main {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-width: auto;
    min-height: auto;
    border: none;
}

.video-container.half {
    flex: 1;
    min-height: 300px;
}

.video-container.thumbnail {
    flex: 0 0 calc(50% - 0.25rem);
    min-height: 200px;
}

.video-container.thumbnail.overlay {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 200px;
    height: 150px;
    min-width: auto;
    min-height: auto;
    z-index: 10;
    border: none;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.video-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    backdrop-filter: blur(4px);
}

.video-container.main .video-label {
    bottom: 12px;
    left: 12px;
    font-size: 0.9rem;
}

/* Status */
.status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

.status.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
    }

    .room-info {
        flex-direction: column;
        text-align: center;
    }

    .controls {
        width: 100%;
        justify-content: center;
    }

    .video-container.thumbnail {
        flex: 0 0 calc(50% - 0.25rem);
        min-height: 150px;
    }
}

/* Animations */
.video-container {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Quality indicators */
.quality-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: bold;
}

.quality-indicator.high {
    background: #4ade80;
    color: white;
}

.quality-indicator.medium {
    background: #fbbf24;
    color: black;
}

.quality-indicator.low {
    background: #ef4444;
    color: white;
}