/**
 * Product Visualization - Wizard Styles
 * Upload zone, handle selector, email section, gallery, loading, preview, and result
 */

/* ===== Upload Zone ===== */
.pv-upload-zone {
    border: 2px dashed var(--pv-border-dashed);
    border-radius: var(--pv-radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--pv-transition-fast);
    background: var(--pv-gray-50);
}

.pv-upload-zone:hover,
.pv-upload-zone.dragover {
    border-color: var(--pv-primary);
    background: var(--pv-primary-lighter);
}

.pv-upload-zone.has-file {
    border-color: var(--pv-primary);
    background: var(--pv-primary-lighter);
}

.pv-upload-zone i {
    font-size: 3rem;
    color: var(--pv-primary);
    margin-bottom: 15px;
    display: block;
}

.pv-upload-zone h5 {
    color: var(--pv-gray-800);
    margin-bottom: 8px;
}

/* ===== Preview Container ===== */
.pv-preview-container {
    position: relative;
    max-width: 100%;
    margin: 20px auto;
    text-align: center;
}

.pv-preview-container.pop-in {
    animation: pvPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Image wrapper for positioning */
.pv-preview-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    border-radius: var(--pv-radius);
    overflow: hidden;
    border: 2px solid #e5e5e5;
    box-shadow: var(--pv-shadow-sm);
    /* Minimum dimensions to guarantee overlay content fits */
    min-height: 280px;
    min-width: 320px;
}

.pv-preview-image {
    width: 100%;
    min-height: 280px;
    object-fit: cover;
    display: block;
}

/* Blur effect when overlay is visible - instant on/off, no transition */
.pv-preview-image-wrapper.has-overlay .pv-preview-image {
    filter: blur(8px) brightness(0.7);
}

.pv-remove-image {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--pv-primary);
    color: var(--pv-white);
    border: 2px solid var(--pv-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: background var(--pv-transition-fast);
    z-index: 5;
}

.pv-remove-image:hover {
    background: var(--pv-primary-hover);
}

/* ===== Email Overlay (on top of preview image) ===== */
.pv-email-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--pv-radius);
}

/* Show state - simple display, no complex animations */
.pv-email-overlay.show {
    display: flex;
}

.pv-email-overlay-content {
    text-align: center;
    padding: 16px 12px;
    max-width: 300px;
    width: 100%;
}

/* Success message */
.pv-upload-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--pv-white);
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0;
    transform: scale(0.9);
}

.pv-email-overlay.show .pv-upload-success {
    animation: pvSuccessPop 0.4s ease forwards;
    animation-delay: 0.1s;
}

@keyframes pvSuccessPop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.pv-upload-success i {
    font-size: 1.2rem;
    color: #4ade80;
}

/* "Jeszcze jedno pytanie" text */
.pv-one-more-question {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
    font-style: italic;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(8px);
}

/* Animate when overlay is shown - with delay after success message */
.pv-email-overlay.show .pv-one-more-question {
    animation: pvContentFadeIn 0.4s ease forwards;
    animation-delay: 0.6s;
}

/* Email section overlay styling */
.pv-email-section-overlay {
    opacity: 0;
    transform: translateY(8px);
}

.pv-email-overlay.show .pv-email-section-overlay {
    animation: pvContentFadeIn 0.4s ease forwards;
    animation-delay: 0.9s;
}

@keyframes pvContentFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pv-email-section-overlay .pv-email-question {
    text-align: center;
}

.pv-email-section-overlay .pv-email-question-text {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    color: var(--pv-white);
    display: block;
    text-align: center;
    font-weight: 500;
}

.pv-email-section-overlay .pv-email-question-text i {
    font-size: 1rem;
    color: var(--pv-white);
    opacity: 0.8;
    display: block;
    margin: 0 auto 6px auto;
}

.pv-email-section-overlay .pv-email-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.pv-email-section-overlay .pv-email-buttons .btn {
    min-width: 100px;
    padding: 8px 14px;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: var(--pv-radius);
}

.pv-email-section-overlay .pv-email-buttons .btn-outline-light {
    border-width: 2px;
    color: var(--pv-white);
}

.pv-email-section-overlay .pv-email-buttons .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
}

.pv-email-section-overlay .pv-email-buttons .btn-primary {
    background: linear-gradient(135deg, var(--pv-primary) 0%, #e01020 100%);
    border: none;
    box-shadow: 0 2px 8px var(--pv-primary-shadow);
}

.pv-email-section-overlay .pv-email-buttons .btn-primary:hover {
    background: linear-gradient(135deg, #b8000d 0%, var(--pv-primary) 100%);
}

/* Email input in overlay */
.pv-email-section-overlay .pv-email-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.pv-email-section-overlay .pv-email-input-row input {
    flex: 1;
    border-radius: var(--pv-radius);
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 14px;
    font-size: 0.95rem;
}

.pv-email-section-overlay .pv-email-input-row input:focus {
    border-color: var(--pv-white);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
    outline: none;
}

.pv-email-section-overlay .pv-email-input-row .btn {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: var(--pv-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pv-email-section-overlay .pv-email-hint {
    display: block;
    font-size: 0.8rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

/* Generate button on overlay */
.pv-overlay-generate {
    margin-top: 16px;
    opacity: 0;
    transform: translateY(8px);
}

.pv-overlay-generate.show {
    animation: pvContentFadeIn 0.4s ease forwards;
}

.pv-overlay-generate .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--pv-radius);
    background: linear-gradient(135deg, var(--pv-primary) 0%, #e01020 100%);
    border: none;
    box-shadow: 0 4px 12px rgba(202, 0, 15, 0.4);
}

.pv-overlay-generate .btn:hover {
    background: linear-gradient(135deg, #b8000d 0%, var(--pv-primary) 100%);
    transform: scale(1.02);
}

.pv-overlay-generate .btn i {
    font-size: 1.1rem;
}

.pv-email-section-overlay .pv-email-confirmed,
.pv-email-section-overlay .pv-email-declined {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
    color: var(--pv-white);
}

.pv-email-section-overlay .pv-email-confirmed i {
    font-size: 1.1rem;
    color: #4ade80;
}

.pv-email-section-overlay .pv-email-declined i {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
}

.pv-email-section-overlay .pv-email-confirmed strong {
    color: var(--pv-white);
}

.pv-email-section-overlay .btn-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

.pv-email-section-overlay .btn-link:hover {
    color: var(--pv-white);
}

/* Slide in animation */
@keyframes pvSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide in animation - kept for other uses */

/* ===== Handle Side Selector ===== */
.pv-handle-selector {
    margin-bottom: 20px;
    padding: 14px 18px;
    background: var(--pv-gray-50);
    border: 1px solid var(--pv-border);
    border-radius: var(--pv-radius);
}

.pv-handle-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pv-handle-current {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--pv-gray-800);
    font-size: 0.95rem;
}

.pv-handle-current i {
    color: var(--pv-primary);
    font-size: 1.1rem;
}

.pv-handle-change-link {
    color: var(--pv-primary);
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 500;
}

.pv-handle-change-link:hover {
    color: var(--pv-primary-hover);
}

.pv-handle-options {
    display: none;
    gap: 0;
    margin-top: 14px;
}

.pv-handle-options.show {
    display: flex;
}

.pv-handle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    background: var(--pv-white);
    cursor: pointer;
    transition: all var(--pv-transition-fast);
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

.pv-handle-btn:first-child {
    border-radius: 6px 0 0 6px;
    border-right: 1px solid #ddd;
}

.pv-handle-btn:last-child {
    border-radius: 0 6px 6px 0;
    border-left: 1px solid #ddd;
}

.pv-handle-btn:hover {
    border-color: var(--pv-primary);
    background: var(--pv-primary-lighter);
    color: var(--pv-primary);
}

.pv-handle-btn.selected {
    border-color: var(--pv-primary);
    background: var(--pv-primary-light);
    color: var(--pv-primary);
}

.pv-handle-btn i {
    font-size: 1.1rem;
}

/* ===== Email Section ===== */
.pv-email-section {
    margin-top: 16px;
    padding: 16px;
    background: linear-gradient(135deg, var(--pv-gray-100) 0%, var(--pv-white) 100%);
    border-radius: var(--pv-radius-lg);
    border: 2px solid #e0e0e0;
    animation: pvFadeIn 0.4s ease-out;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.pv-email-section.pv-email-highlight {
    border-color: var(--pv-primary);
    box-shadow: 0 0 0 3px rgba(202, 0, 15, 0.2);
    animation: pvPulse 0.6s ease-in-out;
}

/* ===== Missing Requirements Highlight ===== */
.pv-highlight-missing {
    animation: pvHighlightMissing 0.5s ease-in-out 3 !important;
    border-color: var(--pv-primary) !important;
    box-shadow: 0 0 0 4px rgba(202, 0, 15, 0.3), 0 0 20px rgba(202, 0, 15, 0.2) !important;
    position: relative;
}

/* Specific styling for upload zone highlight */
.pv-upload-zone.pv-highlight-missing {
    background: rgba(202, 0, 15, 0.05) !important;
}

/* Specific styling for source options highlight */
.pv-source-option.pv-highlight-missing {
    background: rgba(202, 0, 15, 0.05) !important;
}

@keyframes pvHighlightMissing {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 4px rgba(202, 0, 15, 0.3), 0 0 20px rgba(202, 0, 15, 0.2);
    }
    50% {
        transform: scale(1.015);
        box-shadow: 0 0 0 6px rgba(202, 0, 15, 0.4), 0 0 30px rgba(202, 0, 15, 0.3);
    }
}

.pv-email-question {
    text-align: center;
}

.pv-email-question-text {
    margin: 0 0 14px 0;
    font-size: 0.95rem;
    color: var(--pv-gray-800);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.pv-email-question-text i {
    font-size: 1.1rem;
    color: var(--pv-primary);
}

.pv-email-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.pv-email-buttons .btn {
    min-width: 130px;
    padding: 10px 20px;
    font-weight: 500;
    border-radius: var(--pv-radius);
}

.pv-email-buttons .btn-primary {
    background: linear-gradient(135deg, var(--pv-primary) 0%, #e01020 100%);
    border: none;
    box-shadow: 0 2px 8px var(--pv-primary-shadow);
}

.pv-email-buttons .btn-primary:hover {
    background: linear-gradient(135deg, #b8000d 0%, var(--pv-primary) 100%);
    box-shadow: 0 4px 12px rgba(202, 0, 15, 0.4);
}

.pv-email-buttons .btn-outline-secondary {
    border-width: 2px;
}

.pv-email-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.pv-email-input-row input {
    flex: 1;
    border-radius: var(--pv-radius);
    border: 2px solid #e0e0e0;
    padding: 10px 14px;
    font-size: 0.95rem;
}

.pv-email-input-row input:focus {
    border-color: var(--pv-primary);
    box-shadow: 0 0 0 3px rgba(202, 0, 15, 0.1);
    outline: none;
}

.pv-email-input-row .btn {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: var(--pv-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pv-email-hint {
    display: block;
    font-size: 0.8rem;
    text-align: center;
}

.pv-email-confirmed,
.pv-email-declined {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
}

.pv-email-confirmed i,
.pv-email-declined i {
    font-size: 1.1rem;
}

.pv-email-confirmed strong {
    color: var(--pv-primary);
}

/* ===== Source Selector (Mobile) ===== */
.pv-source-selector {
    display: none;
    gap: 12px;
    margin-bottom: 20px;
}

.pv-source-option {
    flex: 1;
    padding: 24px 16px;
    border: 2px solid #e5e5e5;
    border-radius: var(--pv-radius-xl);
    background: var(--pv-white);
    cursor: pointer;
    transition: all var(--pv-transition-fast);
    text-align: center;
}

.pv-source-option:hover {
    border-color: var(--pv-primary);
    background: var(--pv-primary-lighter);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(202, 0, 15, 0.15);
}

.pv-source-option:active {
    transform: translateY(0);
    box-shadow: none;
}

.pv-source-option i {
    font-size: 2.2rem;
    color: var(--pv-primary);
    display: block;
    margin-bottom: 12px;
}

.pv-source-option span {
    font-weight: 600;
    color: var(--pv-gray-800);
    display: block;
    font-size: 1rem;
}

/* ===== Upload Progress ===== */
.pv-upload-progress {
    padding: 30px 20px;
    text-align: center;
    background: var(--pv-gray-50);
    border: 2px solid #e5e5e5;
    border-radius: var(--pv-radius);
}

.pv-upload-progress-filename {
    font-weight: 600;
    color: var(--pv-gray-800);
    margin-bottom: 16px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pv-upload-progress-filename i {
    color: var(--pv-primary);
}

.pv-upload-progress-bar-container {
    width: 100%;
    max-width: 300px;
    height: 6px;
    background: #e5e5e5;
    border-radius: 3px;
    margin: 0 auto 12px;
    overflow: hidden;
}

.pv-upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--pv-primary), #e01020);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    animation: pvProgressPulse 1.5s ease-in-out infinite;
}

.pv-upload-progress-text {
    color: #666;
    font-size: 0.85rem;
}

/* ===== Loading Overlay ===== */
.pv-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--pv-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--pv-radius);
    z-index: 10;
    padding: 40px 20px;
    box-sizing: border-box;
}

.pv-loading-spinner {
    width: 60px;
    height: 60px;
    position: relative;
}

.pv-loading-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid #f0f0f0;
    border-top: 3px solid var(--pv-primary);
    border-radius: 50%;
    animation: pvSpin 0.8s linear infinite;
}

.pv-loading-spinner::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
    border: 3px solid #f0f0f0;
    border-bottom: 3px solid var(--pv-primary);
    border-radius: 50%;
    animation: pvSpin 1.2s linear infinite reverse;
}

.pv-loading-text-container {
    margin-top: 24px;
    height: 32px;
    overflow: visible;
    position: relative;
    width: 300px;
    text-align: center;
}

.pv-loading-text {
    color: var(--pv-gray-800);
    font-weight: 600;
    font-size: 1rem;
    position: absolute;
    width: 100%;
    left: 0;
    top: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    white-space: nowrap;
}

.pv-loading-text.active {
    opacity: 1;
    transform: translateY(0);
}

.pv-loading-text.exit {
    opacity: 0;
    transform: translateY(-20px);
}

.pv-loading-subtext {
    color: #888;
    font-size: 0.85rem;
    margin-top: 12px;
}

.pv-loading-progress {
    display: flex;
    gap: 6px;
    margin-top: 20px;
}

.pv-loading-dot {
    width: 8px;
    height: 8px;
    background: #ddd;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.pv-loading-dot.active,
.pv-loading-dot.completed {
    background: var(--pv-primary);
}

/* ===== Result Container ===== */
.pv-result-container {
    text-align: center;
    padding: 20px;
}

.pv-result-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.pv-result-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--pv-gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.pv-result-product-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--pv-primary);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: var(--pv-radius-sm);
    background: var(--pv-primary-light);
    transition: all var(--pv-transition-fast);
}

.pv-result-product-link:hover {
    background: rgba(202, 0, 15, 0.15);
    color: var(--pv-primary-hover);
}

/* Image wrapper for fullscreen button overlay */
.pv-result-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.pv-result-image {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: var(--pv-radius);
    border: 1px solid var(--pv-border);
    display: block;
}

.pv-fullscreen-btn {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--pv-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--pv-radius-round);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--pv-transition-fast);
    opacity: 0.9;
}

.pv-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    opacity: 1;
    transform: translateX(-50%) scale(1.02);
}

.pv-fullscreen-btn i {
    font-size: 1rem;
}

/* ===== Gallery Step (Step 0) ===== */
.pv-gallery-step {
    padding: 10px 0;
}

.pv-gallery-header {
    text-align: center;
    margin-bottom: 20px;
}

.pv-gallery-header h6 {
    font-weight: 600;
    color: var(--pv-gray-800);
    margin-bottom: 4px;
}

.pv-gallery-header p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

.pv-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    max-height: 350px;
    overflow-y: auto;
    padding: 4px;
    align-items: start;
}

.pv-gallery-item {
    position: relative;
    border-radius: var(--pv-radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--pv-transition-fast), box-shadow var(--pv-transition-fast);
    background: #f5f5f5;
    aspect-ratio: 1 / 1;
    min-height: 120px;
    max-height: 180px;
}

.pv-gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--pv-shadow-lg);
}

.pv-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pv-gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--pv-white);
    padding: 24px 10px 10px;
    font-size: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pv-gallery-product-info {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pv-gallery-product-name {
    font-size: 0.75rem;
    color: var(--pv-white);
}

.pv-gallery-product-link {
    color: var(--pv-white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color var(--pv-transition-fast);
}

.pv-gallery-product-link:hover {
    color: #ffaaaa;
}

.pv-gallery-product-link i {
    font-size: 0.65rem;
    opacity: 0.8;
}

.pv-gallery-date {
    font-size: 0.65rem;
    opacity: 0.7;
}

.pv-gallery-nav {
    text-align: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--pv-border);
}

.pv-gallery-nav .btn-link {
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color var(--pv-transition-fast);
}

.pv-gallery-nav .btn-link:hover {
    color: var(--pv-primary);
}

.pv-gallery-new-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pv-gray-100) 0%, var(--pv-gray-200) 100%);
    border: 2px dashed var(--pv-gray-300);
    color: var(--pv-gray-600);
    font-size: 0.85rem;
    gap: 8px;
    aspect-ratio: 1 / 1;
    min-height: 120px;
    max-height: 180px;
    border-radius: var(--pv-radius-lg);
    cursor: pointer;
    transition: all var(--pv-transition-fast);
}

.pv-gallery-new-btn:hover {
    border-color: var(--pv-primary);
    color: var(--pv-primary);
    background: linear-gradient(135deg, #fff5f5 0%, #ffecec 100%);
}

.pv-gallery-new-btn i {
    font-size: 1.5rem;
}

/* ===== Desktop/Mobile Text Switching ===== */
.pv-desktop-text {
    display: block;
}

.pv-mobile-text {
    display: none;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 992px) {
    .pv-source-selector {
        display: flex;
    }

    #pvUploadSection {
        display: none !important;
    }

    .pv-desktop-text {
        display: none !important;
    }

    .pv-mobile-text {
        display: block !important;
    }

    .pv-instructions {
        display: none !important;
    }
}

@media (max-width: 768px) {
    /* Guarantee minimum dimensions on mobile for tall images */
    .pv-preview-image-wrapper {
        min-height: 260px;
        min-width: 280px;
    }

    .pv-preview-image {
        min-height: 260px;
    }

    /* Email overlay mobile - compact */
    .pv-email-overlay-content {
        padding: 12px 10px;
        max-width: 260px;
    }

    .pv-upload-success {
        font-size: 0.85rem;
        margin-bottom: 8px;
        gap: 6px;
    }

    .pv-upload-success i {
        font-size: 1rem;
    }

    .pv-one-more-question {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }

    .pv-email-section-overlay .pv-email-question-text {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }

    .pv-email-section-overlay .pv-email-question-text i {
        font-size: 0.9rem;
    }

    .pv-email-section-overlay .pv-email-buttons {
        gap: 6px;
    }

    .pv-email-section-overlay .pv-email-buttons .btn {
        min-width: 90px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .pv-email-section-overlay .pv-email-input-row {
        gap: 6px;
    }

    .pv-email-section-overlay .pv-email-input-row input {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .pv-email-section-overlay .pv-email-input-row .btn {
        width: 40px;
        height: 38px;
    }

    .pv-email-section-overlay .pv-email-confirmed,
    .pv-email-section-overlay .pv-email-declined {
        font-size: 0.75rem;
        text-align: center;
    }

    .pv-email-section-overlay .pv-email-hint {
        font-size: 0.7rem;
    }

    .pv-source-selector {
        gap: 10px;
        margin-bottom: 16px;
    }

    .pv-source-option {
        padding: 20px 12px;
    }

    .pv-source-option i {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .pv-source-option span {
        font-size: 0.9rem;
    }

    .pv-upload-zone {
        padding: 25px 15px;
    }

    .pv-upload-zone i {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .pv-upload-zone h5 {
        font-size: 1rem;
    }

    .pv-handle-selector {
        padding: 12px 14px;
        margin-bottom: 16px;
    }

    .pv-handle-current {
        font-size: 0.9rem;
    }

    .pv-handle-change-link {
        font-size: 0.85rem;
    }

    .pv-handle-options {
        margin-top: 12px;
    }

    .pv-handle-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .pv-preview-image {
        max-height: 200px;
    }

    .pv-preview-container {
        margin: 14px auto;
    }

    .pv-loading-overlay {
        min-height: 250px !important;
        padding: 30px 20px !important;
        justify-content: center;
    }

    .pv-loading-spinner {
        width: 50px;
        height: 50px;
    }

    .pv-loading-text-container {
        margin-top: 20px;
        height: 28px;
        width: 100%;
        max-width: 280px;
        overflow: visible;
    }

    .pv-loading-text {
        font-size: 0.85rem;
        line-height: 1.3;
        white-space: nowrap;
    }

    .pv-loading-subtext {
        font-size: 0.8rem;
        margin-top: 10px;
    }

    .pv-loading-progress {
        margin-top: 16px;
    }

    .pv-loading-dot {
        width: 7px;
        height: 7px;
    }

    .pv-result-image {
        max-height: 55vh;
        border-radius: 6px;
    }

    .pv-result-container {
        padding: 10px;
    }

    .pv-result-title {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }

    .pv-fullscreen-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
        bottom: 8px;
    }

    .pv-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        max-height: 300px;
        gap: 8px;
    }

    .pv-gallery-item,
    .pv-gallery-new-btn {
        min-height: 100px;
        max-height: 150px;
    }
}

@media (max-width: 400px) {
    /* Smaller min-width for very small screens */
    .pv-preview-image-wrapper {
        min-width: 240px;
    }

    .pv-email-overlay-content {
        max-width: 220px;
        padding: 10px 8px;
    }

    .pv-source-selector {
        flex-direction: column;
        gap: 8px;
    }

    .pv-source-option {
        flex-direction: row;
        justify-content: center;
        gap: 12px;
        text-align: left;
        padding: 16px;
    }

    .pv-source-option i {
        font-size: 1.5rem;
        margin-bottom: 0;
    }

    .pv-source-option span {
        display: inline;
    }
}
