/* Scenes Builder Styles */

.scenes-builder {
    padding: 20px;
}

/* Connection Status Styles */
.connection-status .alert {
    margin-bottom: 0;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 19px;
}

.connection-status .alert.alert-success {
    background-color: #d1edff;
    border-color: #bee5eb;
    color: #0c5460;
}

.connection-status .alert.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.connection-status .alert.alert-secondary {
    background-color: #e2e3e5;
    border-color: #d6d8db;
    color: #383d41;
}

/* Task Info Styles */
.task-info .alert {
    margin-bottom: 0;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
}

/* Scenes Container Styles */
.scenes-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.scene-card {
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.scene-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
    border-color: #007bff;
}

.scene-card.selected {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.scene-card-header {
    padding: 15px;
    background: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scene-card-title {
    font-weight: 600;
    color: #5a5c69;
    margin: 0;
    font-size: 16px;
}

.scene-card-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.scene-card-body {
    padding: 20px 15px;
}

.scene-info {
    text-align: center;
}

.scene-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.scene-stats .badge {
    font-size: 12px;
    padding: 6px 10px;
}

/* Saved Scenes Styles */
.saved-scenes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.saved-scene-card {
    border: 1px solid #28a745;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

.saved-scene-card-header {
    padding: 12px 15px;
    background: #d4edda;
    border-bottom: 1px solid #c3e6cb;
    color: #155724;
    font-weight: 600;
    font-size: 14px;
}

.saved-scene-card-body {
    padding: 15px;
}

.saved-scene-info {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 10px;
}

.saved-scene-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.saved-image-card {
    border: 1px solid #e3e6f0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
}

.saved-image-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.saved-image-preview {
    width: 100%;
    object-fit: cover;
    background-color: #f8f9fc;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.saved-image-preview:hover {
    transform: scale(1.02);
}

/* Video styling */
.saved-image-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

.saved-image-preview video:hover {
    transform: scale(1.02);
}

.saved-image-details {
    padding: 15px;
}

.saved-image-name {
    font-weight: 600;
    color: #5a5c69;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 10px;
}

.image-analysis-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 15px;
}

.image-analysis-status.status-pending {
    background-color: #f8f9fc;
    color: #5a5c69;
    border: 1px solid #e3e6f0;
}
.image-analysis-status.status-in_progress {
    background-color: #e3f2fd;
    color: #1976d2;
}
.image-analysis-status.status-completed {
    background-color: #d4edda;
    color: #155724;
}
.image-analysis-status.status-error {
    background-color: #f8d7da;
    color: #721c24;
}

.image-action-btn {
    width: 100%;
}

/* Prompt Details Styles */
.prompt-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e3e6f0;
}

.prompt-details h6 {
    font-size: 14px;
    color: #007bff;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prompt-details .copy-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.prompt-details .copy-btn:hover {
    background: #0056b3;
}

.prompt-details .copy-btn.copied {
    background: #28a745;
}

.prompt-details p {
    font-size: 13px;
    color: #6c757d;
    background: #f8f9fc;
    padding: 8px;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 80px;
    overflow: hidden;
    position: relative;
    margin-bottom: 0;
}

.prompt-details p.expanded {
    max-height: none;
}

.prompt-details .prompt-container {
    position: relative;
}

.prompt-details .expand-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background: linear-gradient(180deg, transparent, #f8f9fc 30%);
    color: #007bff;
    border: none;
    padding: 4px 8px;
    font-size: 11px;
    width: 100%;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
}

.prompt-details .expand-btn:hover {
    color: #0056b3;
}

.prompt-details .expand-btn.expanded {
    position: static;
    background: none;
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .scenes-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .scenes-container {
        grid-template-columns: 1fr;
    }
    
    .saved-scenes-container {
        grid-template-columns: 1fr;
    }
}

/* Modal Styles */
.scene-detail-modal .modal-xl {
    max-width: 90%;
}

.scene-detail-content {
    max-height: 70vh;
    overflow-y: auto;
}

.scene-detail-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.scene-detail-image {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scene-detail-image:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.scene-detail-image.selected {
    border: 2px solid #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.scene-detail-image img {
    width: 100%;
    height: auto;
    display: block;
}

.image-selection-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(255,255,255,0.9);
    border-radius: 4px;
    padding: 4px;
}

.image-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    display: none;
}

.image-selected-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgb(155 155 155 / 49%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.image-selected-overlay i {
    color: white;
    font-size: 24px;
    background: rgb(62 112 145);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Selection Counter */
.selection-counter {
    background: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h5 {
    margin-bottom: 10px;
    color: #5a5c69;
}

.empty-state p {
    margin-bottom: 0;
    font-size: 14px;
}

/* Image Modal Styles */
.image-modal .modal-dialog {
    max-width: 90%;
    max-height: 90vh;
}

.image-modal .modal-content {
    background: transparent;
    border: none;
}

.image-modal .modal-header {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 10px 20px;
}

.image-modal .modal-header .btn-close {
    filter: invert(1);
}

.image-modal .modal-body {
    padding: 0;
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal .modal-body img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.image-modal .modal-footer {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 10px 20px;
    justify-content: space-between;
}

.image-modal .image-info {
    text-align: left;
    font-size: 14px;
}

.image-modal .image-info div {
    margin-bottom: 2px;
}

.image-modal .image-actions {
    display: flex;
    gap: 10px;
}

.image-modal .btn {
    padding: 5px 15px;
    font-size: 12px;
}

/* Loading state for modal image */
.image-modal .modal-body.loading {
    position: relative;
}

.image-modal .modal-body.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Keyboard shortcut hint */
.image-modal .modal-header .modal-title::after {
    content: ' (Press ESC to close)';
    font-size: 12px;
    opacity: 0.7;
    font-weight: normal;
}

/* Video Generation Section */
.video-generation-section {
    border-top: 1px solid #e3e6f0;
    padding-top: 15px;
}

.video-generation-section h6 {
    font-size: 14px;
    color: #007bff;
    margin-bottom: 10px;
}

.video-generation-section .btn {
    font-size: 12px;
    padding: 6px 12px;
}

.video-generation-section .alert {
    font-size: 12px;
    padding: 8px 12px;
    margin-bottom: 0;
}

.video-generation-section .alert small {
    font-size: 11px;
    opacity: 0.8;
} 