:root {
    --bg-color: #0d1117;
    --glass-bg: rgba(22, 27, 34, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-color: #238636;
    --text-color: #f0f6fc;
    --danger-color: #da3633;
    --card-bg: #161b22;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.center-content {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.hidden {
    display: none !important;
}

/* Login Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-panel h1 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.glass-panel p {
    color: #8b949e;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.button-group {
    display: flex;
    gap: 10px;
}

.input-group {
    margin-bottom: 1rem;
}

input {
    width: 100%;
    padding: 0.75rem;
    background: #0d1117;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: white;
    font-size: 16px;
    /* Prevent iOS zoom */
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: filter 0.2s;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-secondary {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-color);
}

/* Room Layout */
#room-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.floating-header {
    position: fixed;
    top: max(20px, env(safe-area-inset-top) + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    width: max-content;
    max-width: 90%;
}

.room-label {
    color: #8b949e;
    font-size: 0.9rem;
}

.room-value {
    color: var(--primary-color);
    font-weight: 600;
    font-family: monospace;
    font-size: 1.1rem;
}

#video-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
    overflow-y: auto;
    align-content: center;
    /* Center vertically if few items */
}

/* Video Card */
.video-card {
    position: relative;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    /* Mirror effect */
}

video.no-mirror {
    transform: scaleX(1) !important;
}

.user-tag {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.mirror-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px;
    cursor: pointer;
    z-index: 10;
    font-size: 1.2rem;
    display: flex;
    /* Verify icon centering */
}

.mirror-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Controls Bar */
#controls-bar {
    height: 80px;
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #30363d;
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.control-btn:hover {
    background: #404750;
}

.control-btn.active {
    background: #30363d;
}

/* Muted state styling - visually distinct */
.control-btn.muted {
    background: var(--danger-color);
    color: white;
}

.control-btn.danger {
    background: #5a1e1e;
    color: #ff7b72;
}

.control-btn.danger:hover {
    background: var(--danger-color);
    color: white;
}