/* ============================================================================
   VEO 3.1 Video Generation Styles
   Description: Enhanced UI styling for VEO 3.1 video generation features
   Created: 2025-10-16
   ============================================================================ */

/* ============================================================================
   Generation Mode Selector
   ============================================================================ */
.veo-mode-selector {
    margin-bottom: 30px;
}

.veo-mode-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    max-width: 700px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.veo-mode-option {
    position: relative;
    flex: 1;
    max-width: 240px;
    overflow: hidden;
}

.veo-mode-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 2;
}

.veo-mode-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #94a3b8;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.veo-mode-icon {
    font-size: 28px;
    transition: transform 0.3s ease;
}

.veo-mode-text {
    display: block;
}

.veo-mode-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 140, 0, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.veo-mode-option input[type="radio"]:checked ~ .veo-mode-label {
    background: rgba(255, 140, 0, 0.15);
    border-color: rgba(255, 140, 0, 0.6);
    color: #fbbf24;
    transform: scale(1.03);
    box-shadow: 0 4px 20px rgba(255, 140, 0, 0.25);
}

.veo-mode-option input[type="radio"]:checked ~ .veo-mode-label .veo-mode-icon {
    transform: scale(1.1);
    color: #fbbf24;
}

.veo-mode-option input[type="radio"]:checked ~ .veo-mode-label::before {
    opacity: 1;
}

.veo-mode-option:hover .veo-mode-label {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.veo-mode-option:hover .veo-mode-label .veo-mode-icon {
    transform: scale(1.05);
}

/* ============================================================================
   Reference Image Slots - Glassmorphism Style
   ============================================================================ */
.veo-reference-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.veo-reference-slot,
.veo-frame-slot,
.veo-single-image-slot {
    position: relative;
    aspect-ratio: 1;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 140px;
}

/* Override for Image-to-Video single image slot to use 16:9 aspect ratio */
.veo-single-image-slot {
    aspect-ratio: 16 / 9;
    min-height: 120px;
}

.veo-reference-slot:hover,
.veo-frame-slot:hover,
.veo-single-image-slot:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 140, 0, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(255, 140, 0, 0.1);
}

.veo-slot-content {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Empty State */
.veo-slot-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
    text-align: center;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.veo-reference-slot:hover .veo-slot-empty,
.veo-frame-slot:hover .veo-slot-empty,
.veo-single-image-slot:hover .veo-slot-empty {
    opacity: 1;
}

.veo-slot-icon {
    font-size: 32px;
    filter: grayscale(20%);
    transition: all 0.3s ease;
}

.veo-reference-slot:hover .veo-slot-icon,
.veo-frame-slot:hover .veo-slot-icon,
.veo-single-image-slot:hover .veo-slot-icon {
    transform: scale(1.1);
    filter: grayscale(0%);
}

.veo-slot-text {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Preview State */
.veo-slot-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.veo-slot-preview[style*="display: block"],
.veo-slot-preview:not([style*="display: none"]) {
    opacity: 1;
}

/* Clear Button */
.veo-slot-clear {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.veo-reference-slot:hover .veo-slot-clear[style*="display: block"],
.veo-frame-slot:hover .veo-slot-clear[style*="display: block"],
.veo-single-image-slot:hover .veo-slot-clear[style*="display: block"],
.veo-reference-slot:hover .veo-slot-clear:not([style*="display: none"]),
.veo-frame-slot:hover .veo-slot-clear:not([style*="display: none"]),
.veo-single-image-slot:hover .veo-slot-clear:not([style*="display: none"]) {
    opacity: 1;
    transform: scale(1);
}

.veo-slot-clear:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Filled Slot State */
.veo-reference-slot.filled,
.veo-frame-slot.filled,
.veo-single-image-slot.filled {
    background: rgba(255, 140, 0, 0.05);
    border: 2px solid rgba(255, 140, 0, 0.3);
    box-shadow: 0 4px 16px rgba(255, 140, 0, 0.1);
}

/* Error State */
.veo-reference-slot.error,
.veo-frame-slot.error,
.veo-single-image-slot.error {
    background: rgba(239, 68, 68, 0.05);
    border: 2px solid rgba(239, 68, 68, 0.5);
    animation: veo-shake 0.3s ease;
}

.veo-reference-slot.error .veo-slot-icon,
.veo-frame-slot.error .veo-slot-icon,
.veo-single-image-slot.error .veo-slot-icon {
    color: #ef4444;
}

/* Drag-Drop Active State (Image-to-Video specific) */
.veo-single-image-slot.drag-over {
    background: rgba(255, 140, 0, 0.1);
    border-color: rgba(255, 140, 0, 0.6);
    border-style: solid;
    transform: scale(1.02);
    box-shadow: 0 0 0 4px rgba(255, 140, 0, 0.2),
                0 8px 24px rgba(255, 140, 0, 0.3);
}

.veo-single-image-slot.drag-over .veo-slot-icon {
    transform: scale(1.2);
    color: #fbbf24;
    animation: veo-bounce 0.6s ease infinite;
}

@keyframes veo-bounce {
    0%, 100% { transform: scale(1.2) translateY(0); }
    50% { transform: scale(1.2) translateY(-8px); }
}

/* Loading State */
.veo-slot-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    display: none;
}

.veo-slot-loading.active {
    display: block;
}

.veo-slot-loading::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255, 140, 0, 0.1);
    border-top-color: #ff8c00;
    animation: veo-spin 1s linear infinite;
}

@keyframes veo-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Upload Progress Indicator */
.veo-upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 14px 14px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.veo-upload-progress.active {
    opacity: 1;
}

.veo-upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ff8c00, #fbbf24);
    border-radius: 2px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.5);
}

/* ============================================================================
   Mode Containers - Smooth Transitions
   ============================================================================ */
.veo-mode-container {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.veo-mode-container[style*="display: block"] {
    animation: veo-fadeIn 0.4s ease forwards;
    pointer-events: auto;
}

@keyframes veo-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   Info Banners
   ============================================================================ */
.veo-info-banner {
    padding: 14px 18px;
    background: rgba(59, 130, 246, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.veo-info-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    animation: veo-shimmer 3s infinite;
}

@keyframes veo-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.veo-info-banner p {
    margin: 0;
    font-size: 13px;
    color: #93c5fd;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* ============================================================================
   Reference Image Counter
   ============================================================================ */
.veo-reference-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 140, 0, 0.1);
    border: 1px solid rgba(255, 140, 0, 0.3);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #fbbf24;
    margin-left: 12px;
    transition: all 0.3s ease;
}

.veo-reference-counter .count {
    font-weight: 600;
    color: #ff8c00;
}

/* ============================================================================
   Interpolation Frame Slots
   ============================================================================ */
.veo-interpolation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.veo-frame-slot {
    min-height: 180px;
}

.veo-frame-slot .veo-slot-icon {
    font-size: 40px;
}

/* ============================================================================
   Extension Mode Styles
   ============================================================================ */
.veo-extension-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #e2e8f0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.veo-extension-select:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 140, 0, 0.3);
}

.veo-extension-select:focus {
    outline: none;
    border-color: rgba(255, 140, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

.veo-extension-select option {
    background: #1a1a1a;
    color: #e2e8f0;
}

/* Extension Info Display */
.veo-extension-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.veo-extension-stat {
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.veo-extension-stat:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-1px);
}

.veo-extension-stat-label {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.veo-extension-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #fbbf24;
}

/* Validation Warnings */
.veo-validation-warning {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    margin-top: 8px;
    display: none;
    animation: veo-shake 0.3s ease;
}

.veo-validation-warning.active {
    display: block;
}

.veo-validation-warning p {
    margin: 0;
    font-size: 12px;
    color: #fca5a5;
    line-height: 1.5;
}

@keyframes veo-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ============================================================================
   Advanced Options
   ============================================================================ */
.veo-advanced-options {
    margin-top: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.veo-advanced-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 140, 0, 0.1);
    border: 1px solid rgba(255, 140, 0, 0.3);
    border-radius: 8px;
    color: #fbbf24;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.veo-advanced-toggle:hover {
    background: rgba(255, 140, 0, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.2);
}

.veo-advanced-toggle .icon {
    transition: transform 0.3s ease;
}

.veo-advanced-toggle.expanded .icon {
    transform: rotate(180deg);
}

.veo-advanced-content {
    display: grid;
    gap: 16px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.veo-advanced-content.expanded {
    max-height: 500px;
    opacity: 1;
    padding-top: 16px;
}

/* ============================================================================
   Generate Button Enhanced
   ============================================================================ */
.generate-btn.veo-enhanced {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ff8c00, #fbbf24);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.generate-btn.veo-enhanced::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.generate-btn.veo-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 140, 0, 0.4);
}

.generate-btn.veo-enhanced:hover::before {
    width: 300px;
    height: 300px;
}

.generate-btn.veo-enhanced:disabled {
    background: rgba(100, 100, 100, 0.3);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */
@media (max-width: 768px) {
    .veo-mode-selector {
        flex-direction: column;
    }

    .veo-reference-slots {
        grid-template-columns: 1fr;
    }

    .veo-interpolation-grid {
        grid-template-columns: 1fr;
    }

    .veo-extension-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .veo-slot-icon {
        font-size: 24px;
    }

    .veo-slot-text {
        font-size: 11px;
    }

    .veo-mode-label {
        font-size: 12px;
        padding: 10px 12px;
    }
}

/* ============================================================================
   Dark Mode Support
   ============================================================================ */
@media (prefers-color-scheme: dark) {
    .veo-reference-slot,
    .veo-frame-slot,
    .veo-single-image-slot {
        background: rgba(0, 0, 0, 0.4);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .veo-info-banner {
        background: rgba(59, 130, 246, 0.05);
    }
}

/* ============================================================================
   Extension Video Grid Selector
   ============================================================================ */
.extension-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.2);
}

.extension-video-grid::-webkit-scrollbar {
    width: 8px;
}

.extension-video-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.extension-video-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.extension-video-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.extension-video-card {
    position: relative;
    background: rgba(30, 30, 30, 0.8);
    border: 2px solid rgba(60, 60, 60, 0.5);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.extension-video-card:hover {
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
}

.extension-video-card.selected {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.3);
}

.extension-video-thumbnail {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

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

.extension-video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(59, 130, 246, 0.1));
    color: rgba(255, 255, 255, 0.4);
    font-size: 48px;
}

.extension-video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.extension-video-info {
    padding: 12px;
}

.extension-video-prompt {
    font-size: 13px;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 8px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.extension-video-stats {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    color: #94a3b8;
}

.extension-video-check {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #a855f7;
    font-size: 24px;
    opacity: 0;
    transition: opacity 0.2s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.extension-video-card.selected .extension-video-check {
    opacity: 1;
}

/* Load More Button */
.extension-load-more {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    margin-top: 8px;
}

.load-more-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 32px;
    background: rgba(168, 85, 247, 0.1);
    backdrop-filter: blur(12px);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    color: #c084fc;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.1);
}

.load-more-btn:hover {
    background: rgba(168, 85, 247, 0.2);
    border-color: rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.2);
    color: #e9d5ff;
}

.load-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.15);
}

.load-more-btn i {
    font-size: 18px;
    animation: bobbing 2s ease-in-out infinite;
}

@keyframes bobbing {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(4px);
    }
}

/* ============================================================================
   Print Styles
   ============================================================================ */
@media print {
    .veo-mode-selector,
    .veo-reference-slots,
    .veo-advanced-options,
    .extension-video-grid {
        display: none;
    }
}