/* Dance selection grid */
.dance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: clamp(0.75rem, 2vw, 1.25rem);
    width: 100%;
    max-width: 800px;
}

.dance-grid__loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    opacity: 0.5;
}

.dance-card {
    background: var(--color-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    border: 2px solid transparent;
}

.dance-card:active {
    transform: scale(0.96);
}

.dance-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 20px rgba(255, 45, 120, 0.2);
}

.dance-card__thumb {
    aspect-ratio: 9 / 16;
    width: 100%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
}

.dance-card__info {
    padding: 0.75rem;
}

.dance-card__name {
    font-weight: 600;
    font-size: clamp(0.875rem, 2vw, 1rem);
    margin-bottom: 0.35rem;
}

.dance-card__meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2em 0.6em;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
}

.badge--duration {
    background: rgba(255, 215, 0, 0.2);
    color: var(--color-accent);
}

.badge--easy {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.badge--medium {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.badge--hard {
    background: rgba(231, 76, 60, 0.2);
    color: #e74c3c;
}

.badge--tiktok {
    background: rgba(0, 0, 0, 0.3);
    color: #fe2c55;
}

/* Preview screen */
.preview-video-container {
    width: min(100%, 700px);
    aspect-ratio: 9 / 16;
    max-height: 65vh;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #000;
}

.preview-video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.preview-info {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* Split layout for recording screen */
.screen-video-camera {
    padding: 0;
    gap: 0;
}

.video-split-layout {
    display: grid;
    grid-template-columns: 1fr 0.35fr;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
}

.video-main {
    position: relative;
    overflow: visible;
}

.video-main .viewfinder {
    width: 100%;
    height: 100%;
    max-width: none;
    aspect-ratio: auto;
    border-radius: 0;
}

.video-reference {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.video-reference video,
.video-reference iframe,
.reference-iframe,
.reference-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
}

/* Video overlay controls (recording indicator + cancel) */
.video-overlay-controls {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
}

.video-overlay-controls .recording-indicator,
.video-overlay-controls .btn-cancel-recording {
    pointer-events: auto;
}

/* Recording indicator */
.recording-indicator {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5em 1em;
    border-radius: var(--border-radius);
    font-size: clamp(0.875rem, 2vw, 1.125rem);
    font-weight: 600;
}

.rec-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e74c3c;
    animation: rec-blink 1s ease-in-out infinite;
}

@keyframes rec-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.rec-stop-btn {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 0.4em 1em;
    border-radius: 8px;
    font-size: clamp(0.85rem, 2vw, 1rem);
    font-weight: 700;
    cursor: pointer;
    margin-left: 0.75rem;
    min-height: 36px;
}

.rec-stop-btn:active {
    background: #c0392b;
}

.btn-cancel-recording {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.4);
    padding: 0.8em 2.5em;
    border-radius: var(--border-radius);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 600;
    cursor: pointer;
    z-index: 50;
}

.btn-cancel-recording:active {
    background: rgba(0, 0, 0, 0.9);
}

/* Video review */
.review-video-container {
    width: min(100%, 600px);
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-video {
    width: 100%;
    max-height: 60vh;
    border-radius: var(--border-radius);
    background: #000;
}

/* Responsive: stack on small screens */
@media (max-width: 768px) {
    .video-split-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 0.3fr;
    }

    .video-reference {
        border-left: none;
        border-top: 2px solid rgba(255, 255, 255, 0.1);
    }
}

/* No dances state */
.dance-grid__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    opacity: 0.5;
    font-size: 1.125rem;
}
