/* VLX Photo Capture Widget Styles */

.vlx-photocapture-widget {
    position: relative;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    /* Dimensions are now set inline via PHP based on layout proportion */
}

/* Theme Variables */
.vlx-photocapture-widget {
    /* Light theme (default) */
    --vlx-bg-primary: #ffffff;
    --vlx-bg-secondary: #f8fafc;
    --vlx-bg-tertiary: #f1f5f9;
    --vlx-text-primary: #1e293b;
    --vlx-text-secondary: #64748b;
    --vlx-text-muted: #94a3b8;
    --vlx-border-color: #e2e8f0;
    --vlx-border-light: #f1f5f9;
    --vlx-accent-color: #3b82f6;
    --vlx-accent-hover: #2563eb;
    --vlx-shadow-light: rgba(0, 0, 0, 0.1);
    --vlx-shadow-medium: rgba(0, 0, 0, 0.15);
    --vlx-shadow-heavy: rgba(0, 0, 0, 0.25);
}

.vlx-photocapture-widget.vlx-pc-theme-dark {
    /* Dark theme */
    --vlx-bg-primary: #1e293b;
    --vlx-bg-secondary: #0f172a;
    --vlx-bg-tertiary: #334155;
    --vlx-text-primary: #f8fafc;
    --vlx-text-secondary: #e2e8f0;
    --vlx-text-muted: #94a3b8;
    --vlx-border-color: #334155;
    --vlx-border-light: #475569;
    --vlx-accent-color: #6366f1;
    --vlx-accent-hover: #5b21b6;
    --vlx-shadow-light: rgba(0, 0, 0, 0.3);
    --vlx-shadow-medium: rgba(0, 0, 0, 0.4);
    --vlx-shadow-heavy: rgba(0, 0, 0, 0.6);
}

/* Dark theme specific overrides */
.vlx-photocapture-widget.vlx-pc-theme-dark .vlx-pc-button {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    color: #374151;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(255, 255, 255, 0.1) inset;
}

.vlx-photocapture-widget.vlx-pc-theme-dark .vlx-pc-button:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(255, 255, 255, 0.2) inset;
    transform: translateY(-5px);
}

.vlx-photocapture-widget.vlx-pc-theme-dark .vlx-pc-button-icon,
.vlx-photocapture-widget.vlx-pc-theme-dark .vlx-pc-button-text {
    color: #374151;
}

/* Start Over Button */
.vlx-pc-start-over-button {
    background: var(--vlx-bg-primary);
    border: 1px solid var(--vlx-border-color);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--vlx-shadow-light);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vlx-pc-start-over-button:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px var(--vlx-shadow-medium);
    background: var(--vlx-bg-secondary);
    border-color: var(--vlx-border-light);
}

.vlx-pc-start-over-button .vlx-pc-button-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-direction: row; /* Ensure horizontal layout */
}

.vlx-pc-start-over-button .vlx-pc-button-icon {
    font-size: 1rem;
    color: var(--vlx-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.vlx-pc-start-over-button .vlx-pc-button-icon i,
.vlx-pc-start-over-button .vlx-pc-button-icon svg {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

.vlx-pc-start-over-button .vlx-pc-button-text {
    color: var(--vlx-text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
}

/* Dark theme override for Start Over button */
.vlx-photocapture-widget.vlx-pc-theme-dark .vlx-pc-start-over-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.vlx-photocapture-widget.vlx-pc-theme-dark .vlx-pc-start-over-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.vlx-photocapture-widget.vlx-pc-theme-dark .vlx-pc-start-over-button .vlx-pc-button-icon,
.vlx-photocapture-widget.vlx-pc-theme-dark .vlx-pc-start-over-button .vlx-pc-button-text {
    color: var(--vlx-text-secondary);
}

/* Start Over Button Image Mode */
.vlx-pc-start-over-button img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Global Start Over Button (appears on all screens) */
.vlx-pc-start-over-button.vlx-pc-global-button {
    z-index: 100 !important; /* Ensure it appears above all screens */
    pointer-events: auto; /* Ensure it's always clickable */
}

/* Layout-specific styles */
.vlx-pc-layout-1080-1920 {
    /* Portrait layout - 1080x1920 */
}

.vlx-pc-layout-1920-1080 {
    /* Landscape layout - 1920x1080 */
}

/* Layout-specific button adjustments - these are overridden by main button layout settings */
.vlx-pc-layout-1920-1080 .vlx-pc-buttons-container:not(.vlx-pc-layout-vertical):not(.vlx-pc-layout-horizontal) {
    flex-direction: row; /* Default for landscape if no specific layout set */
}

.vlx-pc-layout-1080-1920 .vlx-pc-buttons-container:not(.vlx-pc-layout-vertical):not(.vlx-pc-layout-horizontal) {
    flex-direction: column; /* Default for portrait if no specific layout set */
}

/* Layout-specific button sizing */
.vlx-pc-layout-1920-1080 .vlx-pc-button {
    min-width: 300px;
    padding: 2.5rem;
}

.vlx-pc-layout-1080-1920 .vlx-pc-button {
    min-width: 250px;
    padding: 2rem;
}

/* Elementor backend preview styles - Resize container and transform content */

/* Use a more compatible approach - target by widget type class */
.elementor-editor-active .elementor-widget-vlx_photocapture_widget .elementor-widget-container {
    /* Default to portrait size - will be overridden by landscape if needed */
    width: 540px !important; /* 50% of 1080px */
    height: 960px !important; /* 50% of 1920px */
    max-width: none !important;
    max-height: none !important;
    overflow: hidden;
}

/* Override for landscape layout */
.elementor-editor-active .elementor-widget-vlx_photocapture_widget .elementor-widget-container:has(.vlx-pc-layout-1920-1080) {
    width: 960px !important; /* 50% of 1920px */
    height: 540px !important; /* 50% of 1080px */
}

/* Fallback without :has() - use JavaScript to add a class or detect layout */
.elementor-editor-active .elementor-widget-vlx_photocapture_widget.landscape-layout .elementor-widget-container {
    width: 960px !important; /* 50% of 1920px */
    height: 540px !important; /* 50% of 1080px */
}

/* Transform the vlx-photocapture-widget (keep it full size but scale and translate) */
.vlx-photocapture-widget.vlx-pc-editor-mode {
    /* Keep full size but scale to 50% and translate to fill the smaller container */
    transform: scale(0.5) translate(-50%, -50%);
    transform-origin: top left;
}

/* Override layout-specific button sizes for backend editor */
.vlx-photocapture-widget.vlx-pc-editor-mode.vlx-pc-layout-1920-1080 .vlx-pc-button,
.vlx-photocapture-widget.vlx-pc-editor-mode.vlx-pc-layout-1080-1920 .vlx-pc-button {
    /* Let transform scaling handle the sizing - remove fixed sizes */
    min-width: auto !important;
    padding: 2rem !important; /* This will be scaled by transform */
}

/* Layout-specific font sizes removed - let Elementor typography controls handle this */

.vlx-photocapture-widget.vlx-pc-editor-mode.vlx-pc-layout-1920-1080 .vlx-pc-button-icon,
.vlx-photocapture-widget.vlx-pc-editor-mode.vlx-pc-layout-1080-1920 .vlx-pc-button-icon {
    font-size: 3rem !important; /* This will be scaled by transform */
}

/* Simplified approach - let Elementor typography work with simple selector */

/* Layout-specific font sizes removed - let Elementor typography controls handle this */

/* Preview Screen Preview Mode Styles */
.vlx-pc-preview-screen-mode .vlx-pc-photo-polaroid-preview {
    background: transparent;
}

/* Camera Screen Preview Mode Styles */
.vlx-pc-camera-preview-container {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

/* Camera message and countdown default styling */
.vlx-pc-camera-message {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    /* Padding and border radius scale with font size for better proportions */
    padding: 0.8em 1.6em;
    border-radius: 2em;
}

.vlx-pc-camera-countdown {
    font-size: 6rem;
    font-weight: 900;
    color: #ffffff;
    /* Container size and border radius scale with font size - smaller container for better proportion */
    width: 1.5em;
    height: 1.5em;
    min-width: 60px;
    min-height: 60px;
    border-radius: 50%;
}

/* Camera preview elements inherit the same styling as the actual elements */
.vlx-pc-camera-preview-container .vlx-pc-camera-message,
.vlx-pc-camera-preview-container .vlx-pc-camera-countdown {
    transition: all 0.3s ease;
}

/* Photo Preview Screen Preview Mode Styles */
.vlx-pc-preview-screen-preview .vlx-pc-countdown {
    transition: all 0.3s ease;
}

.vlx-pc-preview-screen-preview .vlx-pc-btn {
    transition: all 0.3s ease;
    padding: 1rem 2rem;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    background: #f8f9fa;
    color: #333;
    font-weight: 600;
}

.vlx-pc-preview-screen-preview .vlx-pc-btn-confirm {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.vlx-pc-preview-screen-preview .vlx-pc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Photo Preview Options Screen Preview - ensure elements respond to Elementor controls */
.vlx-pc-preview-options-container .vlx-pc-processing-options h3 {
    transition: all 0.3s ease;
}

.vlx-pc-preview-options-container .vlx-pc-option-btn {
    transition: all 0.3s ease;
}

.vlx-pc-preview-options-container .vlx-pc-option-icon {
    transition: all 0.3s ease;
}

/* Make buttons visible in preview mode - override the hidden state */
.elementor-editor-active .vlx-pc-screen-options.active .vlx-pc-processing-options h3,
.elementor-editor-active .vlx-pc-screen-options.active .vlx-pc-option-buttons,
.elementor-editor-active .vlx-pc-screen-options.active .vlx-pc-option-btn {
    opacity: 1 !important;
    transform: none !important;
}

/* Ensure buttons are horizontally centered on both frontend and backend */
.vlx-pc-option-buttons {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

/* Center the processing options container */
.vlx-pc-processing-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

/* Ensure individual buttons are properly aligned */
.vlx-pc-option-btn {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Dynamic CSS selectors for camera screen preview - these will update automatically when settings change */
{{WRAPPER}} .vlx-pc-camera-preview-container {
    /* Width, position, background, border radius, and padding are handled inline in PHP */
}

/* Background Styles */
.vlx-pc-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.vlx-pc-bg-color,
.vlx-pc-bg-image,
.vlx-pc-bg-scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vlx-pc-bg-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Background Overlay Styles */
.vlx-pc-background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: 2;
    pointer-events: none;
}

/* Animated Blobs Scene */
.vlx-pc-scene-scene_blobs {
    overflow: hidden;
}

.vlx-pc-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    animation: float 20s infinite ease-in-out;
    opacity: var(--scene-opacity, 0.3);
}

.vlx-pc-blob-1 {
    width: 300px;
    height: 300px;
    background: var(--primary-color, #ff6b6b);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.vlx-pc-blob-2 {
    width: 200px;
    height: 200px;
    background: var(--secondary-color, #4ecdc4);
    top: 60%;
    right: 10%;
    animation-delay: -5s;
}

.vlx-pc-blob-3 {
    width: 250px;
    height: 250px;
    background: var(--accent-color, #45b7d1);
    bottom: 20%;
    left: 20%;
    animation-delay: -10s;
}

.vlx-pc-blob-4 {
    width: 180px;
    height: 180px;
    background: var(--primary-color, #ff6b6b);
    top: 30%;
    right: 30%;
    animation-delay: -15s;
}

.vlx-pc-blob-5 {
    width: 220px;
    height: 220px;
    background: var(--secondary-color, #4ecdc4);
    bottom: 10%;
    right: 20%;
    animation-delay: -7s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0px, 0px) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Particles Scene */
.vlx-pc-scene-scene_particles .vlx-pc-particles-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.vlx-pc-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color, #ff6b6b);
    border-radius: 50%;
    opacity: var(--scene-opacity, 0.3);
    animation: particleFloat 15s infinite linear;
}

.vlx-pc-particle:nth-child(even) {
    background: var(--secondary-color, #4ecdc4);
    animation-duration: 20s;
}

.vlx-pc-particle:nth-child(3n) {
    background: var(--accent-color, #45b7d1);
    animation-duration: 25s;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0px);
        opacity: 0;
    }
    10% {
        opacity: var(--scene-opacity, 0.3);
    }
    90% {
        opacity: var(--scene-opacity, 0.3);
    }
    100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

/* Waves Scene */
.vlx-pc-scene-scene_waves .vlx-pc-waves-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.vlx-pc-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 200px;
    opacity: var(--scene-opacity, 0.3);
    animation: wave 10s infinite linear;
}

.vlx-pc-wave-1 {
    background: linear-gradient(45deg, var(--primary-color, #ff6b6b), transparent);
    animation-delay: 0s;
}

.vlx-pc-wave-2 {
    background: linear-gradient(45deg, var(--secondary-color, #4ecdc4), transparent);
    animation-delay: -3s;
    height: 150px;
}

.vlx-pc-wave-3 {
    background: linear-gradient(45deg, var(--accent-color, #45b7d1), transparent);
    animation-delay: -6s;
    height: 100px;
}

@keyframes wave {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0%);
    }
}

/* Content Layer */
.vlx-pc-content {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Screen Management */
.vlx-pc-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.vlx-pc-screen.active {
    opacity: 1;
    visibility: visible;
}

/* Button Layouts */
.vlx-pc-buttons-container {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90%;
    /* Gap is now controlled by inline style from widget settings */
}

/* Main screen button layout variations */
.vlx-pc-buttons-container.vlx-pc-layout-horizontal {
    flex-direction: row;
    flex-wrap: wrap;
}

.vlx-pc-buttons-container.vlx-pc-layout-vertical {
    flex-direction: column;
}

/* Buttons */
.vlx-pc-button {
    background: var(--vlx-bg-primary);
    border: 1px solid var(--vlx-border-color);
    border-radius: 20px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px var(--vlx-shadow-medium);
    min-width: 200px;
    text-align: center;
}

.vlx-pc-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px var(--vlx-shadow-heavy);
    background: var(--vlx-bg-secondary);
    border-color: var(--vlx-border-light);
}

.vlx-pc-button img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.vlx-pc-button-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.vlx-pc-button-icon {
    font-size: 3rem;
    color: var(--vlx-text-primary);
}

.vlx-pc-button-text {
    /* font-size removed - let Elementor typography controls handle this */
    font-weight: 600;
    color: var(--vlx-text-primary);
}

/* QR Section - now integrated into button */
.vlx-pc-qr-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-height: auto;
}

.vlx-pc-qr-display {
    background: var(--vlx-bg-primary);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 3px 10px var(--vlx-shadow-light);
    border: 1px solid var(--vlx-border-color);
    margin-top: 0.5rem;
    display: none; /* Initially hidden */
}

.vlx-pc-qr-code {
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.vlx-pc-qr-text {
    margin: 0;
    color: var(--vlx-text-secondary);
    font-size: 0.8rem;
    max-width: 180px;
    line-height: 1.3;
}

/* Make both buttons same size */
.vlx-pc-photo-button,
.vlx-pc-qr-button {
    min-width: 200px;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* Ensure button content is properly spaced */
.vlx-pc-button-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: center;
}

/* Camera Styles */
.vlx-pc-camera-container {
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    /* Width, position, background, border-radius, and padding are now set inline via PHP */
}

/* Responsive camera container for different layouts */
.vlx-pc-layout-1080-1920 .vlx-pc-camera-container {
    max-width: 90%;
    max-height: 80%;
}

.vlx-pc-layout-1920-1080 .vlx-pc-camera-container {
    max-width: 80%;
    max-height: 90%;
}

.vlx-pc-camera-video,
.vlx-pc-camera-frozen {
    width: 100%;
    height: auto;
    display: block;
}

/* Camera overlay elements */
.vlx-pc-camera-message,
.vlx-pc-camera-countdown {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

.vlx-pc-camera-countdown {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vlx-pc-camera-message {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Add a subtle glow effect for message too */
.vlx-pc-camera-message::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50px;
    z-index: -1;
}

.vlx-pc-camera-flash {
    pointer-events: none;
    transition: opacity 0.1s ease-out;
}

/* Photo transition animations */
@keyframes photoCapturePulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes photoMorphToFinal {
    0% {
        /* Will be set dynamically by JavaScript */
    }
    100% {
        /* Will be set dynamically by JavaScript */
    }
}

@keyframes polaroidSlideIn {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes photoSlideIn {
    0% {
        transform: scale(0.8) translateY(20px);
        opacity: 0;
    }
    60% {
        transform: scale(1.02) translateY(-5px);
        opacity: 0.9;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes controlsSlideUp {
    0% {
        transform: translateY(40px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes countdownFadeIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes qrSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes qrFadeOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}

@keyframes progressFadeIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes uploadComplete {
    0% {
        transform: translate(-50%, -50%) scale(1);
        background: rgba(0, 0, 0, 0.8);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        background: rgba(34, 197, 94, 0.9);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        background: rgba(34, 197, 94, 0.9);
    }
}

@keyframes uploadImageReveal {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes buttonFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px);
    }
}

@keyframes containerSlideIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes qrFadeIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Animation classes for smooth transitions */
.vlx-pc-photo-preview {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vlx-pc-preview-controls {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.vlx-pc-countdown {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Individual button animations */
.vlx-pc-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.vlx-pc-btn:nth-child(1) {
    animation-delay: 0.1s;
}

.vlx-pc-btn:nth-child(2) {
    animation-delay: 0.2s;
}

/* Option button alignment fixes */
.vlx-pc-option-btn {
    justify-content: center;
    text-align: center;
}

.vlx-pc-option-btn .vlx-pc-option-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vlx-pc-option-btn span {
    text-align: center;
}

/* Initial hidden state for options screen elements */
.vlx-pc-screen-options .vlx-pc-processing-options h3 {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vlx-pc-screen-options .vlx-pc-option-buttons {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vlx-pc-screen-options .vlx-pc-option-btn {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Initial hidden state for preview screen elements */
.vlx-pc-screen-preview .vlx-pc-countdown {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vlx-pc-screen-preview .vlx-pc-preview-controls {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vlx-pc-screen-preview .vlx-pc-preview-controls .vlx-pc-btn {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Upload preview screen styles */
.vlx-pc-upload-preview-container {
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.vlx-pc-upload-progress-indicator {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced placeholder styling */
.vlx-pc-upload-placeholder {
    position: relative;
    overflow: hidden;
}

.vlx-pc-placeholder-pattern {
    animation: placeholderShimmer 4s ease-in-out infinite;
}

.vlx-pc-placeholder-geometry {
    animation: placeholderFloat 6s ease-in-out infinite;
}



@keyframes placeholderShimmer {
    0%, 100% {
        opacity: 0.8;
        transform: translateX(0) translateY(0);
    }
    25% {
        opacity: 0.9;
        transform: translateX(1px) translateY(-1px);
    }
    50% {
        opacity: 1;
        transform: translateX(0) translateY(-2px);
    }
    75% {
        opacity: 0.9;
        transform: translateX(-1px) translateY(-1px);
    }
}

@keyframes placeholderFloat {
    0%, 100% {
        opacity: 0.3;
        transform: translateY(0) rotate(0deg);
    }
    50% {
        opacity: 0.5;
        transform: translateY(-2px) rotate(0.5deg);
    }
}



/* Add subtle border to placeholder */
.vlx-pc-upload-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: inherit;
    pointer-events: none;
}

/* Upload progress animations */
@keyframes uploadProgressPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
        box-shadow: 0 0 0 rgba(255, 255, 255, 0), 0 0 0 rgba(0, 0, 0, 0);
    }
    20% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.9;
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 0 0 40px rgba(0, 0, 0, 0.6);
    }
    40% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 1;
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.5), 0 0 50px rgba(0, 0, 0, 0.7);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), 0 0 60px rgba(255, 255, 255, 0.3);
    }
}

/* Add subtle glow effect for upload progress indicator */
.vlx-pc-upload-progress-indicator::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

@keyframes uploadComplete {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
        background: rgba(0, 150, 0, 0.9);
    }
    100% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
}

/* Upload preview image animation */
@keyframes uploadImageReveal {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
        box-shadow: 0 0 0 rgba(255, 255, 255, 0), 0 0 0 rgba(0, 0, 0, 0);
    }
    15% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.8;
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.4), 0 0 30px rgba(0, 0, 0, 0.6);
    }
    30% {
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 1;
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.6), 0 0 50px rgba(0, 0, 0, 0.8);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 1;
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.5), 0 0 60px rgba(0, 0, 0, 0.7);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), 0 0 60px rgba(255, 255, 255, 0.3);
    }
}

@keyframes scaleOut {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
}

@keyframes messageAppear {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
        box-shadow: 0 0 0 rgba(255, 255, 255, 0), 0 0 0 rgba(0, 0, 0, 0);
    }
    20% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.9;
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.4), 0 0 40px rgba(0, 0, 0, 0.6);
    }
    40% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 1;
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.5), 0 0 50px rgba(0, 0, 0, 0.7);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), 0 0 60px rgba(255, 255, 255, 0.3);
    }
}

@keyframes messageDisappear {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
}

@keyframes cameraFlash {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    15% {
        opacity: 1;
        transform: scale(1.05);
    }
    30% {
        opacity: 0.9;
        transform: scale(1);
    }
    60% {
        opacity: 0.4;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

/* Add a subtle glow effect */
.vlx-pc-camera-countdown::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
}

.vlx-pc-camera-controls {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 20;
}

/* Generic Button Styles */
.vlx-pc-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50px;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.vlx-pc-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.vlx-pc-btn i {
    font-size: 1.2rem;
}

/* Photo Preview and Processing Styles */
.vlx-pc-preview-container,
.vlx-pc-options-container,
.vlx-pc-processing-container,
.vlx-pc-result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    max-width: 90%;
    width: 100%;
}

.vlx-pc-photo-preview,
.vlx-pc-photo-small,
.vlx-pc-final-photo {
    background: #fff;
    padding: 1rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.vlx-pc-preview-image,
.vlx-pc-options-image,
.vlx-pc-result-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    display: block;
}

/* Photo area positioning - ensure consistent rendering between frontend and backend */
.vlx-pc-photo-area {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vlx-pc-photo-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.vlx-pc-photo-small .vlx-pc-options-image {
    max-width: 200px;
    max-height: 200px;
}

.vlx-pc-countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    animation: countdownPulse 1s infinite;
}

@keyframes countdownPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

.vlx-pc-preview-controls,
.vlx-pc-option-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.vlx-pc-option-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 15px;
    padding: 1.5rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.vlx-pc-option-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.vlx-pc-option-btn i,
.vlx-pc-option-icon {
    font-size: 2rem;
    color: #333;
}

.vlx-pc-option-icon i,
.vlx-pc-option-icon svg {
    font-size: 2rem;
    color: #333;
    width: 2rem;
    height: 2rem;
}

.vlx-pc-option-btn span {
    font-weight: 600;
    color: #333;
}

/* Processing Spinner */
.vlx-pc-processing-container {
    justify-content: center;
    min-height: 300px;
}

.vlx-pc-spinner {
    width: 80px;
    height: 80px;
    position: relative;
}

.vlx-pc-spinner-circle {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.vlx-pc-processing-text {
    color: #fff;
    font-size: 1.2rem;
    text-align: center;
    margin: 0;
}

/* Upload Progress */
.vlx-pc-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    min-height: 200px;
    justify-content: center;
}

.vlx-pc-progress-bar {
    width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.vlx-pc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #45b7d1);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.vlx-pc-upload-text {
    color: #fff;
    font-size: 1.1rem;
    margin: 0;
}

/* Sharing Section */
.vlx-pc-sharing-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.vlx-pc-share-qr {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.vlx-pc-share-qr p {
    margin: 1rem 0 0 0;
    color: #666;
    font-size: 0.9rem;
}

/* Enhanced Button Animations */
.vlx-pc-button,
.vlx-pc-btn,
.vlx-pc-option-btn {
    position: relative;
    overflow: hidden;
}

.vlx-pc-button::before,
.vlx-pc-btn::before,
.vlx-pc-option-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.vlx-pc-button:active::before,
.vlx-pc-btn:active::before,
.vlx-pc-option-btn:active::before {
    width: 300px;
    height: 300px;
}

/* Notification animations */
@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;
    }
}

/* QR Code - no hover effects */
.vlx-pc-qr-code img {
    /* No transitions or hover effects */
}

/* Upload screen QR code */
.vlx-pc-upload-qr-code {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    background: var(--vlx-bg-primary);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px var(--vlx-shadow-heavy);
    backdrop-filter: blur(10px);
    border: 2px solid var(--vlx-border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.vlx-pc-upload-qr-code.hidden {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    pointer-events: none;
}

.vlx-pc-upload-qr-code .vlx-pc-qr-code {
    margin-bottom: 1rem;
    cursor: pointer;
}

.vlx-pc-upload-qr-code .vlx-pc-qr-text {
    margin: 0;
    color: var(--vlx-text-primary);
    font-size: 1rem;
    font-weight: 600;
    max-width: 250px;
    line-height: 1.4;
}

/* Button animation states */
.vlx-pc-button.animating {
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.vlx-pc-buttons-container.show-upload .vlx-pc-button:not(.vlx-pc-qr-button) {
    opacity: 0.3;
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.vlx-pc-buttons-container.show-upload .vlx-pc-qr-button .vlx-pc-qr-display {
    display: block;
    animation: qrSlideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
    .vlx-pc-buttons-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .vlx-pc-button {
        min-width: 250px;
        padding: 1.5rem;
    }

    .vlx-pc-photo-button,
    .vlx-pc-qr-button {
        min-width: 250px;
        min-height: 320px;
    }

    .vlx-pc-qr-display {
        padding: 0.8rem;
    }

    .vlx-pc-qr-text {
        font-size: 0.75rem;
        max-width: 160px;
    }

    .vlx-pc-camera-container {
        width: 95%;
    }

    .vlx-pc-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .vlx-pc-preview-controls,
    .vlx-pc-option-buttons {
        flex-direction: column;
        width: 100%;
    }

    .vlx-pc-option-btn {
        width: 100%;
        max-width: 250px;
    }

    .vlx-pc-progress-bar {
        width: 250px;
    }

    .vlx-pc-countdown {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }
}
