#lfvc-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Form Panel */
#lfvc-form-panel {
    max-width: 100%;
    margin: 0 auto;
    padding: 24px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

#lfvc-form-panel h3 {
    margin: 0 0 16px;
    font-size: 20px;
}

.lfvc-field {
    margin-bottom: 16px;
}

.lfvc-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
}

.lfvc-field input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

/* Buttons */
.lfvc-btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f7f7f7;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.lfvc-btn:hover {
    background: #e9e9e9;
}

.lfvc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.lfvc-btn .lfvc-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: #333;
    border-radius: 50%;
    animation: lfvc-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

.lfvc-btn-primary .lfvc-spinner,
.lfvc-btn-danger .lfvc-spinner {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

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

.lfvc-btn-primary {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.lfvc-btn-primary:hover {
    background: #005a87;
}

.lfvc-btn-danger {
    background: #d63638;
    color: #fff;
    border-color: #d63638;
}

.lfvc-btn-danger:hover {
    background: #b32d2e;
}

/* Pre-join toggles */
.lfvc-preflight {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.lfvc-preflight label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
}

/* Error */
.lfvc-error {
    margin-top: 12px;
    padding: 10px 14px;
    background: #fef0f0;
    border: 1px solid #f5c6c6;
    border-radius: 4px;
    color: #d63638;
    font-size: 14px;
}

/* Chat Panel */
#lfvc-chat-panel {
    padding: 16px;
}

/* Timer bar */
.lfvc-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

#lfvc-timer-text {
    flex: 1;
    text-align: center;
}

#lfvc-timer-copy {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 400;
    min-height: 32px;
    white-space: nowrap;
}

/* Ad slots */
.lfvc-ad-slot {
    margin: 12px 0;
    text-align: center;
    min-height: 50px;
}

/* ===== Dish Video Grid ===== */
#lfvc-videos {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: calc(100vh - 190px);
    margin-bottom: 0;
    background: #111;
    border-radius: 10px;
    overflow: hidden;
}

/* Video box (camera tile) */
.lfvc-video-box {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    animation: lfvc-show 0.4s ease;
    /* Dimensions set by JS dish algorithm via inline styles */
}

@keyframes lfvc-show {
    0% {
        opacity: 0;
        transform: scale(0.4) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.lfvc-video-box video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.lfvc-video-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
    z-index: 2;
}

/* Spotlight button — visible on hover (desktop) and always on touch */
.lfvc-spotlight-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s;
}

.lfvc-video-box:hover .lfvc-spotlight-btn {
    opacity: 1;
}

.lfvc-spotlight-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Active spotlight indicator */
.lfvc-video-box.lfvc-spotlighted .lfvc-spotlight-btn {
    opacity: 1;
    background: #0073aa;
}

/* Touch devices: always show spotlight button + controls */
@media (hover: none) and (pointer: coarse) {
    .lfvc-spotlight-btn {
        opacity: 0.8;
        padding: 8px 14px;
        font-size: 12px;
    }

    #lfvc-controls {
        opacity: 0.6;
    }
}

#lfvc-remote-container {
    display: contents;
}

/* ===== PIP local camera overlay ===== */
.lfvc-video-box.lfvc-pip {
    position: absolute !important;
    bottom: 70px;
    right: 16px;
    width: 160px !important;
    height: 120px !important;
    margin: 0 !important;
    z-index: 10;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    cursor: grab;
    transition: none;
    animation: none;
}

.lfvc-video-box.lfvc-pip .lfvc-spotlight-btn {
    display: none;
}

.lfvc-video-box.lfvc-pip .lfvc-video-label {
    font-size: 10px;
    padding: 1px 6px;
    bottom: 4px;
    left: 4px;
}

/* ===== Spotlight layout ===== */
.lfvc-video-box.lfvc-spotlighted {
    border: 2px solid #0073aa;
}

/* ===== Pagination controls ===== */
#lfvc-pagination {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    margin-bottom: 8px;
}

#lfvc-pagination.lfvc-visible {
    display: flex;
}

#lfvc-pagination button {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f7f7f7;
    color: #333;
    font-size: 14px;
    cursor: pointer;
}

#lfvc-pagination button:hover {
    background: #e9e9e9;
}

#lfvc-pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#lfvc-page-info {
    font-size: 14px;
    color: #666;
}

/* Controls — absolute overlay at bottom of video grid */
#lfvc-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    z-index: 20;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

#lfvc-controls:hover {
    opacity: 1;
}

#lfvc-controls .lfvc-btn {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-size: 14px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
}

#lfvc-controls .lfvc-btn:hover {
    background: rgba(255,255,255,0.3);
}

#lfvc-controls .lfvc-btn-danger {
    background: rgba(214,54,56,0.8);
    border-color: rgba(214,54,56,0.9);
    color: #fff;
}

#lfvc-controls .lfvc-btn-danger:hover {
    background: rgba(214,54,56,1);
}

/* Responsive — Tablet */
@media (max-width: 768px) {
    #lfvc-form-panel {
        padding: 16px;
    }

    #lfvc-chat-panel {
        padding: 8px;
    }

    #lfvc-videos {
        height: calc(100vh - 160px);
    }

    .lfvc-video-box.lfvc-pip {
        width: 120px !important;
        height: 90px !important;
        bottom: 60px;
        right: 10px;
    }

    .lfvc-timer {
        font-size: 14px;
        padding: 6px;
        margin-bottom: 8px;
    }
}

/* Responsive — Mobile */
@media (max-width: 480px) {
    #lfvc-form-panel {
        padding: 12px;
        border-radius: 6px;
    }

    /* Prevent iOS auto-zoom on input focus */
    .lfvc-field input[type="text"] {
        font-size: 16px;
    }

    #lfvc-videos {
        height: calc(100vh - 140px);
    }

    .lfvc-video-box.lfvc-pip {
        width: 100px !important;
        height: 75px !important;
        bottom: 56px;
        right: 8px;
    }

    #lfvc-controls {
        gap: 8px;
    }

    #lfvc-controls .lfvc-btn {
        flex: 1 1 auto;
        padding: 10px 12px;
        font-size: 13px;
    }

    .lfvc-preflight {
        flex-direction: column;
        gap: 10px;
    }
}

/* Responsive — Extra small (320px) */
@media (max-width: 360px) {
    #lfvc-form-panel {
        padding: 10px;
    }

    #lfvc-form-panel h3 {
        font-size: 17px;
    }

    .lfvc-field label {
        font-size: 13px;
    }

    .lfvc-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    #lfvc-chat-panel {
        padding: 4px;
    }

    .lfvc-timer {
        font-size: 12px;
        padding: 4px 6px;
        gap: 6px;
    }

    #lfvc-timer-copy {
        padding: 3px 8px;
        font-size: 11px;
        min-height: 28px;
    }

    #lfvc-videos {
        height: calc(100vh - 120px);
        border-radius: 6px;
    }

    .lfvc-video-box.lfvc-pip {
        width: 80px !important;
        height: 60px !important;
        bottom: 50px;
        right: 6px;
    }

    .lfvc-video-box.lfvc-pip .lfvc-video-label {
        font-size: 8px;
        padding: 1px 4px;
    }

    .lfvc-video-label {
        font-size: 10px;
        padding: 1px 5px;
    }

    #lfvc-controls {
        padding: 8px 6px;
        gap: 4px;
    }

    #lfvc-controls .lfvc-btn {
        padding: 8px 8px;
        font-size: 11px;
        min-height: 38px;
        min-width: 38px;
    }

    #lfvc-pagination button {
        min-height: 38px;
        min-width: 38px;
        padding: 6px 10px;
        font-size: 12px;
    }

    #lfvc-page-info {
        font-size: 12px;
    }

    .lfvc-ad-slot {
        margin: 8px 0;
    }
}
