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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
}

.screen {
    display: none;
    width: 100%;
    height: 100vh;
    position: relative;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Onboarding Screen */
.onboarding-container {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    margin: auto;
}

.onboarding-container h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.onboarding-container p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.btn {
    padding: 12px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.permission-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.permission-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.permission-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Video Room Screen */
#video-room-screen {
    background: #000;
    padding: 0;
    position: relative;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Remote video - fullscreen */
.remote-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Local video - picture in picture */
.local-video {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 120px;
    height: 160px;
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    aspect-ratio: 3 / 4;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.video-participant {
    position: relative;
    overflow: hidden;
}

.video-participant video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Remote video specific styles */
.remote-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

/* Local video specific styles */
.local-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 1;
}

.local-video .video-placeholder {
    font-size: 0.75rem;
    padding: 0.5rem;
    text-align: center;
}

.video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #888;
    font-size: 1rem;
}

.video-participant .participant-name {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    z-index: 10;
}

.video-participant.muted .participant-name::after {
    content: " 🔇";
}

/* Controls */
.controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.3) 70%, transparent 100%);
    z-index: 20;
}

.control-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #4a4a4a;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.control-btn:hover {
    transform: scale(1.1);
    background: #5a5a5a;
}

.control-btn.active {
    background: #667eea;
}

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

.control-btn svg {
    width: 24px;
    height: 24px;
}

/* Connection Status */
.connection-status {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    z-index: 100;
}

.connection-status.connecting {
    background: #ffc107;
    color: #000;
}

.connection-status.connected {
    background: #28a745;
    color: white;
}

.connection-status.disconnected {
    background: #dc3545;
    color: white;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .onboarding-container {
        padding: 1.5rem;
    }

    .onboarding-container h1 {
        font-size: 1.5rem;
    }

    .local-video {
        width: 90px;
        height: 120px;
        top: 0.5rem;
        right: 0.5rem;
        border-radius: 6px;
        border-width: 1.5px;
    }

    .controls {
        padding: 1rem;
        gap: 0.75rem;
    }

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

    .control-btn svg {
        width: 20px;
        height: 20px;
    }
}

