/* Video Page Specific Styles */

.video-workspace {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

/* Fotoshoot Selection */
.fotoshoot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.fotoshoot-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.fotoshoot-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.fotoshoot-card.selected {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.fotoshoot-thumbnail {
    height: 180px;
    overflow: hidden;
}

.fotoshoot-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fotoshoot-info {
    padding: var(--space-md);
}

.fotoshoot-info h3 {
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.fotoshoot-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Image Selector */
.images-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
}

.selectable-image {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.selectable-image:hover {
    border-color: var(--accent-primary);
    transform: scale(1.02);
}

.selectable-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: var(--space-md);
}

.image-prompt {
    font-size: 0.8rem;
    line-height: 1.3;
    margin: 0;
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.scene-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.scene-item:hover {
    border-color: var(--border-hover);
}

.scene-number {
    background: var(--accent-primary);
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.scene-thumbnail {
    width: 80px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.scene-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scene-content {
    flex: 1;
    min-width: 0;
}

.scene-content h4 {
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.scene-prompt {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.scene-status {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-draft {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.status-generating {
    background: var(--warning);
    color: var(--bg-primary);
}

.status-completed {
    background: var(--success);
    color: var(--bg-primary);
}

.status-failed {
    background: var(--error);
    color: white;
}

.scene-actions {
    display: flex;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.empty-timeline {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

/* Scene Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-md);
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.modal-body {
    padding: var(--space-lg);
}

.scene-editor {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    max-width: 900px;
    margin: 0 auto;
}

.scene-image {
    width: 100%;
}

.scene-image img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.scene-image img {
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.scene-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.scene-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    margin-top: var(--space-lg);
}

/* Project Actions */
.project-form {
    display: flex;
    gap: var(--space-md);
    align-items: center;
    flex-wrap: wrap;
}

.project-form .form-input {
    flex: 1;
    min-width: 250px;
}

.action-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .video-workspace {
        gap: var(--space-lg);
    }
    
    .fotoshoot-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: var(--space-md);
    }
    
    .images-selector {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .scene-item {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .scene-thumbnail {
        width: 100%;
        height: 120px;
        align-self: center;
        max-width: 200px;
    }
    
    .scene-actions {
        justify-content: center;
    }
    
    .scene-editor {
        grid-template-columns: 1fr;
    }
    
    .project-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .modal-content {
        margin: var(--space-md);
        max-height: calc(100vh - 2rem);
    }
}

@media (max-width: 480px) {
    .fotoshoot-grid {
        grid-template-columns: 1fr;
    }
    
    .images-selector {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .scene-number {
        width: 2rem;
        height: 2rem;
    }
    
    .scene-actions {
        flex-wrap: wrap;
    }
}
/* ============================================================================
   LARGE IMAGE GRID (Fotoshoot Edit Style)
   ============================================================================ */

.image-item-large {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-elevated);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.image-item-large:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.image-item-large img {
    width: 100%;
    height: auto;
    display: block;
}

.image-overlay-hover {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.7), transparent);
    padding: var(--space-lg) var(--space-md) var(--space-md);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.image-item-large:hover .image-overlay-hover {
    opacity: 1;
}

.image-overlay-hover .image-prompt {
    color: white;
    font-size: 0.9rem;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Update images-selector to use large grid */
.images-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

@media (max-width: 768px) {
    .images-selector {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: var(--space-md);
    }

    .image-overlay-hover {
        padding: var(--space-md) var(--space-sm) var(--space-sm);
    }
}

@media (max-width: 480px) {
    .images-selector {
        grid-template-columns: 1fr;
    }
}

/* Video Settings Form */
.video-settings {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin: var(--space-md) 0;
}

@media (max-width: 768px) {
    .video-settings {
        grid-template-columns: 1fr;
    }
}

.setting-group.full-width {
    grid-column: 1 / -1;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.setting-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-select {
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-select:hover {
    border-color: var(--accent-primary);
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

/* Advanced Settings Collapsible */
.advanced-settings {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.advanced-settings summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    padding: var(--space-xs);
    user-select: none;
    transition: var(--transition);
}

.advanced-settings summary:hover {
    color: var(--accent-primary);
}

.advanced-settings[open] summary {
    margin-bottom: var(--space-md);
    color: var(--accent-primary);
}

.advanced-settings .setting-group {
    padding-top: var(--space-sm);
}

.form-input {
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-input:hover {
    border-color: var(--accent-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.form-textarea {
    padding: var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    transition: var(--transition);
}

.form-textarea:hover {
    border-color: var(--accent-primary);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

@media (max-width: 768px) {
    .video-settings {
        grid-template-columns: 1fr;
    }
}


.hint-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

/* Scene Settings Display */
.scene-meta {
    display: flex;
    gap: var(--space-sm);
    margin: var(--space-xs) 0;
    flex-wrap: wrap;
}

.scene-setting {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Video Boxes */
.scene-videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    flex-basis: 100%;
    width: 100%;
}

.video-box {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.video-box:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.video-box.favorite {
    border-color: var(--error);
    box-shadow: 0 0 0 2px rgba(var(--error-rgb, 239, 68, 68), 0.2);
}



.video-timestamp {
    font-size: 11px;
    color: var(--text-tertiary);
    padding: 4px 8px;
    text-align: center;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.video-box.favorite:hover {
    box-shadow: 0 0 0 2px rgba(var(--error-rgb, 239, 68, 68), 0.3), 0 8px 16px rgba(0, 0, 0, 0.3);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    cursor: pointer;
    overflow: hidden;
    background: #000;
}

.video-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-thumbnail:hover .video-overlay {
    opacity: 1;
}

.video-overlay .play-icon {
    width: 64px;
    height: 64px;
    color: white;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.video-actions {
    display: flex;
    justify-content: space-around;
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.btn-icon {
    background: none;
    border: none;
    padding: var(--space-xs);
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: scale(1.1);
}

.btn-icon.active {
    color: var(--error);
}

.btn-icon.active:hover {
    color: var(--error);
    background: rgba(var(--error-rgb, 239, 68, 68), 0.1);
}

.btn-icon.danger:hover {
    color: var(--error);
    background: rgba(var(--error-rgb, 239, 68, 68), 0.1);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 768px) {
    .scene-videos {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--space-sm);
    }

    .video-overlay .play-icon {
        width: 48px;
        height: 48px;
    }
}

/* Generating video state */
.video-box.generating {
    opacity: 0.8;
}

.video-thumbnail.generating {
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

.generating-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

.generating-content i {
    font-size: 2rem;
    animation: spin 2s linear infinite;
}

.generating-content span {
    font-size: 14px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Fix for fotoshoot card links */
.fotoshoot-card {
    text-decoration: none !important;
}

.fotoshoot-card h3,
.fotoshoot-card p {
    text-decoration: none !important;
}

/* Projects Grid - 3 Columns */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
}

.project-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.project-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.project-thumbnail {
    height: 180px;
    overflow: hidden;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info {
    padding: var(--space-md);
}

.project-info h3 {
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
    font-size: 1rem;
}

.project-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-sm);
}

/* Project Delete Button */
.project-card {
    position: relative;
}

.project-delete-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
    opacity: 0;
}

.project-card:hover .project-delete-btn {
    opacity: 1;
}

.project-delete-btn:hover {
    background: rgb(220, 38, 38);
    transform: scale(1.1);
}

.project-delete-btn i {
    width: 18px;
    height: 18px;
}

/* Fotoshoot Selector Dropdown */
.fotoshoot-selector {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-left: auto;
}

.fotoshoot-selector label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: normal;
}

.fotoshoot-dropdown {
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    min-width: 250px;
}

.fotoshoot-dropdown:hover {
    border-color: var(--accent-primary);
}

.fotoshoot-dropdown:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
