/* === Video Compilation Styles === */

/* Compilation Grid */
.compilations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 5px 0;
}

.compilation-card {
    background: white;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    padding: 16px;
    transition: all 0.2s ease;
}

.compilation-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.compilation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.compilation-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.compilation-badge.status-completed {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.compilation-badge.status-processing {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.compilation-badge.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.compilation-info {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.compilation-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
}

.stat-label {
    font-size: 1rem;
}

.stat-value {
    color: var(--text-secondary, #64748b);
    font-weight: 500;
}

.compilation-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.compilation-date {
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
}

.compilation-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-icon.btn-delete {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-icon.btn-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* === Create Compilation Modal === */

.vc-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    padding: 0;
}

.compilation-modal {
    width: 96vw;
    height: 92vh;
    max-width: 96vw;
    max-height: 92vh;
    background: var(--bg-primary, #ffffff);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.vc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
}

.vc-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
}

.vc-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.vc-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.vc-main-area {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 12px 20px 0;
}

.vc-hint {
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 8px;
    flex-shrink: 0;
}

/* Animation Selector Grid — only this scrolls */
.vc-animations-grid {
    --vc-cell-size: 200px;
    --vc-gap: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: var(--vc-gap);
    justify-content: center;
    align-content: start;
    flex: 1;
    overflow-y: auto;
    padding: 4px;
}

/* Zoom control in header */
.vc-zoom {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.75rem;
}

.vc-zoom-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: rgba(255, 255, 255, 0.8);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: background 0.2s;
}

.vc-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.vc-zoom input[type="range"] {
    width: 100px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.vc-zoom input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
}

.vc-zoom input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: none;
    cursor: pointer;
}

/* Bottom panel — fixed at bottom */
.vc-bottom-panel {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-secondary, #f8fafc);
    border-radius: 0 0 14px 14px;
}

.vc-bottom-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.vc-bottom-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vc-selected-count {
    font-size: 0.9rem;
    white-space: nowrap;
}

.vc-transitions-inline {
    display: flex;
    gap: 6px;
}

.vc-transition-chip {
    padding: 5px 12px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 20px;
    background: var(--bg-primary, #fff);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.vc-transition-chip .vc-transition-title {
    font-size: 0.8rem;
    font-weight: 500;
}

.vc-transition-option:hover .vc-transition-chip {
    border-color: var(--primary-color, #6366f1);
}

.vc-transition-option.selected .vc-transition-chip {
    border-color: var(--primary-color, #6366f1);
    background: rgba(99, 102, 241, 0.1);
}

.vc-cost-inline {
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Mosaic preview (2x2) on compilation/album cards */
.compilation-mosaic {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    aspect-ratio: 1 / 1;
    width: 100%;
    background: var(--bg-secondary, #1a1a1a);
    border-radius: 6px;
    overflow: hidden;
    margin: 8px 0;
}

.mosaic-cell {
    position: relative;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.mosaic-cell img,
.mosaic-cell video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mosaic-cell.mosaic-empty {
    background: rgba(255, 255, 255, 0.05);
}

/* Photo Album: photo duration slider */
.pa-duration-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-left: 12px;
}

.pa-duration-control label {
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.pa-duration-control label strong {
    color: var(--primary-color, #6366f1);
    font-size: 0.9rem;
}

.pa-duration-control input[type="range"] {
    width: 140px;
    accent-color: var(--primary-color, #6366f1);
}

.vc-cost-inline strong {
    color: var(--primary-color, #6366f1);
}

.vc-anim-item {
    width: var(--vc-cell-size);
    height: var(--vc-cell-size);
    cursor: pointer;
    border-radius: 8px;
    border: 2px solid transparent;
    overflow: hidden;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #334155, #1e293b);
    flex-shrink: 0;
}

.vc-anim-item:hover {
    border-color: #667eea;
}

.vc-anim-item.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.vc-anim-thumb {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.vc-anim-thumb img,
.vc-anim-thumb video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vc-anim-thumb video {
    z-index: 1;
}

.vc-anim-thumb video::-webkit-media-controls {
    display: none !important;
}

.vc-anim-thumb video::-webkit-media-controls-enclosure {
    display: none !important;
}

.vc-anim-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #334155, #1e293b);
    color: #64748b;
    font-size: 1.5rem;
}

.vc-anim-order {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 24px;
    height: 24px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.vc-anim-dur {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.6rem;
    padding: 1px 5px;
    border-radius: 4px;
    z-index: 2;
}

.vc-transition-option {
    cursor: pointer;
}

.vc-transition-option input[type="radio"] {
    display: none;
}

/* === Dark theme === */

[data-theme="dark"] .compilation-card {
    background: var(--card-bg, #1e293b);
    border-color: var(--border-color, #334155);
}

[data-theme="dark"] .compilation-card:hover {
    border-color: #667eea;
}

[data-theme="dark"] .compilation-footer {
    border-top-color: var(--border-color, #334155);
}

[data-theme="dark"] .compilation-modal {
    background: var(--bg-primary, #0f172a);
}

[data-theme="dark"] .vc-anim-item {
    background: var(--bg-tertiary, #1e293b);
}

[data-theme="dark"] .vc-bottom-panel {
    background: var(--bg-tertiary, #1e293b);
    border-top-color: var(--border-color, #334155);
}

[data-theme="dark"] .vc-transition-chip {
    background: var(--bg-secondary, #1e293b);
    border-color: var(--border-color, #334155);
}

[data-theme="dark"] .vc-transition-option.selected .vc-transition-chip {
    background: rgba(99, 102, 241, 0.15);
}

/* === Responsive === */

@media (max-width: 600px) {
    .compilations-grid {
        grid-template-columns: 1fr;
    }
    
    .compilation-modal {
        width: 100vw;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .vc-bottom-panel {
        flex-direction: column;
        gap: 10px;
        border-radius: 0;
    }
    
    .vc-bottom-left,
    .vc-bottom-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .vc-animations-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
}
