:root {
    --bg-color: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --success: #10b981;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background Animated Shapes */
.bg-shape {
    position: absolute;
    filter: blur(100px);
    z-index: -1;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate;
}

.circle-1 {
    width: 400px;
    height: 400px;
    background: rgba(59, 130, 246, 0.4);
    top: -100px;
    left: -100px;
}

.circle-2 {
    width: 300px;
    height: 300px;
    background: rgba(139, 92, 246, 0.4);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 50px) scale(1.1); }
    100% { transform: translate(-50px, 100px) scale(0.9); }
}

.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.stream-container {
    max-width: 800px;
    width: 90vw;
}

.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

h1, h2 {
    font-weight: 800;
    text-align: center;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--accent-color);
}

.role-selection {
    display: flex;
    gap: 12px;
}

.role-selection label {
    flex: 1;
    cursor: pointer;
}

.role-selection input {
    display: none;
}

.role-card {
    display: block;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.9rem;
}

.role-selection input:checked + .role-card {
    background: var(--accent-color);
    border-color: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

button {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

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

#login-error {
    color: var(--danger);
    text-align: center;
    font-size: 0.9rem;
    min-height: 20px;
}

/* Video Wrapper */
.video-wrapper {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16/9;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
}

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

.live-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--danger);
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.stream-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    z-index: 10;
    transition: opacity 0.3s;
}

.stream-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* New Controls */
.controls-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 5px;
}

.control-btn {
    padding: 10px 24px;
    font-size: 0.9rem;
    width: auto;
    border-radius: 8px;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    box-shadow: none;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.video-hidden {
    opacity: 0 !important;
    transition: opacity 0.3s ease;
}

#client-video-wrapper:fullscreen {
    background: #000;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

#client-video-wrapper:fullscreen video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.talk-btn {
    background: #4b5563;
    color: white;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    border: none;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.talk-btn.active {
    background: var(--success);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
}

.danger-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--danger);
    color: var(--text-primary);
}

.danger-btn:hover {
    background: rgba(239, 68, 68, 0.4);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
