/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.logo i {
    font-size: 2rem;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Mobile Menu Toggle - Hidden by default */
.mobile-menu-toggle {
    display: none;
}

.subtitle {
    font-size: 1.2rem;
    color: #6b7280;
    font-weight: 400;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Generation Panel */
.generation-panel {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h2 {
    font-size: 1.8rem;
    color: #ffffff;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header i {
    color: #4f46e5;
}

/* Form Styles */
.generation-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #ffffff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: #6366f1;
    width: 16px;
}

select, textarea {
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

select:focus, textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* Video form textareas - ensure consistent height */
#videoPrompt,
#negativePrompt:not([style*="display: none"]) {
    min-height: 120px !important;
    height: 120px !important;
}

/* Ensure negative prompt is completely hidden when display: none is set */
#negativePrompt[style*="display: none"],
.form-group[style*="display: none"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.char-count {
    text-align: right;
    font-size: 0.875rem;
    color: #6b7280;
}

/* Field help text */
.field-help {
    font-size: 0.875rem;
    color: #7c3aed;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.field-help i {
    color: #4f46e5;
    font-size: 0.75rem;
}

/* Specific styling for aspect ratio field help to ensure visibility */
#dynamicImageFields .field-help {
    color: #8b5cf6 !important;
    font-weight: 500;
}

#dynamicImageFields .field-help i {
    color: #7c3aed !important;
}

/* Generate Button */
.generate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
    position: relative;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Credit Cost Display */
.credit-cost {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
}

.credit-cost i {
    font-size: 0.7rem;
    color: #fbbf24;
}

/* Status Panel */
.status-panel {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Centered status panel for single video/content generation */
.heygen-status-panel {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 500px;
    margin: 0 auto;
}

.heygen-status-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.heygen-status-content h3 {
    color: #ffffff;
    margin: 20px 0 10px;
    font-size: 1.5rem;
    text-align: center;
}

.heygen-status-content p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
    text-align: center;
    max-width: 400px;
}

.status-content h3 {
    color: #ffffff;
    margin: 20px 0 10px;
    font-size: 1.5rem;
}

.status-content p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
}

.loading-spinner {
    display: inline-block;
    font-size: 2rem;
    color: #4f46e5;
}

.loading-spinner.large {
    font-size: 4rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Results Section */
.results-section {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    font-size: 1.8rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.clear-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Single image layout - center and maintain aspect ratio */
.image-gallery.single-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.7);
}

/* Single image item - constrain size and maintain aspect ratio */
.image-item.single-image {
    max-width: 400px;
    width: auto;
    height: auto;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.image-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

/* Single image - maintain natural aspect ratio */
.image-item.single-image img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    background: #1a1a1a;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 20px;
}

.image-item:hover .image-overlay {
    opacity: 1;
}

/* Make enhance button always visible */
.image-overlay .enhance-btn {
    opacity: 1 !important;
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    z-index: 10;
    display: block !important;
    visibility: visible !important;
    pointer-events: all !important;
}

.image-overlay .enhance-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

/* Always show enhance button, even without hover */
.image-item .enhance-btn {
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
    pointer-events: all !important;
}

/* Override any hover effects that might hide the enhance button */
.image-overlay {
    pointer-events: none;
}

.image-overlay .enhance-btn {
    pointer-events: all !important;
}

.image-overlay .image-actions {
    pointer-events: all;
}

/* Buttons below enhanced images */
.image-actions-below {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Style for buttons below enhanced images */
.image-actions-below .image-action {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.image-actions-below .image-action:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.image-actions-below .image-action i {
    font-size: 14px;
}

/* Reset button specific styling */
.image-actions-below .image-action.reset-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.image-actions-below .image-action.reset-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

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

.action-btn {
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content h3 {
    margin-top: 20px;
    font-size: 1.5rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
}

.footer p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

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

    .logo {
        font-size: 1.5rem;
        order: 1;
    }

    .mobile-menu-toggle {
        display: block !important;
        order: 2;
        background: none;
        border: none;
        color: rgba(255, 255, 255, 0.8);
        font-size: 1.2rem;
        cursor: pointer;
        padding: 8px;
        border-radius: 8px;
        transition: all 0.3s ease;
    }

    .mobile-menu-toggle:hover {
        color: #fff;
        background: rgba(159, 16, 255, 0.2);
    }

    .nav-links {
        width: 100%;
        flex-direction: column;
        background: radial-gradient(circle at 0 0, rgba(79,17,112,.9), rgba(36,9,59,.9));
        backdrop-filter: blur(24px);
        border: 1px solid rgba(255,255,255,.08);
        border-radius: 15px;
        padding: 15px;
        margin-top: 15px;
        gap: 0;
        order: 3;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.3s ease;
    }

    .nav-links.active {
        max-height: 500px;
        opacity: 1;
    }

    .nav-links a {
        width: 100%;
        padding: 12px 16px;
        border-radius: 8px;
        margin-bottom: 5px;
        text-align: left;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .generation-panel,
    .status-panel,
    .results-section {
        padding: 20px;
    }

    .image-gallery {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    /* Single image on mobile - smaller max width */
    .image-item.single-image {
        max-width: 300px;
    }
    
    .image-item.single-image img {
        max-height: 400px;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .image-gallery {
        grid-template-columns: 1fr;
    }
    
    /* Single image on small mobile - even smaller */
    .image-item.single-image {
        max-width: 280px;
    }
    
    .image-item.single-image img {
        max-height: 350px;
    }
    
    .avatar-groups {
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 15px;
    }
    
    .avatar-group-item {
        max-width: 100%;
    }
    
    .avatar-group-item img {
        height: 100px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

/* Message Container */
#messageContainer {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 600px;
    width: 90%;
    pointer-events: none;
}

/* Success/Error Messages */
.message {
    padding: 15px 20px;
    border-radius: 12px;
    margin: 10px 0;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInFromTop 0.4s ease-out;
    backdrop-filter: blur(10px);
    pointer-events: all;
    cursor: pointer;
    transition: all 0.3s ease;
}

.message:hover {
    transform: translateY(-2px);
}

.message.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: 1px solid #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    font-weight: 600;
}

.message.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: 1px solid #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    font-weight: 600;
}

.message.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: 1px solid #2563eb;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    font-weight: 600;
}

/* Enhancement suggestion message */
.enhancement-suggestion {
    text-align: center;
    margin-bottom: 20px;
    color: #374151;
}

.suggestion-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1f2937;
}

.suggestion-content p {
    font-size: 1rem;
    margin: 0;
    color: #6b7280;
    line-height: 1.5;
}

/* Dynamic Fields Styling */
.dynamic-fields {
    margin-top: 15px;
}

.dynamic-field {
    margin-bottom: 15px;
}

.dynamic-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #374151;
}

.dynamic-field input,
.dynamic-field select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.dynamic-field input:focus,
.dynamic-field select:focus {
    outline: none;
    border-color: #4f46e5;
}

/* Reference Image Selection */
.reference-selection {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.reference-selection > label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 15px;
    font-size: 1rem;
}

.reference-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.reference-option {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reference-option:hover {
    transform: translateY(-2px);
}

.reference-thumbnail {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid #e5e7eb;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    position: relative;
    cursor: pointer;
}

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

.reference-thumbnail.no-reference {
    flex-direction: column;
    gap: 8px;
    color: #64748b;
    font-weight: 500;
}

.reference-thumbnail.no-reference i {
    font-size: 2rem;
    color: #94a3b8;
}

.reference-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* When radio is checked, style the thumbnail */
.reference-option input[type="radio"]:checked ~ .reference-thumbnail {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.reference-option input[type="radio"]:checked ~ .reference-thumbnail::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: #4f46e5;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    z-index: 10;
}

.reference-option label {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: color 0.3s;
    pointer-events: none; /* Prevent double-click issues */
}

.reference-option input[type="radio"]:checked ~ label {
    color: #4f46e5;
    font-weight: 600;
}

/* Make the entire option clickable */
.reference-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    cursor: pointer;
}

@media (max-width: 768px) {
    .reference-options {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .reference-thumbnail {
        height: 100px;
    }
    
    .avatar-groups {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        max-width: 600px;
    }
    
    .avatar-group-item {
        max-width: 250px;
    }
    
    .avatar-group-item img {
        height: 120px;
    }
}

/* Gallery Selection Modal */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.gallery-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-modal-content {
    background: radial-gradient(circle at 0 0, rgba(79, 17, 112, 0.95), rgba(36, 9, 59, 0.95));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    margin: auto;
}

/* Avatar Modal Specific Styles */
#avatarModal .gallery-modal-content {
    width: 1000px;
    max-width: 95vw;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.avatar-item {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
    background: rgba(255, 255, 255, 0.1);
}

.avatar-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.avatar-item.selected {
    border-color: #10b981;
    transform: scale(1.05);
}

.avatar-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 12px;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.avatar-item:hover .avatar-overlay {
    opacity: 1;
}

.avatar-selected-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #10b981;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.avatar-item.selected .avatar-selected-indicator {
    display: flex;
}

.avatar-loading,
.avatar-error {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    padding: 40px 20px;
}

.avatar-loading i,
.avatar-error i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.avatar-error h4 {
    margin-bottom: 10px;
    color: white;
}

/* Avatar Groups */
.avatar-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
    max-width: 800px;
    justify-content: center;
}

.avatar-group-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    max-width: 300px;
    width: 100%;
    justify-self: center;
}

.avatar-group-item:hover {
    transform: translateY(-5px);
    border-color: rgba(159, 16, 255, 0.6);
    background: rgba(159, 16, 255, 0.1);
    box-shadow: 0 10px 30px rgba(159, 16, 255, 0.3);
}

.avatar-group-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 10px;
}

.avatar-group-name {
    font-weight: 600;
    color: white;
    margin-bottom: 5px;
}

.avatar-group-count {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Voice Modal Styles */
.voice-select-btn {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(10px);
}

.voice-select-btn:hover {
    border-color: rgba(159, 16, 255, 0.6);
    background: rgba(159, 16, 255, 0.1);
    color: white;
}

.voice-select-btn.has-selection {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.2);
    color: white;
}

.voice-select-btn .placeholder {
    color: #9ca3af;
}

.voice-select-btn .selected-voice {
    color: #374151;
    font-weight: 500;
}

.voice-select-btn i {
    color: #9ca3af;
}

#voiceModal .gallery-modal-content {
    width: 900px;
    max-width: 95vw;
}

.voice-tabs {
    display: flex;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 5px;
}

.voice-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.voice-tab.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.voice-tab:hover {
    color: white;
}

.beta-tag {
    background: #ff6b6b;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(255, 107, 107, 0.3);
}

.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    max-height: 50vh;
    overflow-y: auto;
}

.voice-item {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.voice-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.voice-item.selected {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.voice-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.voice-name {
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.voice-gender {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 500;
}

.voice-gender.male {
    background: rgba(59, 130, 246, 0.3);
}

.voice-gender.female {
    background: rgba(236, 72, 153, 0.3);
}

.voice-preview-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.voice-play-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.voice-play-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.voice-play-btn.playing {
    background: #10b981;
}

.voice-waveform {
    flex: 1;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.voice-waveform::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: #10b981;
    border-radius: 15px;
    transition: width 0.1s linear;
}

.voice-loading,
.voice-error {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    padding: 40px 20px;
}

.voice-loading i,
.voice-error i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.voice-error h4 {
    margin-bottom: 10px;
    color: white;
}

.voice-tab-content {
    display: none;
}

.voice-tab-content.active {
    display: block;
}

.gallery-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: white;
}

.gallery-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.gallery-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.gallery-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.gallery-modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

/* Ensure gallery images don't get too large */
@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        max-width: 100%;
    }
}

@media (min-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

.gallery-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
    background: rgba(255, 255, 255, 0.1);
}

.gallery-image-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.gallery-image-item.selected {
    border-color: #10b981;
    transform: scale(1.05);
}

.gallery-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 8px;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-image-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gallery-image-name {
    font-weight: 500;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-image-provider {
    opacity: 0.8;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gallery-image-item:hover .gallery-image-overlay {
    opacity: 1;
}

.gallery-image-selected-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #10b981;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.gallery-image-item.selected .gallery-image-selected-indicator {
    display: flex;
}

.gallery-modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.gallery-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.gallery-modal-btn.primary {
    background: linear-gradient(135deg, #9f10ff 0%, #ff3ebb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(159, 16, 255, 0.3);
}

.gallery-modal-btn.primary:hover {
    background: linear-gradient(135deg, #8a0ee6 0%, #e635a6 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(159, 16, 255, 0.4);
}

.gallery-modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gallery-modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.gallery-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    padding: 40px 20px;
}

.gallery-empty i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.gallery-empty h4 {
    margin-bottom: 10px;
    color: white;
}

/* Audio Gallery Styles */
.audio-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.audio-gallery-item {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.audio-gallery-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(139, 69, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 69, 255, 0.2);
}

.audio-gallery-item.selected {
    background: rgba(139, 69, 255, 0.2);
    border-color: rgba(139, 69, 255, 0.8);
    box-shadow: 0 0 20px rgba(139, 69, 255, 0.4);
}

.audio-gallery-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: white;
}

.audio-gallery-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.audio-gallery-provider {
    background: rgba(139, 69, 255, 0.8);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.audio-gallery-date {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.audio-gallery-controls {
    margin-bottom: 10px;
}

.audio-gallery-controls audio {
    width: 100%;
    border-radius: 8px;
}

.audio-gallery-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-style: italic;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 3px solid rgba(139, 69, 255, 0.6);
}

/* Upload Options */
.upload-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.upload-option-btn {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.upload-option-btn:hover {
    border-color: rgba(159, 16, 255, 0.6);
    background: rgba(159, 16, 255, 0.1);
    color: white;
    transform: translateY(-1px);
}

.upload-option-btn.active {
    border-color: transparent;
    background: linear-gradient(135deg, #9f10ff 0%, #ff3ebb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(159, 16, 255, 0.3);
}

.upload-option-btn i {
    font-size: 1.1rem;
}

/* Small button variant */
.upload-option-btn.small-btn {
    flex: none;
    padding: 8px 12px;
    font-size: 0.875rem;
    min-width: auto;
    width: auto;
}

/* Scrollbar styling for gallery modal */
.gallery-modal-body::-webkit-scrollbar {
    width: 8px;
}

.gallery-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.gallery-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.gallery-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.video-btn.view {
    background: linear-gradient(135deg, #9f10ff 0%, #ff3ebb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(159, 16, 255, 0.3);
}

.video-btn.view:hover {
    background: linear-gradient(135deg, #8a0ee6 0%, #e635a6 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(159, 16, 255, 0.4);
}

.video-btn.extend {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.video-btn.extend:hover {
    background: linear-gradient(135deg, #0ea472 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Animation keyframes for messages */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

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

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

/* Validation error styles */
.validation-error {
    background: #fef2f2 !important;
    border: 1px solid #fecaca !important;
    color: #dc2626 !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    margin-top: 8px !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 8px !important;
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
    animation: fadeIn 0.3s ease-out !important;
}

.validation-error i {
    color: #dc2626 !important;
    margin-top: 2px !important;
    flex-shrink: 0 !important;
}

.image-action.enhance-btn {
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.image-action.enhance-btn:hover {
    background: linear-gradient(45deg, #4338ca, #6d28d9);
    transform: translateY(-2px);
}

.image-action.enhance-btn i {
    font-size: 14px;
}

.image-action.enhance-btn span {
    font-size: 12px;
    font-weight: 500;
}

.image-container.enhancing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    z-index: 2;
}

.image-container.enhancing::before {
    content: 'Enhancing...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    z-index: 3;
}

/* Sample Enhanced Image Container */
.sample-enhanced-image-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 300px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Before/After Comparison Styles */
.before-after-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
    overflow: hidden;
    border-radius: 12px;
    user-select: none;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure image container maintains dimensions during enhancement */
.image-container {
    position: relative;
    min-height: 300px;
    background: #f3f4f6;
    border-radius: 12px;
    overflow: hidden;
}

.before-image,
.after-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 12px;
    pointer-events: none;
}

.after-image {
    clip-path: inset(0 50% 0 0);
    transition: clip-path 0.1s ease;
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    z-index: 3;
    pointer-events: all;
}

.slider-handle:active {
    cursor: grabbing;
}

.slider-line {
    position: absolute;
    top: -50vh;
    left: 50%;
    width: 2px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(-50%);
    pointer-events: none;
}

.slider-circle {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.slider-circle:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.comparison-label {
    position: absolute;
    top: 20px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    z-index: 2;
    pointer-events: none;
}

.before-label {
    left: 20px;
}

.after-label {
    right: 20px;
}

.image-action.reset-btn {
    background: linear-gradient(45deg, #f59e0b, #d97706);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.image-action.reset-btn:hover {
    background: linear-gradient(45deg, #d97706, #b45309);
    transform: translateY(-2px);
}

.image-action.reset-btn i {
    font-size: 14px;
}

.image-action.reset-btn span {
    font-size: 12px;
    font-weight: 500;
}

/* Responsive adjustments for before/after */
@media (max-width: 768px) {
    .sample-enhanced-image-container {
        max-width: 100%;
        height: 250px;
        margin: 0 auto;
    }
    
    .before-after-container {
        max-width: 100% !important;
        max-height: 400px !important;
    }
    
    .slider-circle {
        width: 35px;
        height: 35px;
        font-size: 12px;
    }
    
    .comparison-label {
        font-size: 10px;
        padding: 6px 12px;
        top: 15px;
    }
    
    .before-label {
        left: 15px;
    }
    
    .after-label {
        right: 15px;
    }
}

@media (max-width: 480px) {
    .sample-enhanced-image-container {
        max-width: 100%;
        height: 200px;
        margin: 0 auto;
    }
    
    .before-after-container {
        max-width: 100% !important;
        max-height: 300px !important;
    }
    
    .gif-showcase {
        padding: 15px !important;
        margin: 15px 0 20px 0 !important;
    }
    
    .slider-circle {
        width: 30px;
        height: 30px;
        font-size: 10px;
    }
    
    .comparison-label {
        font-size: 9px;
        padding: 4px 8px;
        top: 10px;
    }
    
    .before-label {
        left: 10px;
    }
    
    .after-label {
        right: 10px;
    }
}

/* Ultra-small screens (320px and below) */
@media (max-width: 320px) {
    .sample-enhanced-image-container {
        height: 180px;
    }
    
    .gif-showcase {
        padding: 10px !important;
        margin: 10px 0 15px 0 !important;
    }
    
    .slider-circle {
        width: 25px;
        height: 25px;
        font-size: 8px;
    }
    
    .comparison-label {
        font-size: 8px;
        padding: 3px 6px;
        top: 8px;
    }
    
    .before-label {
        left: 8px;
    }
    
    .after-label {
        right: 8px;
    }
}

/* Reset button specific styling */
.image-actions-below .image-action.reset-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.image-actions-below .image-action.reset-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

/* Enhance button specific styling when below image */
.image-actions-below .image-action.enhance-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Generate Video Button Styles */
.image-action.generate-video-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.image-action.generate-video-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.image-action.generate-video-btn:active {
    transform: translateY(0);
}

.image-action.generate-video-btn i {
    font-size: 0.9rem;
}

/* Ensure proper spacing in image actions below */
.image-actions-below {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.enhanced-actions {
    gap: 8px;
}

.enhanced-actions .image-action {
    flex: 1;
    min-width: 120px;
}

/* Interactive Session Popup Styles */
.interactive-session-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.interactive-session-content {
    background: radial-gradient(circle at 0 0, rgba(79, 17, 112, 0.95), rgba(36, 9, 59, 0.95));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 90%;
    max-width: 1400px; /* 50% bigger than standard 900px modal */
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

.interactive-session-header {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
}

.interactive-session-header h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.interactive-session-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.interactive-session-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.interactive-session-body {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.session-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.session-control-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-width: 140px;
    justify-content: center;
}

.session-control-btn.start {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.session-control-btn.start:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.session-control-btn.stop {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.session-control-btn.stop:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.session-status {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    color: white;
    text-align: center;
}

.session-video-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    min-height: 500px; /* 50% bigger than standard 300px */
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    overflow: hidden;
}

@media (max-width: 768px) {
    .interactive-session-content {
        width: 95%;
        max-width: none;
        margin: 10px;
    }
    
    .interactive-session-header {
        padding: 20px;
    }
    
    .interactive-session-body {
        padding: 20px;
    }
    
    .session-video-container {
        min-height: 400px;
    }
    
    .session-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .session-control-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Enhanced Avatar Styles for Interactive Tab */
.streaming-avatar-item {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.streaming-avatar-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(79, 70, 229, 0.5);
    transform: translateY(-2px);
}

.streaming-avatar-item.selected {
    border-color: #4f46e5;
    background: rgba(79, 70, 229, 0.2);
}

.streaming-avatar-item .avatar-image-container {
    position: relative;
    margin-bottom: 10px;
}

.streaming-avatar-item .avatar-image-container img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    background: #333;
}

.streaming-avatar-item .avatar-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(79, 70, 229, 0.9);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.streaming-avatar-item.selected .avatar-overlay {
    opacity: 1;
}

.streaming-avatar-item .avatar-overlay i {
    color: white;
    font-size: 16px;
}

.streaming-avatar-item .avatar-category {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.streaming-avatar-item .avatar-info h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: bold;
    color: white;
}

.streaming-avatar-item .avatar-description {
    margin: 0;
    font-size: 12px;
    color: #ccc;
    line-height: 1.3;
    max-height: 3.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Enhance existing streaming avatar grid */
#streamingAvatarGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

@media (max-width: 768px) {
    #streamingAvatarGrid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .streaming-avatar-item .avatar-image-container img {
        height: 120px;
    }
    
    /* Credit cost mobile adjustments */
    .credit-cost {
        font-size: 0.7rem;
        padding: 3px 6px;
        top: -6px;
        right: -6px;
    }
    
    .credit-cost i {
        font-size: 0.6rem;
    }
} 