@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600&display=swap');

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

body {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    background-color: #000000;
    background-image: radial-gradient(circle at 50% 0%, #1a1a1f 0%, #000000 70%);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    color: #ffffff;
    -webkit-font-smoothing: antialiased;
}

.view {
    display: none;
    height: 100%;
    width: 100%;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 24px;
}

.view.active {
    display: flex;
}

/* Dark Mode Card */
.card {
    background: rgba(28, 28, 30, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    padding: 48px 32px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.icon-container {
    color: #ffffff;
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

h1 { font-size: 2.2rem; margin-bottom: 32px; letter-spacing: -0.5px; }
h2 { font-size: 1.75rem; margin-bottom: 8px; }

/* Dividers & Groups */
.divider {
    margin: 24px 0;
    text-align: center;
    position: relative;
}
.divider::before {
    content: "";
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}
.divider span {
    background: transparent;
    padding: 0 16px;
    color: #8e8e93;
    font-size: 0.85rem;
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #151517; /* Matches frosted glass tint to cut line */
    border-radius: 12px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* Premium Buttons */
.button-row {
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: 100%;
}

.btn {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 18px 24px;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn:active { transform: scale(0.97); }

.btn.primary {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.1);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn.danger { 
    background: rgba(255, 69, 58, 0.2); 
    color: #ff453a; 
    border: 1px solid rgba(255, 69, 58, 0.3);
}

#rotateBtn {
    flex: 0 0 auto;
    padding: 0 20px;
}

/* Dark PIN Input */
input[type="number"] {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 3rem;
    text-align: center;
    width: 100%;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    outline: none;
    letter-spacing: 24px;
    color: #ffffff;
    transition: all 0.2s ease;
}

input[type="number"]:focus {
    border-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Fullscreen Video & Glass Panels */
.video-wrapper {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

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

/* Rotation and Fit Logic */
#remoteStream {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    background: #000;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: center center;
}

#remoteStream.sideways {
    width: 100vh;
    height: 100vw;
    flex-shrink: 0;
}

#remoteStream.contain-view {
    object-fit: contain;
}

/* UI Overlays */
.glass-panel {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(28, 28, 30, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 24px 40px;
    color: white;
    text-align: center;
    z-index: 10;
}

.glass-panel.top { top: 48px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.glass-panel.bottom { 
    bottom: 48px; 
    padding: 10px; 
    border-radius: 20px; 
    background: transparent; 
    border: none; 
    backdrop-filter: none; 
    width: 90%; 
    max-width: 500px;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Auto Hide Controls Class */
#viewerControls.faded {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 20px);
}

.glass-panel p { font-size: 0.85rem; color: #8e8e93; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 4px; }
.glass-panel h2 { font-size: 3.5rem; margin: 0; letter-spacing: 12px; color: #ffffff; }

.status-badge {
    margin-top: 12px;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 12px;
    display: inline-block;
}
.status-badge.waiting { background: rgba(255, 159, 10, 0.2); color: #ff9f0a; }
.status-badge.connected { background: rgba(48, 209, 88, 0.2); color: #30d158; }