:root {
    --bg-gradient: linear-gradient(135deg, #0f172a, #1e293b);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

.app-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    padding: 1rem;
    gap: 1.5rem;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Control Panel */
.control-panel {
    width: 350px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    color: var(--primary);
}

.brand i {
    font-size: 1.8rem;
}

.connection-box h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.id-container {
    display: flex;
    gap: 0.5rem;
}

.id-container input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: monospace;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.id-container input:focus {
    border-color: var(--primary);
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#copy-btn {
    width: 45px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

#copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.primary-btn {
    background: var(--primary);
    color: white;
    padding: 0 1.25rem;
    font-weight: 600;
}

.primary-btn:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.status-text {
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.text-muted { color: var(--text-muted); }
.text-success { color: #22c55e; }
.text-danger { color: #ef4444; }

.actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: auto;
}

.action-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.2rem;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.action-btn.active {
    background: rgba(255, 255, 255, 0.8);
    color: #0f172a;
}

.danger-btn {
    background: var(--danger) !important;
}

.danger-btn:hover {
    background: var(--danger-hover) !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

/* Video Workspace */
.video-workspace {
    flex: 1;
    display: flex;
    gap: 1.5rem;
    position: relative;
}

.video-container {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.local-container {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 300px;
    aspect-ratio: 16/9;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 2px solid var(--glass-border);
}

.remote-container {
    flex: 1;
    width: 100%;
    height: 100%;
}

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

.local-container video {
    transform: scaleX(-1); /* Mirror local video */
}

.video-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.waiting-message {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    z-index: 1;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
    }
    
    .control-panel {
        width: 100%;
        height: auto;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .actions {
        margin-top: 0;
        justify-content: center;
        gap: 1.5rem;
    }
    
    .local-container {
        width: 150px;
        bottom: 1rem;
        right: 1rem;
    }
}
