/**
 * Video Project Generator Styles
 */

/* Source Info */
.videoproject-source-info {
    background: rgba(106, 252, 255, 0.1);
    border: 1px solid rgba(106, 252, 255, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

/* Scenes Preview Grid */
.videoproject-scenes-preview {
    margin: 20px 0;
}

.videoproject-scenes-preview h3 {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scenes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.scene-preview-card {
    background: rgba(72, 101, 139, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}

.scene-preview-card:hover {
    border-color: rgba(106, 252, 255, 0.4);
}

.scene-preview-card.excluded {
    opacity: 0.5;
}

.scene-number {
    background: rgba(106, 252, 255, 0.2);
    color: #6afcff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    text-align: center;
}

.scene-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

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

.scene-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.3);
}

.scene-info {
    padding: 10px;
}

.scene-title {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scene-description {
    font-size: 0.8rem;
    color: #88aacc;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.scene-include-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    cursor: pointer;
}

.scene-include-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Cost Summary */
.videoproject-cost-summary {
    background: rgba(72, 101, 139, 0.2);
    border: 1px solid rgba(106, 252, 255, 0.2);
    border-radius: 10px;
    padding: 15px 20px;
    margin: 20px 0;
}

.cost-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cost-label {
    color: #88aacc;
}

.cost-value {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.cost-discount .cost-value {
    color: #4ade80;
}

.cost-total {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
    margin-top: 5px;
}

.cost-total .cost-label,
.cost-total .cost-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.cost-total .cost-value {
    color: #6afcff;
}

/* Project Item Display */
.videoproject-item {
    position: relative;
}

.videoproject-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* Status Bar */
.videoproject-status-bar {
    background: rgba(72, 101, 139, 0.2);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
}

.videoproject-status-bar .status-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.videoproject-status-bar .status-label {
    font-weight: 600;
}

.videoproject-status-bar .status-progress {
    color: #88aacc;
    font-size: 0.9rem;
}

.videoproject-status-bar.status-completed .status-label {
    color: #4ade80;
}

.videoproject-status-bar.status-generating .status-label {
    color: #6afcff;
}

.videoproject-status-bar.status-failed .status-label {
    color: #ef4444;
}

.videoproject-status-bar.status-partial .status-label {
    color: #eab308;
}

.progress-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6afcff, #4ade80);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Clips Grid */
.videoproject-clips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.clip-card {
    background: rgba(72, 101, 139, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
}

.clip-card:hover {
    border-color: rgba(106, 252, 255, 0.4);
    transform: translateY(-2px);
}

.clip-card.clip-status-completed {
    border-color: rgba(74, 222, 128, 0.3);
}

.clip-card.clip-status-generating {
    border-color: rgba(106, 252, 255, 0.5);
}

.clip-card.clip-status-failed {
    border-color: rgba(239, 68, 68, 0.4);
}

.clip-card.clip-status-skipped {
    opacity: 0.5;
}

.clip-number {
    background: rgba(106, 252, 255, 0.15);
    color: #6afcff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    text-align: center;
}

.clip-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.clip-thumbnail img,
.clip-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clip-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
}

.clip-thumbnail:hover .clip-play-overlay {
    opacity: 1;
}

.clip-generating-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
}

.clip-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.2);
}

.clip-info {
    padding: 8px 10px;
}

.clip-title {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.clip-status-label {
    font-size: 0.75rem;
    color: #88aacc;
}

.clip-actions {
    display: flex;
    gap: 5px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.clip-action-btn {
    flex: 1;
    padding: 6px;
    background: rgba(106, 252, 255, 0.1);
    border: 1px solid rgba(106, 252, 255, 0.3);
    border-radius: 6px;
    color: #6afcff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clip-action-btn:hover {
    background: rgba(106, 252, 255, 0.2);
}

/* Final Video */
.videoproject-final-video {
    margin: 25px 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.videoproject-final-video h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    color: #6afcff;
}

/* Project Actions */
.videoproject-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin: 20px 0;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.videoproject-actions .default-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* No Source State */
.videoproject-no-source {
    text-align: center;
    padding: 40px 20px;
}

/* Editor Styles */
.videoproject-editor {
    padding: 20px 0;
}

.editor-header {
    margin-bottom: 20px;
}

.editor-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.editor-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    color: #88aacc;
    font-size: 0.9rem;
}

.editor-status {
    background: rgba(72, 101, 139, 0.2);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 25px;
}

.status-counts {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.status-count {
    font-size: 0.9rem;
}

.status-count.completed {
    color: #4ade80;
}

.status-count.pending {
    color: #88aacc;
}

/* Editor Clips Grid */
.editor-clips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.editor-clip-card {
    background: rgba(72, 101, 139, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    transition: all 0.2s;
}

.editor-clip-card:hover {
    border-color: rgba(106, 252, 255, 0.4);
}

.editor-clip-card.dragging {
    opacity: 0.5;
    border-color: #6afcff;
}

.clip-drag-handle {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 10;
    color: rgba(255, 255, 255, 0.7);
}

.clip-drag-handle:active {
    cursor: grabbing;
}

.clip-order-number {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(106, 252, 255, 0.9);
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.clip-preview {
    position: relative;
    aspect-ratio: 16/9;
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.clip-preview img,
.clip-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clip-video-controls {
    position: absolute;
    bottom: 8px;
    right: 8px;
}

.play-clip-btn {
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-clip-btn:hover {
    background: rgba(106, 252, 255, 0.5);
}

.clip-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.clip-details {
    padding: 12px;
}

.clip-status {
    font-size: 0.8rem;
    margin-top: 5px;
}

.status-pending { color: #88aacc; }
.status-generating { color: #6afcff; }
.status-completed { color: #4ade80; }
.status-failed { color: #ef4444; }
.status-skipped { color: #888; }

.clip-error {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clip-actions {
    display: flex;
    gap: 5px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.clip-btn {
    flex: 1;
    padding: 8px;
    background: rgba(106, 252, 255, 0.1);
    border: 1px solid rgba(106, 252, 255, 0.3);
    border-radius: 6px;
    color: #6afcff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clip-btn:hover {
    background: rgba(106, 252, 255, 0.2);
}

/* Editor Actions */
.editor-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.action-group {
    display: flex;
    gap: 10px;
}

.action-group.secondary {
    margin-left: auto;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #1a2332;
    border: 1px solid rgba(106, 252, 255, 0.3);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
    margin: 0;
    color: #6afcff;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px;
}

.modal-body label {
    display: block;
    margin-bottom: 10px;
    color: #88aacc;
}

.modal-body textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

.modal-body textarea:focus {
    outline: none;
    border-color: #6afcff;
}

.prompt-hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: 10px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Spinner */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(106, 252, 255, 0.2);
    border-top-color: #6afcff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 768px) {
    .scenes-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .videoproject-clips-grid,
    .editor-clips-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .editor-actions {
        flex-direction: column;
    }

    .action-group {
        width: 100%;
        justify-content: center;
    }

    .action-group.secondary {
        margin-left: 0;
    }
}
