/**
 * Enhanced Frontend Styles for Photo Uploader Plugin
 * 
 * Modern design system with comprehensive theming and accessibility
 */

/* Import Design System */
@import url('design-system.css');

/* Plugin-specific CSS Custom Properties */
:root {
    /* Default branding colors - can be overridden by dynamic CSS */
    --pu-primary: #007cba;
    --pu-secondary: #005a87;
    --pu-accent: #00a0d2;
    --pu-text: #333333;
    --pu-primary-light: #2196f3;
    --pu-primary-dark: #004a6b;
    --pu-accent-light: #b3e5fc;
    --pu-secondary-light: #1976d2;

    /* RGB values for transparency effects */
    --pu-primary-rgb: 0, 124, 186;
    --pu-secondary-rgb: 0, 90, 135;
    --pu-accent-rgb: 0, 160, 210;

    /* Legacy support - map to design system */
    --photo-uploader-primary: var(--pu-primary);
    --photo-uploader-secondary: var(--pu-secondary);
    --photo-uploader-accent: var(--pu-accent);
    --photo-uploader-success: var(--color-success-500);
    --photo-uploader-warning: var(--color-warning-500);
    --photo-uploader-danger: var(--color-error-500);
    --photo-uploader-light: var(--color-neutral-50);
    --photo-uploader-dark: var(--color-neutral-800);
    --photo-uploader-border: var(--color-neutral-200);
    --photo-uploader-shadow: var(--shadow-sm);
    --photo-uploader-shadow-lg: var(--shadow-lg);
    --photo-uploader-border-radius: var(--radius-lg);
    --photo-uploader-transition: var(--duration-200) var(--ease-in-out);

    /* Component-specific variables - Adaptive widths */
    --uploader-max-width: min(95vw, 1200px);
    --uploader-max-width-tablet: min(96vw, 1400px);
    --uploader-max-width-desktop: min(96vw, 2000px);
    --uploader-max-width-large: min(95vw, 2400px);
    --uploader-max-width-xl: min(94vw, 2800px);
    --gallery-item-size: 160px;
    --gallery-gap: var(--space-3);
    --upload-area-height: 240px;
    --upload-area-compact-height: 140px;
}

/* ===== SIMPLE GALLERY VISIBILITY TOGGLE ===== */
/* Default state: Gallery hidden when no images */
.photo-uploader-gallery-section {
    display: none;
}

/* Gallery visible when it has images */
.photo-uploader-gallery-section.has-images {
    display: block;
}

/* ===== GALLERY GRID LAYOUT ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--gallery-item-size, 160px), 1fr));
    gap: var(--gallery-gap, 15px);
    margin-top: var(--space-4);
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border: 2px solid var(--color-neutral-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-neutral-50);
    transition: all var(--duration-200) var(--ease-in-out);
}

.gallery-item:hover {
    border-color: var(--pu-primary, #007cba);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== GALLERY PLACEHOLDER ===== */
.gallery-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    text-align: center;
    color: var(--color-neutral-500);
    background: var(--color-neutral-50);
    border: 2px dashed var(--color-neutral-300);
    border-radius: var(--radius-lg);
    margin: var(--space-4) 0;
    min-height: 120px;
}

.gallery-placeholder .placeholder-icon {
    font-size: 48px;
    margin-bottom: var(--space-3);
    opacity: 0.6;
}

.gallery-placeholder .placeholder-text {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: 500;
}

/* Hide placeholder when gallery has items */
.gallery-grid:not(:empty)+.gallery-placeholder,
.gallery-grid:not(:empty)~.gallery-placeholder {
    display: none;
}

/* Pricing placeholder */
.pricing-placeholder {
    padding: var(--space-4);
    text-align: center;
    color: var(--color-neutral-500);
    background: var(--color-neutral-50);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-md);
}

.pricing-placeholder p {
    margin: 0;
    font-size: var(--font-size-sm);
}

/* ===== MAIN CONTAINER ===== */
.photo-uploader-container {
    max-width: var(--uploader-max-width);
    width: 100%;
    margin: 0 auto;
    padding: var(--space-6);
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: var(--line-height-normal);
    color: var(--color-neutral-800);
    position: relative;
    background-color: var(--color-neutral-0) !important;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-neutral-200);
    box-sizing: border-box;
    overflow: hidden;
    contain: layout style;
    transition: max-width var(--duration-300) var(--ease-in-out);
}

/* Ensure main container has light background (only override dark mode, not branding) */
.photo-uploader-container {
    /* Only override if dark mode colors are being applied */
    background-color: var(--color-neutral-0);
}

/* Ensure base text colors are readable but allow branding overrides */
.photo-uploader-container {
    color: var(--color-neutral-800);
}




.photo-uploader-container.theme-minimal {
    box-shadow: none;
    border: 1px solid var(--color-neutral-300);
    border-radius: var(--radius-lg);
}

.photo-uploader-container.theme-rounded {
    border-radius: var(--radius-3xl);
}

/* ===== PRICING DISPLAY STYLES ===== */
.pricing-display,
.tier-pricing-display,
div.pricing-display,
div.tier-pricing-display {
    margin: var(--space-6) 0 !important;
    padding: var(--space-4) !important;
    background: var(--color-neutral-50) !important;
    border: 1px solid rgba(156, 163, 175, 0.4) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xs) !important;
}

/* More muted professional styling for tier pricing display */
.tier-pricing-display,
div.tier-pricing-display,
[class*="tier-pricing-display"] {
    border: 1px solid rgba(156, 163, 175, 0.25) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    background: linear-gradient(135deg, var(--color-neutral-0) 0%, var(--color-neutral-50) 100%) !important;
}

/* Override any inline styles for professional muted appearance */
div[class*="tier-pricing-display"][style],
div[class*="pricing-display"][style] {
    border-color: rgba(156, 163, 175, 0.25) !important;
    border-width: 1px !important;
    border-style: solid !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    background: linear-gradient(135deg, var(--color-neutral-0) 0%, var(--color-neutral-50) 100%) !important;
}

/* Ensure muted borders for all pricing components */
.photo-uploader-container .pricing-display,
.photo-uploader-container .tier-pricing-display,
.photo-uploader-interface .pricing-display,
.photo-uploader-interface .tier-pricing-display {
    border: 1px solid rgba(156, 163, 175, 0.25) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

/* Professional Tier Pricing Strip with Enhanced Spacing */
.tier-pricing-strip {
    margin: var(--space-8) auto var(--space-8) auto;
    padding: var(--space-8) var(--space-6);
    max-width: 1000px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
    border: 1px solid rgba(var(--pu-primary-rgb, 0, 124, 186), 0.3);
    border-radius: 20px;
    box-shadow:
        0 8px 32px rgba(0, 124, 186, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Removed secondary decorative bar for cleaner appearance */

.tier-strip-header {
    text-align: center;
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid rgba(var(--pu-primary-rgb, 0, 124, 186), 0.1);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.tier-strip-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--pu-primary);
    margin: 0 0 var(--space-4) 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'SF Pro Display', system-ui, sans-serif;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    line-height: 1.2;
}

.tier-strip-title::before {
    content: '💎';
    font-size: var(--text-lg);
}

.tier-strip-subtitle {
    font-size: var(--text-lg);
    color: #64748b;
    margin: 0;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    line-height: 1.4;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.tier-strip-container {
    position: relative;
    overflow-x: auto;
    padding: var(--space-4) 0;
    margin: 0 auto;
    max-width: 900px;
}

.tier-strip-track {
    display: flex;
    gap: var(--space-4);
    min-width: 100%;
    padding: 0 var(--space-4);
    justify-content: center;
    align-items: stretch;
}

/* Professional Tier Items with Enhanced Spacing and Centering */
.tier-item {
    flex: 1;
    max-width: 200px;
    min-width: 180px;
    padding: var(--space-6) var(--space-4);
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border: 2px solid rgba(var(--pu-primary-rgb, 0, 124, 186), 0.25);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--duration-300) cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow:
        0 4px 12px rgba(0, 124, 186, 0.1),
        0 2px 6px rgba(0, 0, 0, 0.05);
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.tier-item:hover {
    border-color: var(--pu-primary);
    background: linear-gradient(135deg, #ffffff 0%, rgba(var(--pu-primary-rgb, 0, 124, 186), 0.05) 100%);
    box-shadow:
        0 4px 16px rgba(0, 124, 186, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px) scale(1.02);
}

.tier-item.active {
    border-color: var(--pu-primary);
    background: linear-gradient(135deg, rgba(var(--pu-primary-rgb, 0, 124, 186), 0.08) 0%, rgba(var(--pu-primary-rgb, 0, 124, 186), 0.12) 100%);
    box-shadow:
        0 6px 20px rgba(0, 124, 186, 0.2),
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateY(-4px) scale(1.03);
}

.tier-item.best-value::before {
    content: 'Best Value';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--pu-accent);
    color: var(--color-neutral-0);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.tier-quantity {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    color: #334155;
    margin-bottom: var(--space-4);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    letter-spacing: 0.01em;
    line-height: 1.3;
}

.tier-price {
    font-size: var(--text-2xl);
    font-weight: var(--font-black);
    color: var(--pu-primary);
    margin-bottom: var(--space-3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'SF Pro Display', system-ui, sans-serif;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(0, 124, 186, 0.1);
    line-height: 1.1;
}

.tier-savings {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-success-700);
    background: var(--color-success-100);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    display: inline-block;
    border: 1px solid var(--color-success-200);
    margin-top: var(--space-2);
}

.tier-badge {
    display: none;
    /* Hidden by default, shown via best-value class */
}

/* Pricing Summary - Enhanced Typography */
.pricing-summary {
    background: linear-gradient(135deg, var(--color-neutral-0) 0%, var(--color-neutral-50) 100%);
    border: 1px solid var(--color-neutral-300);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    font-size: var(--text-sm);
    box-shadow: var(--shadow-sm);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
}

.price-breakdown {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    border-bottom: 1px solid var(--color-neutral-200);
    font-size: var(--text-sm);
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-1);
    transition: all var(--duration-200) var(--ease-in-out);
}

.price-line:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
    box-shadow: var(--shadow-xs);
}

.price-line:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.price-line.total-price {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--pu-primary);
    border: 2px solid var(--pu-primary);
    background: linear-gradient(135deg, rgba(0, 124, 186, 0.05) 0%, rgba(0, 124, 186, 0.1) 100%);
    margin-top: var(--space-2);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.price-line.total-price:hover {
    background: linear-gradient(135deg, rgba(0, 124, 186, 0.1) 0%, rgba(0, 124, 186, 0.15) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.price-label {
    font-weight: var(--font-semibold);
    color: var(--color-neutral-700);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    letter-spacing: 0.01em;
}

.price-value {
    font-weight: var(--font-bold);
    color: var(--color-neutral-900);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'SF Pro Display', system-ui, sans-serif;
    letter-spacing: -0.01em;
}

.total-price .price-label {
    color: var(--pu-primary);
    font-weight: var(--font-bold);
}

.total-price .price-value {
    color: var(--pu-primary);
    font-size: var(--text-xl);
    font-weight: var(--font-black);
    text-shadow: 0 1px 2px rgba(0, 124, 186, 0.1);
}

/* Current Pricing Display - Enhanced */
.current-pricing-display {
    margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(135deg, rgba(0, 124, 186, 0.08) 0%, rgba(0, 124, 186, 0.12) 100%);
    border: 1px solid rgba(0, 124, 186, 0.2);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--pu-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'SF Pro Display', system-ui, sans-serif;
    letter-spacing: 0.01em;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-200) var(--ease-in-out);
}

.current-pricing-display:hover {
    background: linear-gradient(135deg, rgba(0, 124, 186, 0.12) 0%, rgba(0, 124, 186, 0.16) 100%);
    border-color: rgba(0, 124, 186, 0.3);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Responsive Design for Tier Pricing - Enhanced Mobile Experience */
@media (max-width: 768px) {
    .tier-pricing-strip {
        padding: var(--space-6) var(--space-4);
        margin: var(--space-6) auto;
        border-radius: 16px;
        max-width: 95%;
    }

    .tier-strip-header {
        margin-bottom: var(--space-6);
        padding-bottom: var(--space-4);
    }

    .tier-strip-title {
        font-size: var(--text-xl);
        gap: var(--space-2);
        margin-bottom: var(--space-3);
    }

    .tier-strip-title::before {
        font-size: var(--text-lg);
    }

    .tier-strip-subtitle {
        font-size: var(--text-base);
    }

    .tier-strip-container {
        padding: var(--space-3) 0;
        max-width: 100%;
    }

    .tier-strip-track {
        gap: var(--space-3);
        padding: 0 var(--space-2);
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .tier-strip-track::-webkit-scrollbar {
        display: none;
    }

    .tier-item {
        min-width: 140px;
        max-width: 140px;
        padding: var(--space-4) var(--space-3);
        flex-shrink: 0;
    }

    .tier-quantity {
        font-size: var(--text-base);
        margin-bottom: var(--space-3);
    }

    .tier-price {
        font-size: var(--text-xl);
        margin-bottom: var(--space-2);
    }

    .tier-item.active .tier-price {
        font-size: var(--text-2xl);
    }

    .tier-savings {
        font-size: var(--text-xs);
        padding: 2px var(--space-2);
        margin-top: var(--space-1);
    }

    .tier-item .tier-badge {
        font-size: var(--text-xs);
        padding: 2px var(--space-2);
        top: -6px;
    }
}

@media (max-width: 480px) {
    .tier-pricing-strip {
        padding: var(--space-5) var(--space-3);
        margin: var(--space-5) auto;
        border-radius: 14px;
        max-width: 98%;
    }

    .tier-strip-header {
        margin-bottom: var(--space-5);
        padding-bottom: var(--space-3);
    }

    .tier-strip-title {
        font-size: var(--text-lg);
        flex-direction: row;
        gap: var(--space-2);
        margin-bottom: var(--space-2);
    }

    .tier-strip-title::before {
        font-size: var(--text-base);
    }

    .tier-strip-subtitle {
        font-size: var(--text-sm);
    }

    .tier-strip-container {
        padding: var(--space-2) 0;
    }

    .tier-strip-track {
        gap: var(--space-2);
        padding: 0 var(--space-1);
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .tier-strip-track::-webkit-scrollbar {
        display: none;
    }

    .tier-item {
        min-width: 120px;
        max-width: 120px;
        padding: var(--space-3) var(--space-2);
        flex-shrink: 0;
    }

    .tier-quantity {
        font-size: var(--text-sm);
        margin-bottom: var(--space-2);
    }

    .tier-price {
        font-size: var(--text-lg);
        margin-bottom: var(--space-1);
    }

    .tier-item.active .tier-price {
        font-size: var(--text-xl);
    }

    .tier-savings {
        font-size: 10px;
        padding: 1px var(--space-1);
        margin-top: var(--space-1);
    }
}

/* ===== Z-INDEX HIERARCHY ===== */
/* 
 * Z-Index Scale for Photo Uploader Plugin:
 * 1-999: Normal content layers
 * 1000-9999: Overlays, tooltips, dropdowns
 * 10000-99999: Modals (crop, help, etc.)
 * 100000+: Confirmation dialogs (highest priority)
 */

/* ===== CROP MODAL STYLES ===== */
.crop-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.8) !important;
    z-index: var(--z-crop-modal) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    pointer-events: auto !important;
    visibility: visible !important;
}

.crop-modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.crop-modal[style*="opacity: 1"] .crop-modal-content {
    transform: scale(1);
}

.crop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.crop-body {
    display: flex;
    flex: 1;
    min-height: 400px;
}

.crop-canvas-container {
    flex: 1;
    background: #f9fafb;
    border-right: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.crop-workspace {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: calc(100% - 40px);
    max-height: calc(100% - 40px);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: white;
    padding: 10px;
    user-select: none;
    /* Allow taps to be recognized; limit pan blocking to inside crop area */
    touch-action: manipulation;
    overflow: hidden;
    /* Prevent content from overflowing */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure canvas fills workspace properly */
.crop-workspace canvas {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Ensure images in crop workspace are fully visible */
.crop-workspace img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.crop-sidebar {
    width: 280px;
    background: white;
    display: flex;
    flex-direction: column;
}

.crop-footer {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.bleeding-area {
    position: absolute;
    border: 2px dashed #ef4444;
    background: rgba(239, 68, 68, 0.1);
    pointer-events: none;
    border-radius: 4px;
    opacity: 0.7;
}

.crop-area {
    position: absolute;
    border: 2px solid var(--pu-primary);
    background: rgba(0, 124, 186, 0.1);
    cursor: move;
    border-radius: 4px;
    min-width: 50px;
    min-height: 50px;
    /* Block pan gestures only over the crop area while dragging */
    touch-action: none;
    user-select: none;
}

.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--pu-primary);
    border: 2px solid white;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10;
}

.resize-handle.nw {
    top: -5px;
    left: -5px;
    cursor: nw-resize;
}

.resize-handle.ne {
    top: -5px;
    right: -5px;
    cursor: ne-resize;
}

.resize-handle.sw {
    bottom: -5px;
    left: -5px;
    cursor: sw-resize;
}

.resize-handle.se {
    bottom: -5px;
    right: -5px;
    cursor: se-resize;
}

/* Mobile-friendly touch targets and responsive crop modal */
@media (max-width: 768px) {
    .crop-modal {
        padding: 10px !important;
        box-sizing: border-box !important;
    }

    .crop-modal-content {
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100vh - 20px) !important;
        width: calc(100vw - 20px) !important;
        height: calc(100vh - 20px) !important;
        margin: 0 !important;
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .crop-header {
        flex-shrink: 0;
        padding: 15px 20px;
    }

    .crop-body {
        flex: 1;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
        display: flex;
    }

    .crop-canvas-container {
        flex: 1;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        min-height: 250px;
        max-height: 60vh;
        padding: 10px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .crop-workspace {
        width: 100% !important;
        height: 100% !important;
        max-width: calc(100% - 20px) !important;
        max-height: calc(100% - 20px) !important;
        padding: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .crop-workspace canvas {
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }

    .crop-sidebar {
        width: 100%;
        max-height: 35vh;
        overflow-y: auto;
        flex-shrink: 0;
    }

    .resize-handle {
        width: 16px;
        height: 16px;
        border-width: 3px;
    }

    .resize-handle.nw {
        top: -8px;
        left: -8px;
    }

    .resize-handle.ne {
        top: -8px;
        right: -8px;
    }

    .resize-handle.sw {
        bottom: -8px;
        left: -8px;
    }

    .resize-handle.se {
        bottom: -8px;
        right: -8px;
    }

    /* Larger touch area for better mobile interaction */
    .resize-handle::before {
        content: '';
        position: absolute;
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
        background: transparent;
    }
}

/* Extra small screens - ensure crop modal is fully usable */
@media (max-width: 480px) {
    .crop-modal {
        padding: 5px !important;
    }

    .crop-modal-content {
        max-width: calc(100vw - 10px) !important;
        max-height: calc(100vh - 10px) !important;
        width: calc(100vw - 10px) !important;
        height: calc(100vh - 10px) !important;
        margin: 0 !important;
    }

    .crop-header {
        padding: 12px 16px;
    }

    .crop-canvas-container {
        min-height: 200px;
        max-height: 55vh;
        padding: 8px;
    }

    .crop-workspace {
        max-width: calc(100% - 16px) !important;
        max-height: calc(100% - 16px) !important;
        padding: 4px;
    }

    .crop-workspace canvas {
        max-width: calc(100% - 8px) !important;
        max-height: calc(100% - 8px) !important;
    }

    .crop-sidebar {
        max-height: 40vh;
    }

    .crop-footer {
        padding: 12px 16px;
    }
}

/* Ensure crop workspace maintains aspect ratio and centers content */
.crop-workspace {
    box-sizing: border-box;
}

.crop-workspace canvas,
.crop-workspace img {
    margin: 0 auto;
    border-radius: 4px;
}

/* Force image to be fully contained within workspace */
.crop-canvas-container .crop-workspace canvas,
.crop-canvas-container .crop-workspace img {
    max-width: calc(100% - 20px) !important;
    max-height: calc(100% - 20px) !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}

/* ===== CONFIRMATION DIALOG STYLES ===== */
.gallery-confirm-dialog {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.9) !important;
    z-index: var(--z-confirmation) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    pointer-events: auto !important;
}

.gallery-confirm-dialog.active {
    opacity: 1 !important;
    visibility: visible !important;
}

.gallery-confirm-content {
    background: var(--color-neutral-0);
    border-radius: var(--radius-xl);
    max-width: 480px;
    width: 90%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--color-neutral-200);
    overflow: hidden;
}

.gallery-confirm-dialog.active .gallery-confirm-content {
    transform: scale(1) translateY(0);
}

.gallery-confirm-title {
    margin: 0;
    padding: var(--space-6) var(--space-6) var(--space-4) var(--space-6);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-neutral-900);
    border-bottom: 1px solid var(--color-neutral-100);
    background: linear-gradient(135deg, var(--color-neutral-50) 0%, var(--color-neutral-100) 100%);
}

.gallery-confirm-message {
    margin: 0;
    padding: var(--space-6);
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    color: var(--color-neutral-700);
    text-align: center;
}

.gallery-confirm-actions {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6) var(--space-6) var(--space-6);
    justify-content: flex-end;
    background: var(--color-neutral-50);
    border-top: 1px solid var(--color-neutral-100);
}

.gallery-confirm-btn {
    padding: var(--space-3) var(--space-6);
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--duration-200) var(--ease-in-out);
    min-width: 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.gallery-confirm-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--duration-500) var(--ease-in-out);
}

.gallery-confirm-btn:hover::before {
    left: 100%;
}

.gallery-confirm-btn.secondary {
    background: var(--color-neutral-100);
    border-color: var(--color-neutral-300);
    color: var(--color-neutral-700);
}

.gallery-confirm-btn.secondary:hover {
    background: var(--color-neutral-200);
    border-color: var(--color-neutral-400);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.gallery-confirm-btn.danger {
    background: linear-gradient(135deg, var(--color-error-500) 0%, var(--color-error-600) 100%);
    border-color: var(--color-error-500);
    color: var(--color-neutral-0);
    box-shadow: var(--shadow-sm);
}

.gallery-confirm-btn.danger:hover {
    background: linear-gradient(135deg, var(--color-error-600) 0%, var(--color-error-700) 100%);
    border-color: var(--color-error-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.gallery-confirm-btn.primary {
    background: linear-gradient(135deg, var(--pu-primary) 0%, var(--pu-secondary) 100%);
    border-color: var(--pu-primary);
    color: var(--color-neutral-0);
    box-shadow: var(--shadow-sm);
}

.gallery-confirm-btn.primary:hover {
    background: linear-gradient(135deg, var(--pu-primary-dark) 0%, var(--pu-secondary) 100%);
    border-color: var(--pu-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.gallery-confirm-btn:focus {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

.gallery-confirm-btn:active {
    transform: translateY(0);
}

/* ===== HEADER SECTION ===== */
.photo-uploader-header {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-neutral-100);
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    width: 100%;
}

.title-section {
    flex: 1;
    text-align: center;
    transition: all var(--duration-300) var(--ease-in-out);
    width: 100%;
}

.header-actions {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    align-items: flex-start;
}

.uploader-title {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-neutral-900);
    margin: 0 0 var(--space-3) 0;
    letter-spacing: -0.025em;
    line-height: var(--line-height-tight);
    transition: all var(--duration-300) var(--ease-in-out);
}

.uploader-description {
    font-size: var(--font-size-lg);
    color: var(--color-neutral-600);
    margin: 0;
    line-height: var(--line-height-relaxed);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    transition: all var(--duration-300) var(--ease-in-out);
}

/* Compact state when images are uploaded */
.photo-uploader-container.has-images .uploader-title {
    font-size: var(--font-size-xl);
    margin: 0 0 var(--space-1) 0;
    line-height: var(--line-height-snug);
    font-weight: var(--font-weight-bold);
}

.photo-uploader-container.has-images .uploader-description {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    max-width: 500px;
    opacity: 0.8;
    font-weight: var(--font-weight-medium);
}

.photo-uploader-container.has-images .photo-uploader-header {
    margin-bottom: var(--space-2);
    padding-bottom: var(--space-1);
    background: linear-gradient(135deg, var(--color-neutral-0) 0%, var(--color-primary-25) 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-2) var(--space-3);
    margin: calc(-1 * var(--space-3)) calc(-1 * var(--space-3)) var(--space-2) calc(-1 * var(--space-3));
    border-bottom: 1px solid var(--color-primary-100);
}

.photo-uploader-container.has-images .title-section {
    margin: var(--space-1) 0;
}

.photo-uploader-container.has-images .header-content {
    align-items: center;
    gap: var(--space-3);
}

/* Help Button in Header - Compact Professional Design */
.header-actions .help-button {
    background: var(--color-neutral-100) !important;
    border: 1px solid var(--color-neutral-300) !important;
    color: var(--color-neutral-700) !important;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all var(--duration-200) var(--ease-in-out);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    flex-shrink: 0;
    line-height: 1 !important;
    text-align: center !important;
}

.header-actions .help-button:hover {
    background: var(--color-neutral-200) !important;
    border-color: var(--color-neutral-400) !important;
    color: var(--color-neutral-800) !important;
    transform: translateY(-1px) scale(1.05);
    box-shadow: var(--shadow-sm);
}

.header-actions .help-button:focus {
    outline: 2px solid var(--pu-primary) !important;
    outline-offset: 2px;
}

/* Responsive header layout */
@media (max-width: 640px) {
    .header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        position: static;
    }

    .title-section {
        text-align: center;
        width: 100%;
    }

    .header-actions {
        position: static;
        margin-top: var(--space-3);
        align-self: center;
    }
}

/* Validation Summary */
.photo-uploader-validation-summary {
    background-color: var(--photo-uploader-light);
    border: 1px solid var(--photo-uploader-border);
    border-radius: var(--photo-uploader-border-radius);
    padding: 20px;
    margin-bottom: 25px;
}

.photo-uploader-validation-summary h4 {
    margin: 0 0 15px 0;
    color: var(--photo-uploader-dark);
    font-size: 18px;
    font-weight: 600;
}

.photo-uploader-validation-summary ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.photo-uploader-validation-summary li {
    margin: 8px 0;
    color: #555;
}

/* ===== INTERFACE CONTAINER ===== */
.photo-uploader-interface {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    contain: layout style;
    position: relative;
}

.photo-uploader-gallery-section {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: var(--space-6);
    overflow: hidden;
    position: relative;
    animation: slideInUp var(--duration-500) var(--ease-out);
}

/* Professional container improvements */
.photo-uploader-container.has-images {
    background: linear-gradient(135deg, var(--color-neutral-0) 0%, var(--color-neutral-50) 100%);
    border-color: var(--color-primary-200);
    box-shadow: var(--shadow-xl);
}

.photo-uploader-container.has-images .photo-uploader-interface {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

/* ===== UPLOAD AREA ===== */
.upload-area {
    border: 2px dashed rgba(0, 124, 186, 0.4) !important;
    border-radius: var(--radius-xl);
    padding: var(--space-10) var(--space-6);
    text-align: center;
    background: linear-gradient(135deg, var(--color-neutral-50) 0%, color-mix(in srgb, var(--pu-primary) 5%, transparent)) !important;
    transition: all var(--duration-300) var(--ease-in-out);
    cursor: pointer;
    position: relative;
    min-height: var(--upload-area-height);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-8);
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Fallback for browsers that don't support color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
    .upload-area {
        background: linear-gradient(135deg, var(--color-neutral-50) 0%, rgba(0, 124, 186, 0.05) 100%) !important;
    }
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--pu-primary) 10%, transparent) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--duration-300) var(--ease-in-out);
    pointer-events: none;
}

/* Fallback for browsers that don't support color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
    .upload-area::before {
        background: radial-gradient(circle at 50% 50%, rgba(0, 124, 186, 0.1) 0%, transparent 70%);
    }
}

/* Compact upload area when gallery has images */
.photo-uploader-container.has-images .upload-area {
    min-height: var(--upload-area-compact-height);
    padding: var(--space-6) var(--space-4);
    margin-bottom: var(--space-6);
    background: linear-gradient(135deg, var(--color-neutral-50) 0%, color-mix(in srgb, var(--pu-primary) 3%, var(--color-neutral-100))) !important;
    border-color: var(--pu-primary) !important;
}

/* Fallback for browsers that don't support color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
    .photo-uploader-container.has-images .upload-area {
        background: linear-gradient(135deg, var(--color-neutral-50) 0%, var(--color-neutral-100) 100%) !important;
    }
}

/* High specificity rules to ensure upload area always uses branding colors */
.photo-uploader-container .upload-area,
div.upload-area,
.photo-uploader-interface .upload-area,
[class*="photo-uploader"] .upload-area {
    border-color: var(--pu-primary);
}

.photo-uploader-container .upload-area:hover,
div.upload-area:hover,
.photo-uploader-interface .upload-area:hover,
[class*="photo-uploader"] .upload-area:hover {
    border-color: var(--pu-primary);
}

.photo-uploader-container .upload-area.drag-over,
div.upload-area.drag-over,
.photo-uploader-interface .upload-area.drag-over,
[class*="photo-uploader"] .upload-area.drag-over {
    border-color: var(--pu-primary);
}

.photo-uploader-container.has-images .upload-icon {
    font-size: var(--font-size-2xl) !important;
}

.photo-uploader-container.has-images .upload-text {
    font-size: var(--font-size-sm) !important;
    margin: var(--space-2) 0 !important;
}

.photo-uploader-container.has-images .upload-actions {
    gap: var(--space-2) !important;
}

.photo-uploader-container.has-images .upload-button,
.photo-uploader-container.has-images .help-button {
    padding: var(--space-2) var(--space-4) !important;
    font-size: var(--font-size-sm) !important;
}

.upload-area:hover {
    border-color: var(--pu-primary) !important;
    background: linear-gradient(135deg, color-mix(in srgb, var(--pu-primary) 8%, transparent), color-mix(in srgb, var(--pu-primary) 12%, transparent)) !important;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--pu-primary) 15%, transparent);
}

/* Fallback for browsers that don't support color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
    .upload-area:hover {
        background: linear-gradient(135deg, rgba(0, 124, 186, 0.08) 0%, rgba(0, 124, 186, 0.12) 100%) !important;
        box-shadow: 0 8px 25px rgba(0, 124, 186, 0.15);
    }
}

.upload-area:hover::before {
    opacity: 1;
}

.upload-area.drag-over {
    border-color: var(--pu-primary) !important;
    background: linear-gradient(135deg, color-mix(in srgb, var(--pu-primary) 15%, transparent), color-mix(in srgb, var(--pu-accent) 10%, transparent)) !important;
    transform: scale(1.02);
    box-shadow: 0 12px 30px color-mix(in srgb, var(--pu-primary) 20%, transparent);
    border-style: solid;
}

/* Fallback for browsers that don't support color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
    .upload-area.drag-over {
        background: linear-gradient(135deg, rgba(0, 124, 186, 0.15) 0%, rgba(0, 160, 210, 0.1) 100%) !important;
        box-shadow: 0 12px 30px rgba(0, 124, 186, 0.2);
    }
}

.upload-area.drag-over::before {
    opacity: 1;
    background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--pu-primary) 20%, transparent) 0%, transparent 70%);
}

/* Fallback for browsers that don't support color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
    .upload-area.drag-over::before {
        background: radial-gradient(circle at 50% 50%, rgba(0, 124, 186, 0.2) 0%, transparent 70%);
    }
}

.upload-prompt {
    max-width: 480px;
    z-index: 1;
    position: relative;
}

.upload-icon {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-4);
    opacity: 0.8;
    color: var(--pu-primary);
    filter: drop-shadow(0 2px 4px rgba(0, 124, 186, 0.1));
}

.upload-text {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--color-neutral-700);
    margin: 0 0 var(--space-6) 0;
    line-height: var(--line-height-relaxed);
}

/* ===== BUTTON SYSTEM ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-200) var(--ease-in-out);
    background: none;
    line-height: var(--line-height-tight);
    user-select: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--duration-500) var(--ease-in-out);
}

.btn:hover::before {
    left: 100%;
}

.btn:focus {
    outline: 2px solid var(--pu-primary);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 2px solid var(--pu-primary);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:disabled::before {
    display: none;
}

/* Button Variants */
.btn-primary,
.btn.btn-primary,
.upload-button.btn-primary,
.btn.btn-primary.btn-lg,
.btn.btn-primary.upload-button {
    background: linear-gradient(135deg, var(--pu-primary) 0%, var(--pu-secondary) 100%) !important;
    border-color: var(--pu-primary) !important;
    color: var(--color-neutral-0) !important;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled),
.btn.btn-primary:hover:not(:disabled),
.upload-button.btn-primary:hover:not(:disabled),
.btn.btn-primary.btn-lg:hover:not(:disabled),
.btn.btn-primary.upload-button:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--pu-primary-dark) 0%, var(--pu-secondary) 100%) !important;
    border-color: var(--pu-primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active:not(:disabled),
.btn.btn-primary:active:not(:disabled),
.upload-button.btn-primary:active:not(:disabled),
.btn.btn-primary.btn-lg:active:not(:disabled),
.btn.btn-primary.upload-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--color-neutral-100) 0%, var(--color-neutral-200) 100%);
    border-color: var(--color-neutral-300);
    color: var(--color-neutral-700);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--color-neutral-200) 0%, var(--color-neutral-300) 100%);
    border-color: var(--color-neutral-400);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: var(--color-neutral-0);
    border-color: var(--pu-primary);
    color: var(--pu-primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--pu-primary);
    border-color: var(--pu-primary);
    color: var(--color-neutral-0);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
    gap: var(--space-1);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    gap: var(--space-3);
}

.btn-xl {
    padding: var(--space-5) var(--space-10);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    gap: var(--space-3);
}

/* Button Icons */
.btn-icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

/* Upload Actions */
.upload-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: center;
    align-items: center;
}

/* Ensure upload actions buttons use branding colors - Override any theme conflicts */
.upload-actions .btn-primary,
.upload-actions .btn.btn-primary,
.upload-actions button.btn-primary,
.upload-actions button.btn.btn-primary,
.upload-actions .upload-button.btn-primary,
.upload-actions button.upload-button.btn-primary {
    background: linear-gradient(135deg, var(--pu-primary) 0%, var(--pu-secondary) 100%) !important;
    border-color: var(--pu-primary) !important;
    color: var(--color-neutral-0) !important;
}

.upload-actions .btn-primary:hover:not(:disabled),
.upload-actions .btn.btn-primary:hover:not(:disabled),
.upload-actions button.btn-primary:hover:not(:disabled),
.upload-actions button.btn.btn-primary:hover:not(:disabled),
.upload-actions .upload-button.btn-primary:hover:not(:disabled),
.upload-actions button.upload-button.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--pu-primary-dark) 0%, var(--pu-secondary) 100%) !important;
    border-color: var(--pu-primary-dark) !important;
    color: var(--color-neutral-0) !important;
}

.upload-button {
    /* Enhanced with branding colors */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-200) var(--ease-in-out);
    background: linear-gradient(135deg, var(--pu-primary) 0%, var(--pu-secondary) 100%);
    border-color: var(--pu-primary);
    color: var(--color-neutral-0);
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.15);
    line-height: var(--line-height-tight);
    user-select: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.upload-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--duration-500) var(--ease-in-out);
}

.upload-button:hover::before {
    left: 100%;
}

.upload-button:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--pu-primary-dark) 0%, var(--pu-secondary) 100%);
    border-color: var(--pu-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.25);
}

.upload-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.upload-button:focus {
    outline: 2px solid var(--pu-primary);
    outline-offset: 2px;
}

.upload-button:focus-visible {
    outline: 2px solid var(--pu-primary);
    outline-offset: 2px;
}

.upload-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.upload-button:disabled::before {
    display: none;
}

.help-button {
    /* Inherits from .btn .btn-outline */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--duration-200) var(--ease-in-out);
    background: var(--color-neutral-0);
    border-color: var(--color-primary-500);
    color: var(--color-primary-600);
    line-height: var(--line-height-tight);
    user-select: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.help-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--duration-500) var(--ease-in-out);
}

.help-button:hover::before {
    left: 100%;
}

.help-button:hover:not(:disabled) {
    background: var(--color-primary-50);
    border-color: var(--color-primary-600);
    color: var(--color-primary-700);
}

.help-button:focus {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

.help-button:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

.help-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.help-button:disabled::before {
    display: none;
}

.help-icon {
    font-size: var(--font-size-sm);
    opacity: 0.8;
}

.help-text {
    font-size: var(--font-size-sm);
}

/* ===== PRICING TIER STRIP - ENHANCED TYPOGRAPHY & PROFESSIONAL STYLING ===== */
.tier-pricing-strip {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #d1d5dba8;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(156, 163, 175, 0.08), 0 1px 4px rgba(156, 163, 175, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: block;
    opacity: 1;
    transform: translateY(0);
    position: relative;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tier-pricing-strip:hover {
    box-shadow: 0 6px 20px rgba(156, 163, 175, 0.12), 0 2px 8px rgba(156, 163, 175, 0.08);
    transform: translateY(-2px);
    border-color: #d1d5db;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
}

.tier-strip-header {
    text-align: center;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(156, 163, 175, 0.15);
}

.tier-strip-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--pu-primary) 0%, var(--pu-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 6px 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'SF Pro Display', system-ui, sans-serif;
}

.tier-strip-title::before {
    content: '💰';
    font-size: 22px;
    filter: drop-shadow(0 1px 2px rgba(0, 124, 186, 0.15));
}

.tier-strip-subtitle {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.01em;
    opacity: 0.9;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
}

.tier-strip-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    border: 1px solid #e2e8f0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.tier-strip-track {
    display: flex;
    align-items: stretch;
    min-height: 70px;
    position: relative;
    transition: all var(--duration-200) var(--ease-in-out);
}

.tier-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 14px 12px;
    border-right: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    min-width: 100px;
    text-align: center;
}

.tier-item:last-child {
    border-right: none;
}

.tier-item:hover {
    background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-primary-100) 100%);
    transform: translateY(-2px);
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.12);
    border-color: var(--pu-primary);
}

.tier-item.active {
    background: linear-gradient(135deg, var(--pu-primary) 0%, var(--pu-secondary) 100%);
    color: var(--color-neutral-0);
    transform: translateY(-2px);
    z-index: 3;
    box-shadow: 0 6px 16px rgba(0, 124, 186, 0.2), 0 2px 8px rgba(0, 124, 186, 0.1);
    border-color: var(--pu-primary-dark);
}

.tier-item.active:hover {
    background: linear-gradient(135deg, var(--pu-primary-dark) 0%, var(--pu-secondary) 100%);
    transform: translateY(-3px);
}

/* Top bars removed as requested */

.tier-quantity {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 1.0;
    color: #4a5568;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    letter-spacing: 0.01em;
}

.tier-item.active .tier-quantity {
    opacity: 1;
    font-weight: 700;
    color: var(--color-neutral-0);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tier-price {
    font-size: 18px;
    font-weight: 800;
    line-height: var(--line-height-tight);
    color: var(--pu-primary);
    margin-bottom: 3px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'SF Pro Display', system-ui, sans-serif;
    letter-spacing: -0.01em;
}

.tier-item.active .tier-price {
    font-size: 20px;
    color: var(--color-neutral-0);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    font-weight: 800;
}

.tier-savings {
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
    opacity: 1.0;
    color: var(--color-success-600);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.tier-item.active .tier-savings {
    opacity: 1;
    color: var(--color-success-100);
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tier-item .tier-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--color-warning-500) 0%, var(--color-warning-600) 100%);
    color: var(--color-neutral-0);
    font-size: 11px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: scale(0) translateX(-50%);
    transition: transform var(--duration-200) var(--ease-out);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 2px solid #ffffff;
}

.tier-item.best-value .tier-badge {
    transform: scale(1) translateX(-50%);
}

.tier-item.active .tier-badge {
    background: linear-gradient(135deg, var(--color-warning-400) 0%, var(--color-warning-500) 100%);
}

/* Tier info message */
.tier-info-message {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-neutral-900);
    color: var(--color-neutral-0);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    box-shadow: var(--shadow-lg);
}

.tier-info-message::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--color-neutral-900);
}

/* Tier strip animations */
@keyframes tierActivate {
    0% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-5px) scale(1.05);
    }

    100% {
        transform: translateY(-3px) scale(1);
    }
}

@keyframes tierPulse {

    0%,
    100% {
        box-shadow: 0 6px 20px rgba(0, 124, 186, 0.3);
    }

    50% {
        box-shadow: 0 8px 25px rgba(0, 124, 186, 0.4);
    }
}

.tier-item.active {
    animation: tierActivate 0.4s ease-out, tierPulse 2s ease-in-out infinite;
}

/* Tier strip loading state */
.tier-pricing-strip.loading {
    opacity: 0.7;
    pointer-events: none;
}

.tier-pricing-strip.loading .tier-strip-track {
    position: relative;
    overflow: hidden;
}

.tier-pricing-strip.loading .tier-strip-track::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Enhanced tier item interactions */
.tier-item {
    will-change: transform, box-shadow;
}

.tier-item:focus {
    outline: 2px solid var(--pu-primary);
    outline-offset: 2px;
}

.tier-item:focus-visible {
    outline: 2px solid var(--pu-primary);
    outline-offset: 2px;
}

/* Tier strip compact mode for smaller screens */
.photo-uploader-container.has-images .tier-pricing-strip {
    margin-bottom: var(--space-4);
    padding: var(--space-4);
}

.photo-uploader-container.has-images .tier-strip-header {
    margin-bottom: var(--space-3);
}

.photo-uploader-container.has-images .tier-strip-title {
    font-size: var(--font-size-base);
}

.photo-uploader-container.has-images .tier-strip-subtitle {
    font-size: var(--font-size-xs);
}

.photo-uploader-container.has-images .tier-item {
    padding: var(--space-3) var(--space-2);
    min-height: 70px;
}

.photo-uploader-container.has-images .tier-price {
    font-size: var(--font-size-base);
}

.photo-uploader-container.has-images .tier-item.active .tier-price {
    font-size: var(--font-size-lg);
}

/* Responsive tier strip */
@media (max-width: 768px) {
    .tier-strip-track {
        flex-wrap: wrap;
        min-height: auto;
    }

    .tier-item {
        min-width: calc(50% - 1px);
        flex: 0 0 calc(50% - 1px);
    }

    .tier-item:nth-child(2n) {
        border-right: none;
    }

    .tier-item:nth-child(n+3) {
        border-top: 1px solid var(--color-neutral-200);
    }
}

@media (max-width: 480px) {
    .tier-item {
        min-width: 100%;
        flex: 0 0 100%;
        border-right: none;
    }

    .tier-item:not(:last-child) {
        border-bottom: 1px solid var(--color-neutral-200);
    }

    .tier-item:nth-child(n+2) {
        border-top: 1px solid var(--color-neutral-200);
    }

    .tier-pricing-strip {
        padding: var(--space-4);
    }

    .tier-strip-header {
        margin-bottom: var(--space-3);
    }

    .tier-strip-title {
        font-size: var(--font-size-base);
    }

    .tier-strip-subtitle {
        font-size: var(--font-size-xs);
    }
}

/* ===== GALLERY SECTION ===== */
.photo-uploader-gallery-section {
    margin-bottom: var(--space-8);
    animation: slideInUp var(--duration-500) var(--ease-out);
}

/* Gallery Item Processing States */
.gallery-item {
    position: relative;
    overflow: hidden;
}

.gallery-item.loading {
    opacity: 0.7;
}

.gallery-item.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.4) 50%,
            transparent 100%);
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

.gallery-item.processing {
    border: 2px solid var(--pu-primary);
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.gallery-item.processing::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 1px solid var(--pu-primary);
    border-radius: 6px;
    animation: processingPulse 2s infinite;
    z-index: 1;
    pointer-events: none;
}

.gallery-item.completed {
    border: 2px solid #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.gallery-item.error {
    border: 2px solid #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.gallery-item-status {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    display: flex;
    gap: 4px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    font-weight: bold;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.status-indicator.processing {
    background: var(--pu-primary);
    animation: processingPulse 1.5s infinite;
}

.status-indicator.processing::after {
    content: '⚡';
    font-size: 6px;
}

.status-indicator.completed {
    background: #22c55e;
}

.status-indicator.completed::after {
    content: '✓';
    font-size: 6px;
}

.status-indicator.error {
    background: #ef4444;
}

.status-indicator.error::after {
    content: '✕';
    font-size: 6px;
}

.operation-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: 11px;
    text-align: center;
    border-radius: 0 0 8px 8px;
    z-index: 2;
    animation: fadeInUp 0.3s ease;
}

/* Processing Animations */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes processingPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.02);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.image-gallery {
    background: linear-gradient(135deg, var(--color-neutral-50) 0%, var(--color-neutral-100) 100%);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    min-height: 280px;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-300) var(--ease-in-out);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    contain: layout style;
}

.image-gallery:hover {
    box-shadow: var(--shadow-md);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-neutral-200);
    position: relative;
    background: linear-gradient(135deg, var(--color-neutral-0) 0%, var(--color-primary-25) 100%);
    margin: calc(-1 * var(--space-6)) calc(-1 * var(--space-6)) var(--space-8) calc(-1 * var(--space-6));
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.gallery-header h4 {
    margin: 0;
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-neutral-800);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.gallery-count {
    background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%);
    color: var(--color-neutral-0);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    min-width: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    animation: scaleIn var(--duration-200) var(--ease-out);
}

.gallery-controls {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.add-more-button {
    background: linear-gradient(135deg, var(--pu-primary) 0%, var(--pu-secondary) 100%) !important;
    color: var(--color-neutral-0) !important;
    border: 1px solid var(--pu-primary) !important;
    padding: 0 var(--space-4) !important;
    border-radius: var(--radius-lg) !important;
    font-size: var(--font-size-sm) !important;
    font-weight: var(--font-weight-semibold) !important;
    cursor: pointer;
    transition: all var(--duration-300) var(--ease-in-out);
    display: flex !important;
    align-items: center !important;
    gap: var(--space-2) !important;
    box-shadow: var(--shadow-sm);
    min-width: 140px !important;
    height: 36px !important;
    line-height: 1 !important;
    justify-content: center !important;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
    text-align: center !important;
    vertical-align: middle !important;
}

.add-more-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--duration-500) var(--ease-in-out);
}

.add-more-button:hover::before {
    left: 100%;
}

.add-more-button:hover {
    background: linear-gradient(135deg, var(--pu-primary-dark) 0%, var(--pu-secondary) 100%);
    border-color: var(--pu-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.add-more-button:focus {
    outline: 2px solid var(--pu-primary);
    outline-offset: 2px;
}

.add-more-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.add-more-button .add-icon {
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    position: relative;
}

.add-more-button .add-icon::before {
    content: '+';
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--gallery-item-size), 1fr));
    gap: var(--gallery-gap);
    min-height: var(--gallery-item-size);
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Enhanced empty state */
.gallery-grid:empty::after {
    content: 'No images selected yet. Click "Select Images" or drag files here to get started.';
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-neutral-500);
    font-style: italic;
    font-size: var(--font-size-base);
    padding: var(--space-12) var(--space-6);
    border: 2px dashed var(--color-neutral-300);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--color-neutral-50) 0%, var(--color-neutral-100) 100%);
    grid-column: 1 / -1;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

.gallery-grid:empty::before {
    content: '📷';
    position: absolute;
    top: var(--space-6);
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--font-size-4xl);
    opacity: 0.3;
}

/* ===== GALLERY ITEMS ===== */
.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--duration-300) cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: linear-gradient(135deg, var(--color-neutral-100) 0%, var(--color-neutral-200) 100%);
    border: 2px solid transparent;
    animation: scaleIn var(--duration-300) var(--ease-out);
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%);
    opacity: 0;
    transition: opacity var(--duration-200) var(--ease-in-out);
    z-index: 1;
    border-radius: inherit;
}

.gallery-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-primary-400);
    z-index: 10;
    /* Ensure hover item appears above others */
}

.gallery-item:hover::before {
    opacity: 0.1;
}

.gallery-item.selected {
    border-color: var(--color-primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3), var(--shadow-lg);
    transform: scale(1.02);
    z-index: 15;
    /* Higher than hover to ensure selection is always visible */
}

.gallery-item.selected::before {
    opacity: 0.15;
}

/* Ensure selected items maintain their selection appearance on hover */
.gallery-item.selected:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4), var(--shadow-xl);
    border-color: var(--color-primary-600);
}

.gallery-item.edited {
    border-color: var(--color-success-500);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2), var(--shadow-lg);
}

.gallery-item.edited::after {
    content: '✓';
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    background: linear-gradient(135deg, var(--color-success-500) 0%, var(--color-success-600) 100%);
    color: var(--color-neutral-0);
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    z-index: 3;
    box-shadow: var(--shadow-sm);
    animation: bounceIn var(--duration-500) var(--ease-bounce);
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-item.loading {
    opacity: 0.7;
    pointer-events: none;
}

.gallery-item.loading::before {
    opacity: 0.3;
    animation: pulse var(--duration-1000) var(--ease-in-out) infinite;
}

.gallery-item.error {
    border-color: var(--color-error-500);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.gallery-item.error::after {
    content: '⚠️';
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    background: var(--color-error-500);
    color: var(--color-neutral-0);
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    z-index: 3;
    box-shadow: var(--shadow-sm);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--duration-300) var(--ease-in-out);
    position: relative;
    z-index: 2;
    /* Ensure image stays within container bounds */
    transform-origin: center center;
}

.gallery-item:hover img {
    transform: scale(1.05);
    /* Reduced scale to prevent clipping */
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.8) 0%,
            rgba(0, 0, 0, 0.6) 50%,
            rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--duration-300) var(--ease-in-out);
    z-index: 2;
    backdrop-filter: blur(2px);
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-actions {
    display: flex;
    gap: var(--space-2);
    transform: translateY(var(--space-2));
    transition: transform var(--duration-200) var(--ease-out);
}

.gallery-item:hover .gallery-item-actions {
    transform: translateY(0);
}

.gallery-action-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--color-neutral-700);
    font-size: var(--font-size-lg);
    cursor: pointer;
    transition: all var(--duration-200) cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

/* Improve gallery actions layout to avoid overlap */
.gallery-item-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item-actions {
    flex-wrap: wrap;
    justify-content: center;
}

/* Responsive adjustments for small screens */
@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }

    .gallery-item-actions {
        gap: 6px;
    }

    .gallery-action-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
}

.gallery-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--duration-200) var(--ease-in-out);
}

.gallery-action-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.15) rotate(5deg);
    box-shadow: var(--shadow-xl);
}

.gallery-action-btn:hover::before {
    opacity: 1;
}

.gallery-action-btn:active {
    transform: scale(0.95);
    transition-duration: var(--duration-75);
}

.gallery-action-btn.edit-btn:hover {
    color: var(--color-primary-600);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, var(--color-primary-50) 100%);
}

.gallery-action-btn.view-btn:hover {
    color: var(--color-info-600);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, var(--color-info-50) 100%);
}

.gallery-action-btn.delete-btn:hover {
    color: var(--color-error-600);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, var(--color-error-50) 100%);
}

/* Empty gallery state */
.gallery-grid:empty::after {
    content: 'No images selected yet. Click "Select Images" or drag files here to get started.';
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    border: 2px dashed #ddd;
    border-radius: var(--photo-uploader-border-radius);
    background-color: white;
    grid-column: 1 / -1;
    min-height: 100px;
}

.gallery-action-btn.edit-btn:hover {
    color: var(--photo-uploader-primary);
}

.gallery-action-btn.view-btn:hover {
    color: var(--photo-uploader-accent);
}

.gallery-action-btn.delete-btn:hover {
    color: var(--photo-uploader-danger);
}

/* Submit Section */
.photo-uploader-submit-section {
    text-align: center;
    padding: 30px 20px;
    background-color: var(--photo-uploader-light);
    border-radius: var(--photo-uploader-border-radius);
    margin-bottom: 20px;
}

.submit-actions {
    margin-bottom: 15px;
}

.submit-info {
    font-size: 14px;
    color: #666;
}

.submit-note {
    margin: 0;
}

/* Loading Overlay */
.photo-uploader-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-dropdown);
    border-radius: var(--photo-uploader-border-radius);
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--photo-uploader-border);
    border-top: 4px solid var(--photo-uploader-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 16px;
    color: var(--photo-uploader-dark);
    margin: 0;
}

/* Rate Limit Notice */
.photo-uploader-rate-limit-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: var(--photo-uploader-border-radius);
    color: #856404;
    text-align: center;
}

.rate-limit-icon {
    font-size: 24px;
    margin-right: 15px;
}

.rate-limit-message {
    font-size: 16px;
    font-weight: 500;
}

/* Modal Styles */
.photo-uploader-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 20px;
}

.modal-content {
    background-color: white;
    border-radius: var(--photo-uploader-border-radius);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--photo-uploader-shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--photo-uploader-border);
}

.modal-header h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--photo-uploader-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--photo-uploader-transition);
}

.modal-close:hover {
    background-color: var(--photo-uploader-light);
    color: var(--photo-uploader-dark);
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--photo-uploader-border);
}

/* Theme Variations */
.photo-uploader-theme-minimal {
    --photo-uploader-border-radius: 4px;
}

.photo-uploader-theme-minimal .upload-area {
    border-style: solid;
    border-width: 1px;
}

.photo-uploader-theme-rounded {
    --photo-uploader-border-radius: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .photo-uploader {
        padding: 15px;
    }

    .photo-uploader-title {
        font-size: 24px;
    }

    .upload-area {
        padding: 30px 15px;
        min-height: 150px;
    }

    .upload-icon {
        font-size: 36px;
    }

    .upload-primary-text {
        font-size: 16px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }

    /* Only stack gallery header on very small screens */
    .gallery-header {
        flex-direction: row;
        /* Keep side-by-side on mobile */
        align-items: center;
        gap: 12px;
        flex-wrap: wrap;
        /* Allow wrapping if needed */
    }

    .gallery-controls {
        flex-shrink: 0;
        /* Prevent button from shrinking */
    }

    .add-more-button {
        min-width: 120px;
        /* Ensure button has minimum width */
        justify-content: center;
    }
}

/* Stack only on very small screens (phones in portrait) */
@media (max-width: 480px) {
    .gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .gallery-controls {
        align-self: stretch;
        justify-content: center;
    }

    .add-more-button {
        width: 100%;
        justify-content: center;
    }
}

.photo-uploader-container.has-images .upload-area {
    min-height: 100px;
    padding: 15px 10px;
}

.btn {
    padding: 10px 20px;
    font-size: 14px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.modal-content {
    width: 95vw;
    margin: 10px;
}

.modal-header,
.modal-body,
.modal-footer {
    padding: 15px;
}


@media (max-width: 480px) {
    .photo-uploader {
        padding: 10px;
    }

    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .upload-area {
        padding: 20px 10px;
        min-height: 120px;
    }

    .gallery-item-actions {
        gap: 4px;
    }

    .gallery-action-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .photo-uploader {
        --photo-uploader-border: #000;
        --photo-uploader-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    .upload-area {
        border-width: 2px;
        border-style: solid;
    }
}

/* Focus Indicators */
.upload-area:focus-within {
    outline: 2px solid var(--pu-primary);
    outline-offset: 2px;
}

.gallery-item:focus-within {
    outline: 2px solid var(--photo-uploader-accent);
    outline-offset: 2px;
}

/* Print Styles */
@media print {

    .photo-uploader-loading,
    .photo-uploader-modal,
    .gallery-item-overlay {
        display: none !important;
    }
}

/* File 
Validation Styles */
#photo-uploader-errors {
    margin: 10px 0;
}

.photo-uploader-error {
    background-color: #ffebee;
    border: 1px solid #f44336;
    border-radius: 4px;
    padding: 12px;
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    animation: slideIn 0.3s ease-out;
}

.photo-uploader-error .error-content {
    flex: 1;
    color: #c62828;
}

.photo-uploader-error .error-content strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.photo-uploader-error .error-content ul {
    margin: 0;
    padding-left: 20px;
}

.photo-uploader-error .error-content li {
    margin: 2px 0;
}

.photo-uploader-error .error-dismiss {
    background: none;
    border: none;
    color: #c62828;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.photo-uploader-error .error-dismiss:hover {
    background-color: rgba(244, 67, 54, 0.1);
}

.photo-uploader-error .error-dismiss:focus {
    outline: 2px solid #f44336;
    outline-offset: 2px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Validation summary styles */
.photo-uploader-validation-summary {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
    margin: 10px 0;
    font-size: 14px;
    color: #666;
}

.photo-uploader-validation-summary h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
}

.photo-uploader-validation-summary ul {
    margin: 0;
    padding-left: 20px;
}

.photo-uploader-validation-summary li {
    margin: 4px 0;
}

/* Pricing Display Styles */
#pricing-display {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    transition: all 0.3s ease;
}

#pricing-display.pricing-updated {
    background-color: #e8f5e8;
    border-color: #28a745;
    transform: scale(1.02);
}

.pricing-summary {
    text-align: center;
}

.pricing-total {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.pricing-label {
    display: block;
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 5px;
}

.pricing-amount {
    display: block;
    font-size: 32px;
    font-weight: bold;
    color: #28a745;
}

.pricing-details {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
}

.pricing-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-label {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 3px;
}

.detail-value {
    font-size: 16px;
    font-weight: 600;
    color: #495057;
}

/* === PROFESSIONAL TOTAL PRICING AREA === */
.photo-uploader-container .total-price-section {
    display: block;
    margin: var(--space-8) 0 var(--space-6) 0;
}

.photo-uploader-container .total-price-section .total-price-display {
    max-width: 480px;
    margin: 0 auto;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    padding: 24px 28px;
    position: relative;
    overflow: hidden;
}

.photo-uploader-container .total-price-section .total-price-display::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--pu-primary) 0%, var(--pu-accent) 50%, var(--pu-secondary) 100%);
    border-radius: 16px 16px 0 0;
}

.photo-uploader-container .total-price-section .price-breakdown {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.photo-uploader-container .total-price-section .image-count-display,
.photo-uploader-container .total-price-section .total-price-display>.label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(var(--pu-primary-rgb, 0, 124, 186), 0.15);
    border-radius: 12px;
    transition: all 0.2s ease;
    text-align: center;
}

.photo-uploader-container .total-price-section .image-count-display:hover,
.photo-uploader-container .total-price-section .total-price-display>.label:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.photo-uploader-container .total-price-section .image-count-display .label,
.photo-uploader-container .total-price-section .total-price-display .label {
    color: #64748b;
    font-size: 15px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
    flex: 1;
}

.photo-uploader-container .total-price-section .image-count-display .image-count,
.photo-uploader-container .total-price-section .image-count-display .count-suffix {
    color: var(--pu-primary);
    font-weight: 600;
    font-size: 15px;
}

.photo-uploader-container .total-price-section .image-count-display .count-suffix {
    color: #64748b;
    font-weight: 500;
    margin-left: 4px;
}

.photo-uploader-container .total-price-section .total-price-display .total-price {
    display: inline-block;
    color: var(--pu-primary);
    font-size: 32px;
    font-weight: 800;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'SF Pro Display', system-ui, sans-serif;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(0, 124, 186, 0.1);
}

/* Final total price row - enhanced styling */
.photo-uploader-container .total-price-section .total-price-display .total-price-row {
    background: linear-gradient(135deg, rgba(0, 124, 186, 0.05) 0%, rgba(0, 124, 186, 0.1) 100%);
    border: 2px solid var(--pu-primary);
    border-radius: 14px;
    padding: 16px 20px;
    margin-top: 8px;
    box-shadow:
        0 4px 12px rgba(0, 124, 186, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.photo-uploader-container .total-price-section .total-price-display .total-price-row:hover {
    background: linear-gradient(135deg, rgba(0, 124, 186, 0.08) 0%, rgba(0, 124, 186, 0.15) 100%);
    border-color: var(--pu-secondary);
    transform: translateY(-1px);
    box-shadow:
        0 6px 16px rgba(0, 124, 186, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

@media (max-width: 600px) {
    .photo-uploader-container .total-price-section .total-price-display {
        margin: 0 8px;
        padding: 20px 18px;
        max-width: calc(100% - 16px);
    }

    .photo-uploader-container .total-price-section .total-price-display .total-price {
        font-size: 28px;
    }
}

/* Pricing Preview Table */
.pricing-preview-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pricing-preview-table th,
.pricing-preview-table td {
    padding: 12px 15px;
    text-align: center;
    border-bottom: 1px solid #dee2e6;
}

.pricing-preview-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.pricing-preview-table tbody tr:hover {
    background-color: #f8f9fa;
}

.pricing-preview-table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive pricing display */
@media (max-width: 768px) {
    .pricing-details {
        flex-direction: column;
        gap: 10px;
    }

    .pricing-detail {
        flex-direction: row;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid #eee;
    }

    .pricing-detail:last-child {
        border-bottom: none;
    }

    .pricing-amount {
        font-size: 28px;
    }

    .pricing-preview-table {
        font-size: 14px;
    }

    .pricing-preview-table th,
    .pricing-preview-table td {
        padding: 8px 10px;
    }
}

/* Edi
ted badge for gallery items */
.gallery-item.edited {
    border: 2px solid #28a745;
}

.edited-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #28a745;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/*
 Enhanced Gallery Management with Edit Indicators - Task 7 */

/* Edited badge for gallery items with animations */
.gallery-item.edited {
    border: 2px solid #28a745;
    animation: editedPulse 2s ease-in-out;
}

@keyframes editedPulse {
    0% {
        border-color: #28a745;
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    50% {
        border-color: #20c997;
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }

    100% {
        border-color: #28a745;
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.edited-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    animation: badgeSlideIn 0.5s ease-out;
    cursor: help;
}

@keyframes badgeSlideIn {
    0% {
        transform: translateX(20px) scale(0);
        opacity: 0;
    }

    50% {
        transform: translateX(-5px) scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.edited-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

/* Enhanced gallery item animations - consolidated with main styles above */

/* Selected styles consolidated above - removing duplicate */

/* Enhanced action buttons with better animations */
.gallery-action-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.gallery-action-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.3s, height 0.3s;
}

.gallery-action-btn:hover::before {
    width: 100%;
    height: 100%;
}

.gallery-action-btn:hover {
    background-color: white;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gallery-action-btn:active {
    transform: scale(0.95);
}

/* Status indicators */
.gallery-item-status {
    position: absolute;
    top: 5px;
    left: 5px;
    display: flex;
    gap: 4px;
    z-index: 2;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

.status-indicator.processing {
    background: #ffc107;
}

.status-indicator.completed {
    background: #28a745;
}

.status-indicator.error {
    background: #dc3545;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* Enhanced modal system */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.gallery-modal.active {
    opacity: 1;
    visibility: visible;
}

.gallery-modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.gallery-modal.active .gallery-modal-content {
    transform: scale(1) translateY(0);
}

.gallery-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.gallery-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.gallery-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.gallery-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    transform: rotate(90deg);
}

.gallery-modal-body {
    padding: 24px;
    text-align: center;
}

.gallery-modal-image {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery-modal-info {
    margin-top: 20px;
    text-align: left;
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
}

.gallery-modal-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.gallery-modal-info-item:last-child {
    margin-bottom: 0;
}

.gallery-modal-info-label {
    font-weight: 600;
    color: #555;
}

.gallery-modal-info-value {
    color: #333;
    font-family: monospace;
}

/* Confirmation dialogs */
.gallery-confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-confirmation);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.gallery-confirm-dialog.active {
    opacity: 1;
    visibility: visible;
}

.gallery-confirm-content {
    background: white;
    border-radius: 8px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.gallery-confirm-dialog.active .gallery-confirm-content {
    transform: scale(1);
}

.gallery-confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

.gallery-confirm-message {
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.gallery-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.gallery-confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.gallery-confirm-btn.primary {
    background: var(--photo-uploader-primary, #007cba);
    color: white;
}

.gallery-confirm-btn.primary:hover {
    background: var(--photo-uploader-primary-dark, #005a87);
    transform: translateY(-1px);
}

.gallery-confirm-btn.secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.gallery-confirm-btn.secondary:hover {
    background: #e9ecef;
}

.gallery-confirm-btn.danger {
    background: #dc3545;
    color: white;
}

.gallery-confirm-btn.danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
    }

    .gallery-action-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .gallery-modal-content {
        margin: 20px;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
    }

    .gallery-modal-body {
        padding: 16px;
    }

    .gallery-modal-image {
        max-height: 50vh;
    }
}

@media (max-width: 480px) {
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .gallery-item-actions {
        gap: 4px;
    }

    .gallery-action-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .edited-badge {
        font-size: 8px;
        padding: 2px 6px;
    }
}

/* Enhanced Gallery Management with Edit Indicators - Task 7 */

/* Edited badge for gallery items with animations */
.gallery-item.edited {
    border: 2px solid #28a745 !important;
    animation: editedPulse 2s ease-in-out;
}

@keyframes editedPulse {
    0% {
        border-color: #28a745;
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    50% {
        border-color: #20c997;
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }

    100% {
        border-color: #28a745;
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.edited-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: bold;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    animation: badgeSlideIn 0.5s ease-out;
    cursor: help;
}

@keyframes badgeSlideIn {
    0% {
        transform: translateX(20px) scale(0);
        opacity: 0;
    }

    50% {
        transform: translateX(-5px) scale(1.1);
        opacity: 0.8;
    }

    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.edited-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

/* Enhanced gallery item animations */
.gallery-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02) !important;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

.gallery-item.selected {
    border: 3px solid var(--photo-uploader-primary, #007cba) !important;
    transform: scale(1.05) !important;
    box-shadow: 0 8px 16px rgba(0, 124, 186, 0.3) !important;
}

/* Enhanced action buttons with better animations */
.gallery-action-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    overflow: hidden;
}

.gallery-action-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.3s, height 0.3s;
}

.gallery-action-btn:hover::before {
    width: 100%;
    height: 100%;
}

.gallery-action-btn:hover {
    background-color: white !important;
    transform: scale(1.15) rotate(5deg) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.gallery-action-btn:active {
    transform: scale(0.95) !important;
}

/* Status indicators */
.gallery-item-status {
    position: absolute;
    top: 5px;
    left: 5px;
    display: flex;
    gap: 4px;
    z-index: 2;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

.status-indicator.processing {
    background: #ffc107;
}

.status-indicator.completed {
    background: #28a745;
}

.status-indicator.error {
    background: #dc3545;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

/* Image loading animation */
.gallery-item img {
    transition: opacity 0.3s ease;
}

.gallery-item.loading img {
    opacity: 0.5;
}

.gallery-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--photo-uploader-primary, #007cba);
    border-radius: 50%;
    animation: imageLoadingSpin 1s linear infinite;
}

@keyframes imageLoadingSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Enhanced modal system */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
}

.gallery-modal.active {
    opacity: 1;
    visibility: visible;
}

.gallery-modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.gallery-modal.active .gallery-modal-content {
    transform: scale(1) translateY(0);
}

.gallery-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.gallery-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.gallery-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.gallery-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    transform: rotate(90deg);
}

.gallery-modal-body {
    padding: 24px;
    text-align: center;
}

.gallery-modal-image {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery-modal-info {
    margin-top: 20px;
    text-align: left;
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    font-size: 14px;
}

.gallery-modal-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.gallery-modal-info-item:last-child {
    margin-bottom: 0;
}

.gallery-modal-info-label {
    font-weight: 600;
    color: #555;
}

.gallery-modal-info-value {
    color: #333;
    font-family: monospace;
}

/* Confirmation dialogs */
.gallery-confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-confirmation);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.gallery-confirm-dialog.active {
    opacity: 1;
    visibility: visible;
}

.gallery-confirm-content {
    background: white;
    border-radius: 8px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.gallery-confirm-dialog.active .gallery-confirm-content {
    transform: scale(1);
}

.gallery-confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

.gallery-confirm-message {
    color: #666;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.gallery-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.gallery-confirm-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.gallery-confirm-btn.primary {
    background: var(--photo-uploader-primary, #007cba);
    color: white;
}

.gallery-confirm-btn.primary:hover {
    background: var(--photo-uploader-primary-dark, #005a87);
    transform: translateY(-1px);
}

.gallery-confirm-btn.secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.gallery-confirm-btn.secondary:hover {
    background: #e9ecef;
}

.gallery-confirm-btn.danger {
    background: #dc3545;
    color: white;
}

.gallery-confirm-btn.danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
        gap: 15px !important;
    }

    .gallery-action-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
    }

    .gallery-modal-content {
        margin: 20px;
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
    }

    .gallery-modal-body {
        padding: 16px;
    }

    .gallery-modal-image {
        max-height: 50vh;
    }
}

@media (max-width: 480px) {
    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
        gap: 10px !important;
    }

    .gallery-item-actions {
        gap: 4px !important;
    }

    .gallery-action-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 12px !important;
    }

    .edited-badge {
        font-size: 8px !important;
        padding: 2px 6px !important;
    }
}

/* Rat
e Limit Display Styles */
.rate-limit-display {
    margin-bottom: 20px;
    border-radius: var(--photo-uploader-border-radius);
    padding: 15px;
    border: 1px solid var(--photo-uploader-border);
    background: #fff;
    box-shadow: var(--photo-uploader-shadow);
    transition: var(--photo-uploader-transition);
}

.rate-limit-display.warning {
    border-color: var(--photo-uploader-warning);
    background: #fff3cd;
}

.rate-limit-display.blocked {
    border-color: var(--photo-uploader-danger);
    background: #f8d7da;
}

.rate-limit-display.info {
    border-color: var(--photo-uploader-primary);
    background: #d1ecf1;
}

/* Rate Limit Content */
.rate-limit-warning,
.rate-limit-blocked,
.rate-limit-status {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.rate-limit-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.rate-limit-icon.warning {
    color: var(--photo-uploader-warning);
}

.rate-limit-icon.blocked {
    color: var(--photo-uploader-danger);
}

.rate-limit-content {
    flex: 1;
}

.rate-limit-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--photo-uploader-dark);
}

.rate-limit-message {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.rate-limit-remaining,
.rate-limit-countdown {
    font-size: 13px;
    font-weight: 500;
    color: var(--photo-uploader-primary);
}

/* Rate Limit Status Info */
.rate-limit-status-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.status-label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--photo-uploader-dark);
}

/* Rate Limit Notifications */
.rate-limit-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-modal);
    max-width: 400px;
    border-radius: var(--photo-uploader-border-radius);
    box-shadow: var(--photo-uploader-shadow-lg);
    animation: slideInRight 0.3s ease;
}

.rate-limit-notification.blocked {
    background: #f8d7da;
    border: 1px solid var(--photo-uploader-danger);
}

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
}

.notification-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0;
    margin-left: 10px;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: var(--photo-uploader-dark);
}

/* Rate Limit Notice (for shortcode display) */
.photo-uploader-rate-limit-notice {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f8d7da;
    border: 1px solid var(--photo-uploader-danger);
    border-radius: var(--photo-uploader-border-radius);
    margin: 20px 0;
    text-align: center;
}

.rate-limit-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.rate-limit-message {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    color: var(--photo-uploader-dark);
}

/* Disabled Upload Interface */
.upload-area.disabled {
    cursor: not-allowed !important;
    opacity: 0.5 !important;
}

.upload-area.disabled .upload-button {
    cursor: not-allowed !important;
    opacity: 0.5 !important;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rate-limit-display {
    animation: fadeIn 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .rate-limit-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .rate-limit-status-info {
        flex-direction: column;
        gap: 10px;
    }

    .status-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .photo-uploader-rate-limit-notice {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .rate-limit-display.warning {
        border-width: 2px;
        background: #fff;
    }

    .rate-limit-display.blocked {
        border-width: 2px;
        background: #fff;
    }

    .rate-limit-display.info {
        border-width: 2px;
        background: #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    .rate-limit-display,
    .rate-limit-notification,
    .notification-close {
        animation: none;
        transition: none;
    }
}

/* 
Help Button and Modal Styles */

/* Upload Actions Container */
.upload-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* Help Button */
.help-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: transparent;
    border: 2px solid var(--photo-uploader-border);
    border-radius: var(--photo-uploader-border-radius);
    color: var(--photo-uploader-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--photo-uploader-transition);
    text-decoration: none;
}

.help-button:hover,
.help-button:focus {
    background-color: var(--photo-uploader-light);
    border-color: var(--photo-uploader-primary);
    color: var(--photo-uploader-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.help-button:active {
    transform: translateY(1px);
}

.help-icon {
    font-size: 16px;
    line-height: 1;
}

.help-text {
    font-size: 14px;
}

/* Help Modal */
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-modal);
    display: none;
}

.help-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.help-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: var(--photo-uploader-border-radius);
    box-shadow: var(--photo-uploader-shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.help-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--photo-uploader-border);
    background-color: var(--photo-uploader-light);
}

.help-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--photo-uploader-dark);
}

.help-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    color: #666;
    transition: var(--photo-uploader-transition);
    border-radius: 4px;
}

.help-modal-close:hover,
.help-modal-close:focus {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--photo-uploader-dark);
    outline: none;
}

.help-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.help-section {
    margin-bottom: 32px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section-title {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--photo-uploader-primary);
    border-bottom: 2px solid var(--photo-uploader-accent);
    padding-bottom: 8px;
}

.help-requirements-list,
.help-instructions-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.help-requirements-list li,
.help-instructions-list li {
    margin: 12px 0;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    color: #555;
    line-height: 1.5;
}

.help-requirements-list li:last-child,
.help-instructions-list li:last-child {
    border-bottom: none;
}

.help-requirements-list strong {
    color: var(--photo-uploader-dark);
    font-weight: 600;
}

/* Keyboard Shortcuts Grid */
.help-shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.help-shortcut {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: var(--photo-uploader-light);
    border-radius: var(--photo-uploader-border-radius);
    border: 1px solid var(--photo-uploader-border);
}

.help-key {
    display: inline-block;
    padding: 4px 8px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    color: var(--photo-uploader-dark);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.help-action {
    flex: 1;
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

.help-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--photo-uploader-border);
    background-color: var(--photo-uploader-light);
    text-align: center;
}

.help-modal-close-btn {
    background-color: var(--photo-uploader-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--photo-uploader-border-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--photo-uploader-transition);
}

.help-modal-close-btn:hover,
.help-modal-close-btn:focus {
    background-color: var(--photo-uploader-secondary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
}

.help-modal-close-btn:active {
    transform: translateY(1px);
}

/* Body class when modal is open */
body.help-modal-open {
    overflow: hidden;
}

/* Responsive Design for Help Modal */
@media (max-width: 768px) {
    .help-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .help-modal-header,
    .help-modal-body,
    .help-modal-footer {
        padding: 16px;
    }

    .help-modal-title {
        font-size: 18px;
    }

    .help-section-title {
        font-size: 16px;
    }

    .help-shortcuts-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .help-shortcut {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .upload-actions {
        flex-direction: column;
        gap: 8px;
    }

    .help-button {
        width: 100%;
        justify-content: center;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .help-modal-overlay {
        background-color: rgba(0, 0, 0, 0.8);
    }

    .help-key {
        border-color: #000;
        background-color: #fff;
        color: #000;
    }

    .help-button {
        border-color: #000;
        color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .help-button,
    .help-modal-close,
    .help-modal-close-btn {
        transition: none;
    }

    .help-modal-content {
        animation: none;
    }
}

/* Focus management for accessibility */
.help-modal:focus-within .help-modal-content {
    outline: 2px solid var(--photo-uploader-primary);
    outline-offset: 2px;
}

/* Print styles - hide modal */
@media print {
    .help-modal {
        display: none !important;
    }
}

/* ==
=== PRICING DISPLAY ===== */
.pricing-display {
    background: linear-gradient(135deg, var(--color-neutral-0) 0%, var(--color-neutral-50) 100%);
    border: 1px solid rgba(156, 163, 175, 0.25);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin: var(--space-6) 0;
    transition: all var(--duration-300) var(--ease-in-out);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pricing-display.pricing-updated {
    background: linear-gradient(135deg, var(--color-success-50) 0%, var(--color-success-100) 100%);
    border-color: var(--color-success-300);
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.pricing-summary {
    text-align: center;
}

.price-breakdown {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.price-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.price-line.total-price {
    background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%);
    color: var(--color-neutral-0);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-lg);
    box-shadow: var(--shadow-md);
}

.price-label {
    font-weight: var(--font-weight-medium);
    color: var(--color-neutral-700);
}

.price-line.total-price .price-label {
    color: var(--color-neutral-0);
}

.price-value {
    font-weight: var(--font-weight-semibold);
    color: var(--color-neutral-800);
}

.price-line.total-price .price-value {
    color: var(--color-neutral-0);
    font-size: var(--font-size-xl);
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    text-align: center;
    padding: var(--space-8) var(--space-6);
    background: linear-gradient(135deg, var(--color-neutral-50) 0%, var(--color-neutral-100) 100%);
    border-radius: var(--radius-xl);
    margin: var(--space-6) 0;
    border: 1px solid var(--color-neutral-200);
    box-shadow: var(--shadow-sm);
}

.submit-order-button {
    background: linear-gradient(135deg, var(--color-success-500) 0%, var(--color-success-600) 100%);
    color: var(--color-neutral-0);
    border: none;
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-xl);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--duration-300) var(--ease-in-out);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    min-width: 200px;
}

.submit-order-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--duration-500) var(--ease-in-out);
}

.submit-order-button:hover {
    background: linear-gradient(135deg, var(--color-success-600) 0%, var(--color-success-700) 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-xl);
}

.submit-order-button:hover::before {
    left: 100%;
}

.submit-order-button:active {
    transform: translateY(0) scale(1.02);
    transition-duration: var(--duration-100);
}

.submit-order-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== STATUS MESSAGES ===== */
.status-messages {
    margin: var(--space-4) 0;
}

.status-message {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    margin: var(--space-3) 0;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    animation: slideInUp var(--duration-300) var(--ease-out);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid;
}

.status-message.success {
    background: linear-gradient(135deg, var(--color-success-50) 0%, var(--color-success-100) 100%);
    border-left-color: var(--color-success-500);
    color: var(--color-success-800);
}

.status-message.error {
    background: linear-gradient(135deg, var(--color-error-50) 0%, var(--color-error-100) 100%);
    border-left-color: var(--color-error-500);
    color: var(--color-error-800);
}

.status-message.warning {
    background: linear-gradient(135deg, var(--color-warning-50) 0%, var(--color-warning-100) 100%);
    border-left-color: var(--color-warning-500);
    color: var(--color-warning-800);
}

.status-message.info {
    background: linear-gradient(135deg, var(--color-info-50) 0%, var(--color-info-100) 100%);
    border-left-color: var(--color-info-500);
    color: var(--color-info-800);
}

.status-message-icon {
    font-size: var(--font-size-lg);
    flex-shrink: 0;
    margin-top: var(--space-1);
}

.status-message-content {
    flex: 1;
}

.status-message-title {
    font-weight: var(--font-weight-semibold);
    margin: 0 0 var(--space-1) 0;
}

.status-message-text {
    margin: 0;
    line-height: var(--line-height-relaxed);
}

.status-message-dismiss {
    background: none;
    border: none;
    color: inherit;
    font-size: var(--font-size-lg);
    cursor: pointer;
    padding: var(--space-1);
    border-radius: var(--radius-base);
    transition: background-color var(--duration-200) var(--ease-in-out);
    flex-shrink: 0;
}

.status-message-dismiss:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* ===== HELP MODAL ===== */
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: var(--z-help-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--duration-300) var(--ease-in-out);
}

.help-modal.active {
    opacity: 1;
    visibility: visible;
}

.help-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--color-neutral-0);
    border-radius: var(--radius-2xl);
    max-width: 90vw;
    max-height: 90vh;
    width: 700px;
    box-shadow: var(--shadow-2xl);
    transition: transform var(--duration-300) var(--ease-out);
    overflow: hidden;
    border: 1px solid var(--color-neutral-200);
}

.help-modal.active .help-modal-content {
    transform: translate(-50%, -50%) scale(1);
}

.help-modal-header {
    padding: var(--space-6) var(--space-8);
    border-bottom: 1px solid var(--color-neutral-200);
    background: linear-gradient(135deg, var(--color-neutral-50) 0%, var(--color-primary-50) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help-modal-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-neutral-800);
    margin: 0;
}

.help-modal-close {
    background: none;
    border: none;
    font-size: var(--font-size-2xl);
    color: var(--color-neutral-500);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-full);
    transition: all var(--duration-200) var(--ease-in-out);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-modal-close:hover {
    background: var(--color-neutral-100);
    color: var(--color-neutral-700);
    transform: rotate(90deg);
}

.help-modal-body {
    padding: var(--space-8);
    max-height: 60vh;
    overflow-y: auto;
}

.help-section {
    margin-bottom: var(--space-8);
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-neutral-800);
    margin: 0 0 var(--space-4) 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.help-section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%);
    border-radius: var(--radius-full);
}

.help-requirements-list,
.help-instructions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-requirements-list li,
.help-instructions-list li {
    padding: var(--space-3) var(--space-4);
    margin: var(--space-2) 0;
    background: linear-gradient(135deg, var(--color-neutral-50) 0%, var(--color-neutral-100) 100%);
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--color-primary-500);
    line-height: var(--line-height-relaxed);
}

.help-shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-3);
}

.help-shortcut {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(135deg, var(--color-neutral-50) 0%, var(--color-neutral-100) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-neutral-200);
}

.help-key {
    background: var(--color-neutral-800);
    color: var(--color-neutral-0);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-base);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    font-family: monospace;
    min-width: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.help-action {
    font-size: var(--font-size-sm);
    color: var(--color-neutral-700);
    line-height: var(--line-height-tight);
}

.help-modal-footer {
    padding: var(--space-6) var(--space-8);
    border-top: 1px solid var(--color-neutral-200);
    background: var(--color-neutral-50);
    text-align: center;
}

.help-modal-close-btn {
    background: linear-gradient(135deg, var(--color-primary-500) 0%, var(--color-primary-600) 100%);
    color: var(--color-neutral-0);
    border: none;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--duration-200) var(--ease-in-out);
    box-shadow: var(--shadow-sm);
}

.help-modal-close-btn:hover {
    background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-700) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ===== LOADING STATES ===== */
.photo-uploader-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    border-radius: inherit;
}

.loading-content {
    text-align: center;
    padding: var(--space-8);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-neutral-200);
    border-top: 4px solid var(--color-primary-500);
    border-radius: var(--radius-full);
    animation: spin var(--duration-1000) linear infinite;
    margin: 0 auto var(--space-4);
}

.loading-text {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    color: var(--color-neutral-700);
    margin: 0;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .photo-uploader-container {
        padding: var(--space-4);
        margin: var(--space-4);
    }

    .uploader-title {
        font-size: var(--font-size-2xl);
    }

    /* Enhanced compact state for mobile */
    .photo-uploader-container.has-images .uploader-title {
        font-size: var(--font-size-lg);
        margin: 0 0 var(--space-1) 0;
    }

    .photo-uploader-container.has-images .uploader-description {
        font-size: var(--font-size-xs);
        line-height: var(--line-height-tight);
    }

    .photo-uploader-container.has-images .photo-uploader-header {
        margin-bottom: var(--space-1);
        padding-bottom: var(--space-1);
    }

    .upload-area {
        padding: var(--space-8) var(--space-4);
        min-height: 200px;
    }

    .upload-icon {
        font-size: var(--font-size-3xl);
    }

    .upload-text {
        font-size: var(--font-size-base);
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: var(--space-3);
    }

    /* Mobile gallery items: 2/3 image + 1/3 buttons layout */
    .gallery-item {
        aspect-ratio: 1 / 1.5;
        /* Taller to accommodate button area */
        display: flex;
        flex-direction: column;
        overflow: visible;
        /* Allow buttons to be visible outside image area */
    }

    .gallery-item-image-container {
        flex: 2;
        /* 2/3 of the space for image */
        position: relative;
        overflow: hidden;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        background: linear-gradient(135deg, var(--color-neutral-100) 0%, var(--color-neutral-200) 100%);
    }

    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Mobile button area - always visible */
    .gallery-item-overlay {
        position: static;
        /* Not overlaid on mobile */
        opacity: 1;
        /* Always visible */
        background: var(--color-neutral-0);
        border: 2px solid var(--color-neutral-200);
        border-top: none;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        flex: 1;
        /* 1/3 of the space for buttons */
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: none;
        box-shadow: var(--shadow-sm);
    }

    .gallery-item-actions {
        transform: translateY(0);
        /* No transform needed on mobile */
        gap: var(--space-3);
    }

    .gallery-action-btn {
        width: 36px;
        height: 36px;
        font-size: var(--font-size-base);
        background: var(--color-neutral-100);
        border: 1px solid var(--color-neutral-300);
        color: var(--color-neutral-700);
    }

    .gallery-action-btn:hover {
        background: var(--color-primary-50);
        border-color: var(--color-primary-300);
        color: var(--color-primary-700);
        transform: scale(1.05);
        /* Subtle hover effect on mobile */
    }

    /* Mobile selection styles */
    .gallery-item.selected .gallery-item-image-container {
        border: 2px solid var(--color-primary-500);
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    }

    .gallery-item.selected .gallery-item-overlay {
        border-color: var(--color-primary-500);
        background: var(--color-primary-25);
    }
}

/* Desktop styles - maintain hover behavior */
@media (min-width: 769px) {
    .gallery-item {
        aspect-ratio: 1;
        /* Square on desktop */
        display: block;
        /* Block layout on desktop */
        overflow: hidden;
        /* Hide overflow on desktop */
    }

    .gallery-item-image-container {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: var(--radius-xl);
    }

    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Desktop overlay - hover behavior */
    .gallery-item-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg,
                rgba(0, 0, 0, 0.8) 0%,
                rgba(0, 0, 0, 0.6) 50%,
                rgba(0, 0, 0, 0.8) 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: all var(--duration-300) var(--ease-in-out);
        z-index: 2;
        backdrop-filter: blur(2px);
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .gallery-item:hover .gallery-item-overlay {
        opacity: 1;
    }

    .gallery-item-actions {
        transform: translateY(var(--space-2));
        transition: transform var(--duration-200) var(--ease-out);
        gap: var(--space-2);
    }

    .gallery-item:hover .gallery-item-actions {
        transform: translateY(0);
    }

    .gallery-action-btn {
        width: 44px;
        height: 44px;
        border: none;
        border-radius: var(--radius-full);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        color: var(--color-neutral-700);
        font-size: var(--font-size-lg);
    }

    .gallery-action-btn:hover {
        background: rgba(255, 255, 255, 1);
        transform: scale(1.15) rotate(5deg);
        box-shadow: var(--shadow-xl);
    }

    /* Desktop selection styles */
    .gallery-item.selected {
        border-color: var(--color-primary-500);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3), var(--shadow-lg);
    }

    .gallery-item.selected .gallery-item-image-container {
        border: none;
        box-shadow: none;
    }

    .gallery-item.selected .gallery-item-overlay {
        border: none;
        background: linear-gradient(135deg,
                rgba(0, 0, 0, 0.8) 0%,
                rgba(0, 0, 0, 0.6) 50%,
                rgba(0, 0, 0, 0.8) 100%);
    }

    /* Keep gallery header side-by-side on desktop */
    .gallery-header {
        flex-direction: row;
        align-items: center;
        gap: var(--space-3);
        justify-content: space-between;
    }

    .gallery-controls {
        flex-shrink: 0;
    }

    .add-more-button {
        min-width: 140px;
        justify-content: center;
    }

    .photo-uploader-container.has-images .upload-area {
        min-height: 120px;
        padding: var(--space-4) var(--space-3);
    }

    .help-modal-content {
        width: 95vw;
        margin: var(--space-4);
    }

    .help-modal-header,
    .help-modal-body,
    .help-modal-footer {
        padding: var(--space-4);
    }

    .help-shortcuts-grid {
        grid-template-columns: 1fr;
    }

    .price-breakdown {
        gap: var(--space-2);
    }

    .price-line {
        padding: var(--space-2) var(--space-3);
    }
}

@media (max-width: 480px) {
    .photo-uploader-container {
        padding: var(--space-3);
        margin: var(--space-2);
        border-radius: var(--radius-xl);
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: var(--space-2);
    }

    .upload-area {
        padding: var(--space-6) var(--space-3);
        min-height: 160px;
    }

    .gallery-action-btn {
        width: 36px;
        height: 36px;
        font-size: var(--font-size-base);
    }

    .gallery-item-actions {
        gap: var(--space-1);
    }

    .upload-actions {
        flex-direction: column;
        gap: var(--space-2);
    }

    .upload-button,
    .help-button {
        width: 100%;
    }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
@media (prefers-reduced-motion: reduce) {

    .gallery-item,
    .gallery-action-btn,
    .btn,
    .upload-area,
    .status-message {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-contrast: high) {
    .upload-area {
        border-width: 3px;
        border-style: solid;
    }

    .gallery-item {
        border-width: 3px;
    }

    .btn {
        border-width: 2px;
    }
}

/* Focus indicators for keyboard navigation */
.upload-area:focus-within,
.gallery-item:focus-within,
.btn:focus-visible,
.gallery-action-btn:focus-visible {
    outline: 3px solid var(--color-primary-500);
    outline-offset: 2px;
}

/* Print styles */
@media print {

    .photo-uploader-loading,
    .help-modal,
    .gallery-item-overlay,
    .upload-area::before,
    .gallery-item::before {
        display: none !important;
    }

    .photo-uploader-container {
        box-shadow: none;
        border: 1px solid var(--color-neutral-800);
    }
}

/* ===== THEME VARIATIONS ===== */
.photo-uploader-container.theme-dark {
    background: var(--color-neutral-900);
    color: var(--color-neutral-100);
    border-color: var(--color-neutral-700);
}

.photo-uploader-container.theme-dark .upload-area {
    background: linear-gradient(135deg, var(--color-neutral-800) 0%, var(--color-neutral-700) 100%);
    border-color: var(--color-neutral-600);
}

.photo-uploader-container.theme-dark .image-gallery {
    background: linear-gradient(135deg, var(--color-neutral-800) 0%, var(--color-neutral-700) 100%);
    border-color: var(--color-neutral-600);
}

/* High-performance GPU acceleration for animations */
.gallery-item,
.gallery-action-btn,
.btn,
.upload-area {
    will-change: transform;
    transform: translateZ(0);
}

/* Smooth scrolling for modal content */
.help-modal-body {
    scroll-behavior: smooth;
}

/* Custom scrollbar for modal */
.help-modal-body::-webkit-scrollbar {
    width: 8px;
}

.help-modal-body::-webkit-scrollbar-track {
    background: var(--color-neutral-100);
    border-radius: var(--radius-full);
}

.help-modal-body::-webkit-scrollbar-thumb {
    background: var(--color-neutral-400);
    border-radius: var(--radius-full);
}

.help-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--color-neutral-500);
}

/* 
===== ACTION BUTTONS SECTION ===== */
.action-buttons {
    text-align: center;
    padding: var(--space-8) var(--space-6);
    background: linear-gradient(135deg, var(--color-neutral-50) 0%, var(--color-neutral-100) 100%);
    border-radius: var(--radius-xl);
    margin: var(--space-6) 0;
    border: 1px solid var(--color-neutral-200);
    box-shadow: var(--shadow-sm);
    border-color: #d1d5db;
    position: relative;
    z-index: 1;
    /* Ensure it's always visible and accessible */
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: var(--space-4);
}

.submit-order-button {
    background: linear-gradient(135deg, var(--color-success-500) 0%, var(--color-success-600) 100%);
    color: var(--color-neutral-0);
    border: none;
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-xl);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--duration-300) var(--ease-in-out);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    min-width: 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    line-height: var(--line-height-tight);
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
    /* Ensure button is always accessible */
    z-index: 2;
}

.submit-order-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--duration-500) var(--ease-in-out);
}

.submit-order-button:hover {
    background: linear-gradient(135deg, var(--color-success-600) 0%, var(--color-success-700) 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-xl);
}

.submit-order-button:hover::before {
    left: 100%;
}

.submit-order-button:active {
    transform: translateY(0) scale(1.02);
    transition-duration: var(--duration-100);
}

.submit-order-button:focus {
    outline: 2px solid var(--color-success-500);
    outline-offset: 2px;
}

.submit-order-button:focus-visible {
    outline: 2px solid var(--color-success-500);
    outline-offset: 2px;
}

.submit-order-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    background: var(--color-neutral-400) !important;
}

.submit-order-button:disabled::before {
    display: none;
}

.submit-order-button .btn-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ===== LAYOUT FIXES FOR RELIABILITY ===== */

/* Ensure the photo uploader container has proper flow */
.photo-uploader-container {
    display: flex;
    flex-direction: column;
    min-height: auto;
    overflow: visible;
    position: relative;
}

.photo-uploader-interface {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Fix for gallery section that might cause layout issues */
.photo-uploader-gallery-section {
    width: 100%;
    position: relative;
    z-index: 1;
    margin-bottom: var(--space-6);
}

/* Fix for pricing display that might interfere with layout */
.pricing-display {
    width: 100%;
    position: relative;
    z-index: 1;
    margin: var(--space-6) 0;
    /* Prevent negative margins that could hide content */
    margin-bottom: var(--space-6) !important;
}

/* Ensure action buttons are always visible and accessible */
.action-buttons {
    width: 100%;
    position: relative;
    z-index: 2;
    /* Force it above other elements */
    margin-top: var(--space-6) !important;
    margin-bottom: var(--space-6) !important;
    /* Prevent any layout issues */
    clear: both;
    overflow: visible;
}

/* Fix for status messages that might interfere */
.status-messages {
    width: 100%;
    position: relative;
    z-index: 1;
    margin: var(--space-4) 0;
    /* Ensure it doesn't interfere with action buttons */
    margin-bottom: var(--space-6) !important;
}

/* ===== RESPONSIVE FIXES FOR ACTION BUTTONS ===== */
@media (max-width: 768px) {
    .action-buttons {
        padding: var(--space-6) var(--space-4);
        margin: var(--space-4) 0;
        /* Ensure proper spacing on mobile */
        margin-top: var(--space-6) !important;
        margin-bottom: var(--space-6) !important;
    }

    .submit-order-button {
        padding: var(--space-3) var(--space-6);
        font-size: var(--font-size-base);
        min-width: 180px;
        /* Ensure it's touch-friendly */
        min-height: 48px;
    }

    .submit-order-button .btn-icon {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .action-buttons {
        padding: var(--space-4) var(--space-3);
        margin: var(--space-3) 0;
        /* Ensure proper spacing on small mobile */
        margin-top: var(--space-4) !important;
        margin-bottom: var(--space-4) !important;
    }

    .submit-order-button {
        width: 100%;
        max-width: 280px;
        padding: var(--space-4) var(--space-6);
        font-size: var(--font-size-base);
        /* Ensure it's easily tappable */
        min-height: 52px;
    }
}

/* ===== DEBUGGING HELPERS (can be removed in production) ===== */
.action-buttons.debug {
    border: 2px solid red !important;
    background: yellow !important;
}

.submit-order-button.debug {
    border: 2px solid blue !important;
}

/* ===== PRINT STYLES ===== */
@media print {
    .action-buttons {
        display: none !important;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .action-buttons {
        border-width: 2px;
        border-color: var(--color-neutral-800);
    }

    .submit-order-button {
        border: 2px solid var(--color-success-700);
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    .submit-order-button {
        transition: none !important;
    }

    .submit-order-button::before {
        display: none !important;
    }

    .submit-order-button:hover {
        transform: none !important;
    }
}

/* ===== FOCUS MANAGEMENT ===== */
.action-buttons:focus-within {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
    border-radius: var(--radius-xl);
}

/* ===== LOADING STATE FOR ACTION BUTTONS ===== */
.action-buttons.loading {
    opacity: 0.7;
    pointer-events: none;
}

.action-buttons.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid var(--color-neutral-300);
    border-top: 2px solid var(--color-primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 3;
}

/* ===== STICKY POSITIONING OPTION (if needed) ===== */
.action-buttons.sticky {
    position: sticky;
    bottom: var(--space-4);
    z-index: 100;
    margin-top: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-neutral-300);
    box-shadow: var(--shadow-xl);
}

/* ===== ANIMATION FOR BUTTON APPEARANCE ===== */
.action-buttons {
    animation: slideInUp var(--duration-500) var(--ease-out);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(var(--space-8));
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ENSURE PROPER STACKING CONTEXT ===== */
.photo-uploader-container {
    /* Create a new stacking context */
    position: relative;
    z-index: 0;
}

.photo-uploader-interface>* {
    /* Ensure all direct children have proper stacking */
    position: relative;
    z-index: 1;
}

.action-buttons {
    /* Ensure action buttons are always on top */
    z-index: 10 !important;
}

/* ===== FALLBACK FOR OLDER BROWSERS ===== */
.no-flexbox .action-buttons {
    display: block;
    text-align: center;
}

.no-flexbox .submit-order-button {
    display: inline-block;
    vertical-align: middle;
}

/* ===== STATUS MESSAGES ===== */
.status-messages {
    margin: var(--space-4) 0;
}

.status-message {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.status-message:last-child {
    margin-bottom: 0;
}

.status-message.success {
    background-color: var(--color-success-50);
    border-color: var(--color-success-200);
    color: var(--color-success-800);
}

.status-message.warning {
    background-color: var(--color-warning-50);
    border-color: var(--color-warning-200);
    color: var(--color-warning-800);
}

.status-message.error {
    background-color: var(--color-error-50);
    border-color: var(--color-error-200);
    color: var(--color-error-800);
}

.status-message.info {
    background-color: var(--color-primary-50);
    border-color: var(--color-primary-200);
    color: var(--color-primary-800);
}

/* Status message icons */
.status-message::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-top: 2px;
}

.status-message.success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2315803d'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 13l4 4L19 7'%3E%3C/path%3E%3C/svg%3E");
}

.status-message.warning::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23d97706'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z'%3E%3C/path%3E%3C/svg%3E");
}

.status-message.error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23dc2626'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 18L18 6M6 6l12 12'%3E%3C/path%3E%3C/svg%3E");
}

.status-message.info::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%232563eb'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z'%3E%3C/path%3E%3C/svg%3E");
}

/* Responsive status messages */
@media (max-width: 640px) {
    .status-message {
        padding: var(--space-3) var(--space-4);
        font-size: var(--font-size-sm);
    }

    .status-message::before {
        width: 16px;
        height: 16px;
    }
}

/* ===== H
ELP MODAL ===== */
.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal);
    display: none;
    opacity: 0;
    transition: opacity var(--duration-200) var(--ease-in-out);
}

.help-modal.show {
    opacity: 1;
}

.help-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.help-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--color-neutral-0);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--color-neutral-200);
}

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6) var(--space-6) var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-neutral-200);
}

.help-modal-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-neutral-900);
    margin: 0;
}

.help-modal-close {
    background: none;
    border: none;
    font-size: var(--font-size-2xl);
    color: var(--color-neutral-500);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: all var(--duration-200) var(--ease-in-out);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.help-modal-close:hover {
    background-color: var(--color-neutral-100);
    color: var(--color-neutral-700);
}

.help-modal-close:focus {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

.help-modal-body {
    padding: var(--space-6);
}

.help-section {
    margin-bottom: var(--space-6);
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-neutral-800);
    margin: 0 0 var(--space-3) 0;
}

.help-requirements-list,
.help-instructions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-requirements-list li,
.help-instructions-list li {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-neutral-100);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
}

.help-requirements-list li:last-child,
.help-instructions-list li:last-child {
    border-bottom: none;
}

.help-shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.help-shortcut {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2);
    background-color: var(--color-neutral-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-neutral-200);
}

.help-key {
    background-color: var(--color-neutral-200);
    border: 1px solid var(--color-neutral-300);
    border-radius: var(--radius-sm);
    padding: var(--space-1) var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-neutral-700);
    min-width: 24px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.help-action {
    font-size: var(--font-size-sm);
    color: var(--color-neutral-600);
    flex: 1;
}

/* Help Button */
.help-button {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background-color: transparent;
    border: 1px solid var(--color-neutral-300);
    border-radius: var(--radius-md);
    color: var(--color-neutral-600);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--duration-200) var(--ease-in-out);
}

.help-button:hover {
    background-color: var(--color-neutral-50);
    border-color: var(--color-neutral-400);
    color: var(--color-neutral-700);
}

.help-button:focus {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

.help-icon {
    font-size: var(--font-size-base);
}

.help-text {
    font-weight: var(--font-weight-medium);
}

/* Body class when modal is open */
body.help-modal-open {
    overflow: hidden;
}

/* Responsive help modal */
@media (max-width: 640px) {
    .help-modal-content {
        width: 95%;
        max-height: 90vh;
        margin: var(--space-4);
    }

    .help-modal-header {
        padding: var(--space-4);
    }

    .help-modal-body {
        padding: var(--space-4);
    }

    .help-shortcuts-grid {
        grid-template-columns: 1fr;
    }

    .help-shortcut {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
}

/* Animation for modal appearance */
@keyframes helpModalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.help-modal[style*="block"] .help-modal-content {
    animation: helpModalFadeIn var(--duration-300) var(--ease-out);
}

/* ===== PROFESSIONAL CONTAINER ENHANCEMENTS ===== */

/* Ensure all child elements are properly contained */
.photo-uploader-container * {
    box-sizing: border-box;
}

/* Prevent horizontal overflow */
.photo-uploader-container,
.photo-uploader-interface,
.photo-uploader-gallery-section,
.image-gallery,
.gallery-grid,
.upload-area {
    max-width: 100%;
    overflow-x: hidden;
}

/* Professional spacing and alignment */
.photo-uploader-container>* {
    width: 100%;
}

/* Enhanced visual hierarchy */
.photo-uploader-container.has-images .upload-area {
    background: linear-gradient(135deg, var(--color-neutral-25) 0%, var(--color-primary-25) 100%);
    border-color: var(--color-primary-200);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.photo-uploader-container.has-images .image-gallery {
    background: linear-gradient(135deg, var(--color-neutral-0) 0%, var(--color-primary-25) 100%);
    border-color: var(--color-primary-200);
    box-shadow: var(--shadow-md);
}

/* Smooth transitions for professional feel */
.photo-uploader-container,
.photo-uploader-interface,
.photo-uploader-gallery-section,
.image-gallery,
.upload-area {
    transition: all var(--duration-300) var(--ease-in-out);
}

/* Focus management for accessibility */
.photo-uploader-container:focus-within {
    box-shadow: var(--shadow-xl), 0 0 0 3px var(--color-primary-200);
}

/* Professional loading states */
.photo-uploader-container.loading {
    position: relative;
    pointer-events: none;
}

.photo-uploader-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: var(--z-dropdown);
}

/* ===== ENHANCED TITLE SECTION STYLING ===== */

/* Better text centering and spacing */
.title-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--space-2);
}

/* Professional typography hierarchy */
.uploader-title {
    background: linear-gradient(135deg, var(--color-neutral-900) 0%, var(--color-primary-700) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    display: block;
}

.uploader-description {
    text-align: center;
    display: block;
}

/* Smooth state transitions */
.photo-uploader-container .title-section,
.photo-uploader-container .uploader-title,
.photo-uploader-container .uploader-description,
.photo-uploader-container .photo-uploader-header {
    transition: all var(--duration-400) var(--ease-out);
}

/* Enhanced compact state visual improvements */
.photo-uploader-container.has-images .title-section {
    gap: var(--space-1);
}

.photo-uploader-container.has-images .uploader-title {
    background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-800) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Fallback for browsers that don't support background-clip: text */
@supports not (background-clip: text) {
    .uploader-title {
        background: none;
        -webkit-background-clip: initial;
        background-clip: initial;
        -webkit-text-fill-color: initial;
        color: var(--color-neutral-900);
    }

    .photo-uploader-container.has-images .uploader-title {
        background: none;
        -webkit-background-clip: initial;
        background-clip: initial;
        -webkit-text-fill-color: initial;
        color: var(--color-primary-700);
    }
}

/* Additional mobile enhancements */
@media (max-width: 480px) {
    .photo-uploader-container.has-images .uploader-title {
        font-size: var(--font-size-base);
        font-weight: var(--font-weight-bold);
    }

    .photo-uploader-container.has-images .uploader-description {
        font-size: var(--font-size-xs);
        opacity: 0.9;
    }

    .photo-uploader-container.has-images .photo-uploader-header {
        padding: var(--space-1) var(--space-2);
        margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-2)) var(--space-1) calc(-1 * var(--space-2));
    }
}

/* 
===== ADAPTIVE WIDTH ENHANCEMENTS ===== */

/* Enhanced responsive gallery grid for better space utilization */
@media (min-width: 768px) {
    .photo-uploader-container {
        max-width: var(--uploader-max-width-tablet);
        width: 100%;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--space-3);
    }
}

@media (min-width: 1024px) {
    .photo-uploader-container {
        max-width: var(--uploader-max-width-desktop) !important;
        width: 100% !important;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--space-3);
    }

    /* Enhanced upload area for desktop */
    .upload-area {
        padding: var(--space-12) var(--space-8);
        min-height: 280px;
    }
}

@media (min-width: 1440px) {
    .photo-uploader-container {
        max-width: var(--uploader-max-width-large) !important;
        width: 100% !important;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: var(--space-3);
    }

    .upload-area {
        padding: var(--space-14) var(--space-10);
        min-height: 320px;
    }
}

@media (min-width: 1920px) {
    .photo-uploader-container {
        max-width: var(--uploader-max-width-xl);
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: var(--space-3);
    }

    .upload-area {
        padding: var(--space-16) var(--space-12);
        min-height: 360px;
    }
}

@media (min-width: 2560px) {
    .photo-uploader-container {
        max-width: min(85vw, 2400px);
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: var(--space-4);
    }
}

/* ===== PROFESSIONAL DESKTOP ENHANCEMENTS ===== */
@media (min-width: 1024px) {
    .photo-uploader-container {
        max-width: var(--uploader-max-width-desktop);
        width: 100%;
        margin: 0 auto;
    }

    .photo-uploader-container.theme-default {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
        border: 1px solid var(--color-neutral-150);
        background: linear-gradient(135deg, var(--color-neutral-0) 0%, var(--color-neutral-25) 100%);
    }

    .photo-uploader-container.theme-default:hover {
        box-shadow: 0 24px 72px rgba(0, 0, 0, 0.12), 0 12px 32px rgba(0, 0, 0, 0.08);
        transform: translateY(-2px);
    }

    /* Enhanced header for desktop */
    .photo-uploader-header {
        padding-bottom: var(--space-8);
        margin-bottom: var(--space-10);
    }

    .uploader-title {
        font-size: var(--font-size-4xl);
        letter-spacing: -0.02em;
    }

    .uploader-description {
        font-size: var(--font-size-xl);
        max-width: 700px;
    }

    /* Professional spacing and layout */
    .photo-uploader-interface {
        gap: var(--space-8);
    }

    .upload-area {
        margin-bottom: var(--space-10);
        background: linear-gradient(135deg, var(--color-neutral-50) 0%, var(--color-primary-25) 50%, var(--color-neutral-50) 100%);
        border-width: 3px;
    }

    .image-gallery {
        padding: var(--space-8);
        background: linear-gradient(135deg, var(--color-neutral-25) 0%, var(--color-neutral-50) 100%);
        box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.04);
    }
}

@media (min-width: 1440px) {
    .photo-uploader-container.theme-default {
        padding: var(--space-12);
        border-radius: var(--radius-3xl);
    }

    .uploader-title {
        font-size: var(--font-size-5xl);
    }

    .uploader-description {
        font-size: var(--font-size-2xl);
        max-width: 800px;
    }

    .upload-area {
        border-radius: var(--radius-2xl);
        padding: var(--space-16) var(--space-12);
    }

    .image-gallery {
        border-radius: var(--radius-2xl);
        padding: var(--space-10);
    }
}

.upload-area {
    padding: var(--space-20) var(--space-16);
    min-height: 400px;
}


/* Adaptive container behavior */
.photo-uploader-container {
    /* Smooth width transitions */
    transition: max-width var(--duration-300) var(--ease-in-out),
        padding var(--duration-300) var(--ease-in-out);
}

/* Enhanced visual hierarchy for larger screens */
@media (min-width: 1024px) {
    .uploader-title {
        font-size: var(--font-size-4xl);
    }

    .uploader-description {
        font-size: var(--font-size-xl);
        max-width: 700px;
    }

    .photo-uploader-container.has-images .uploader-title {
        font-size: var(--font-size-2xl);
    }

    .photo-uploader-container.has-images .uploader-description {
        font-size: var(--font-size-base);
        max-width: 600px;
    }
}

@media (min-width: 1440px) {
    .uploader-title {
        font-size: var(--font-size-5xl);
    }

    .uploader-description {
        font-size: var(--font-size-2xl);
        max-width: 800px;
    }

    .photo-uploader-container.has-images .uploader-title {
        font-size: var(--font-size-3xl);
    }

    .photo-uploader-container.has-images .uploader-description {
        font-size: var(--font-size-lg);
        max-width: 700px;
    }
}

/* ===== CHUNKED UPLOAD PROGRESS ===== */
.chunked-upload-progress {
    margin: var(--space-4) 0;
    padding: var(--space-4);
    background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-primary-100) 100%);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--color-primary-500);
    box-shadow: var(--shadow-sm);
}

.chunked-upload-progress .progress-bar {
    width: 100%;
    height: 20px;
    background: var(--color-gray-200);
    border-radius: 10px;
    overflow: hidden;
    margin: var(--space-3) 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chunked-upload-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary-500), var(--color-primary-400));
    width: 0%;
    transition: width 0.3s var(--ease-out);
    border-radius: 10px;
    position: relative;
}

.chunked-upload-progress .progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.chunked-upload-progress .progress-text {
    font-size: var(--font-size-sm);
    color: var(--color-gray-700);
    text-align: center;
    margin: var(--space-2) 0;
    font-weight: 600;
}

.chunked-upload-progress .chunk-details {
    font-size: var(--font-size-xs);
    color: var(--color-gray-600);
    margin-top: var(--space-2);
    text-align: center;
}

/* Submit button states for chunked upload */
.submit-order-btn.uploading {
    background: linear-gradient(135deg, #ffc107, #ffca2c);
    color: #212529;
    cursor: not-allowed;
    position: relative;
    overflow: hidden;
}

.submit-order-btn.uploading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: uploadingShimmer 1.5s infinite;
}

@keyframes uploadingShimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

.submit-order-btn.finalizing {
    background: linear-gradient(135deg, #17a2b8, #20c997);
    color: white;
    cursor: not-allowed;
}

/* Fallback styles for older browsers */
.chunked-upload-progress {
    background: #f8f9fa;
}

.chunked-upload-progress .progress-fill {
    background: #007cba;
}

.submit-order-btn.uploading {
    background: #ffc107;
}

.submit-order-btn.finalizing {
    background: #17a2b8;
}

/* ===== DESKTOP WIDTH OPTIMIZATION ===== */
/* Ensure maximum width utilization on desktop screens */
@media (min-width: 1024px) {
    .photo-uploader-container {
        max-width: var(--uploader-max-width-desktop) !important;
        width: 100% !important;
    }
}

@media (min-width: 1440px) {
    .photo-uploader-container {
        max-width: var(--uploader-max-width-large) !important;
        width: 100% !important;
    }
}

@media (min-width: 1920px) {
    .photo-uploader-container {
        max-width: var(--uploader-max-width-xl) !important;
        width: 100% !important;
    }
}

/* ===== C
ONFIRMATION DIALOG STYLES ===== */
.photo-uploader-confirmation-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-confirmation);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-300) var(--ease-in-out),
        visibility var(--duration-300) var(--ease-in-out);
}

.photo-uploader-confirmation-dialog.active {
    opacity: 1;
    visibility: visible;
}

.photo-uploader-confirmation-dialog.closing {
    opacity: 0;
    visibility: hidden;
}

.confirmation-dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.7));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.confirmation-dialog-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    max-width: min(540px, 92vw);
    width: 92vw;
    max-height: min(85vh, calc(100vh - 40px));
    height: auto;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--duration-300) cubic-bezier(0.34, 1.56, 0.64, 1);
    box-sizing: border-box;
    /* Ensure dialog never goes off-screen */
    margin: 20px;
}

.photo-uploader-confirmation-dialog.active .confirmation-dialog-content {
    transform: translate(-50%, -50%) scale(1);
}

.photo-uploader-confirmation-dialog.closing .confirmation-dialog-content {
    transform: translate(-50%, -50%) scale(0.85);
}

/* Enhanced Header with Icon */
.confirmation-dialog-header {
    padding: clamp(8px, 2vh, var(--space-4)) clamp(12px, 3vw, var(--space-6)) clamp(6px, 1.5vh, var(--space-3)) clamp(12px, 3vw, var(--space-6));
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid var(--color-neutral-200);
    text-align: center;
    position: relative;
    flex-shrink: 0;
    min-height: 0;
}

.confirmation-dialog-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(32px, 8vw, 56px);
    height: clamp(32px, 8vw, 56px);
    background: linear-gradient(135deg, var(--pu-primary), var(--pu-primary-light, #2196f3));
    border-radius: 50%;
    margin-bottom: clamp(4px, 1vh, var(--space-2));
    box-shadow: 0 8px 25px -8px var(--pu-primary);
}

.confirmation-dialog-icon svg {
    color: white;
    width: clamp(14px, 4vw, 24px);
    height: clamp(14px, 4vw, 24px);
}

.confirmation-dialog-header h3 {
    margin: 0 0 clamp(2px, 0.5vh, var(--space-1)) 0;
    font-size: clamp(14px, 4vw, var(--text-lg));
    font-weight: var(--font-weight-bold);
    color: var(--color-neutral-900);
    line-height: var(--line-height-tight);
}

.confirmation-dialog-subtitle {
    margin: 0;
    font-size: clamp(11px, 3vw, var(--text-sm));
    color: var(--color-neutral-600);
    font-weight: var(--font-weight-medium);
}

/* Enhanced Body */
.confirmation-dialog-body {
    padding: clamp(8px, 2vh, var(--space-4)) clamp(12px, 3vw, var(--space-6));
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    max-height: calc(85vh - 120px);
    /* Reserve space for header and footer */
}

.confirmation-dialog-question {
    text-align: center;
    margin-bottom: var(--space-6);
}

.confirmation-dialog-question p {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--font-weight-medium);
    color: var(--color-neutral-800);
    line-height: var(--line-height-relaxed);
}

/* Summary Cards */
.confirmation-dialog-summary {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    justify-content: center;
    flex-wrap: wrap;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--color-neutral-50);
    border: 2px solid var(--color-neutral-200);
    border-radius: var(--radius-xl);
    min-width: 120px;
    transition: all var(--duration-200) var(--ease-in-out);
}

.summary-card.edited {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border-color: var(--color-green-300);
}

.summary-card.original {
    background: linear-gradient(135deg, #fef3c7, #fef9c3);
    border-color: var(--color-yellow-300);
}

.summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.summary-card.edited .summary-icon {
    background: linear-gradient(135deg, var(--color-green-500), var(--color-green-600));
    color: white;
}

.summary-card.original .summary-icon {
    background: linear-gradient(135deg, var(--color-yellow-500), var(--color-yellow-600));
    color: white;
}

.summary-content {
    text-align: left;
}

.summary-number {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-neutral-900);
    line-height: 1;
}

.summary-label {
    font-size: var(--text-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-neutral-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* Enhanced Note */
.confirmation-dialog-note {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    background: linear-gradient(135deg, #dbeafe, #e0f2fe);
    border: 2px solid var(--color-blue-200);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    font-size: var(--text-sm);
    color: var(--color-blue-800);
}

.note-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--color-blue-500);
    border-radius: 50%;
    color: white;
    flex-shrink: 0;
    margin-top: 1px;
}

.note-content {
    flex: 1;
    line-height: var(--line-height-relaxed);
}

.note-content strong {
    color: var(--color-blue-900);
    font-weight: var(--font-weight-semibold);
}

/* Enhanced Footer */
.confirmation-dialog-footer {
    padding: clamp(6px, 1.5vh, var(--space-3)) clamp(12px, 3vw, var(--space-6)) clamp(8px, 2vh, var(--space-4)) clamp(12px, 3vw, var(--space-6));
    display: flex;
    gap: clamp(8px, 2vw, var(--space-3));
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-top: 1px solid var(--color-neutral-200);
    flex-shrink: 0;
    min-height: 0;
}

/* Enhanced Buttons */
.confirmation-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-xl);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--duration-200) var(--ease-in-out);
    border: 2px solid transparent;
    min-width: 140px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.confirmation-btn:focus {
    outline: 3px solid var(--color-blue-500);
    outline-offset: 2px;
}

.confirmation-btn svg {
    width: 16px;
    height: 16px;
    transition: transform var(--duration-200) var(--ease-in-out);
}

.confirmation-btn-cancel {
    background: white;
    color: var(--color-neutral-700);
    border-color: var(--color-neutral-300);
    box-shadow: var(--shadow-sm);
}

.confirmation-btn-cancel:hover {
    background: var(--color-neutral-50);
    border-color: var(--color-neutral-400);
    color: var(--color-neutral-800);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.confirmation-btn-cancel:hover svg {
    transform: rotate(90deg);
}

.confirmation-btn-cancel:active {
    background: var(--color-neutral-100);
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.confirmation-btn-confirm {
    background: linear-gradient(135deg, var(--pu-primary), var(--pu-primary-light, #2196f3));
    color: white;
    border-color: var(--pu-primary);
    box-shadow: 0 4px 14px 0 rgba(0, 124, 186, 0.3);
    position: relative;
}

.confirmation-btn-confirm::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--duration-500) var(--ease-in-out);
}

.confirmation-btn-confirm:hover::before {
    left: 100%;
}

.confirmation-btn-confirm:hover {
    background: linear-gradient(135deg, var(--pu-primary-dark, #004a6b), var(--pu-primary));
    border-color: var(--pu-primary-dark, #004a6b);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 0 rgba(0, 124, 186, 0.4);
}

.confirmation-btn-confirm:hover svg {
    transform: scale(1.1);
}

.confirmation-btn-confirm:active {
    background: var(--pu-primary-dark, #004a6b);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px 0 rgba(0, 124, 186, 0.3);
}

/* Enhanced Mobile Responsiveness for Confirmation Dialog */
@media (max-width: 768px) {
    .photo-uploader-confirmation-dialog {
        padding: 10px !important;
        box-sizing: border-box !important;
    }

    .confirmation-dialog-content {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: calc(100vh - 20px) !important;
        max-height: calc(100vh - 20px) !important;
        margin: 0 !important;
        transform: none !important;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
    }

    .photo-uploader-confirmation-dialog.active .confirmation-dialog-content {
        transform: none !important;
    }

    .photo-uploader-confirmation-dialog.closing .confirmation-dialog-content {
        transform: none !important;
    }

    .confirmation-dialog-header {
        padding: 8px 12px 6px 12px;
        flex-shrink: 0;
        min-height: auto;
    }

    .confirmation-dialog-body {
        padding: 6px 12px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
        max-height: none;
    }

    .confirmation-dialog-footer {
        padding: 6px 12px 8px 12px;
        flex-direction: column;
        gap: 8px;
        flex-shrink: 0;
        min-height: auto;
    }

    .confirmation-btn {
        width: 100%;
        min-width: auto;
        padding: 10px 16px;
        font-size: 14px;
    }

    .confirmation-dialog-summary {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        margin-bottom: 8px;
    }

    .summary-card {
        min-width: auto;
        width: 100%;
        justify-content: center;
        padding: 8px 12px;
    }

    .confirmation-dialog-question {
        margin-bottom: 8px;
    }

    .confirmation-dialog-question p {
        font-size: 14px;
        line-height: 1.3;
    }

    .confirmation-dialog-note {
        padding: 8px;
        font-size: 12px;
        margin-bottom: 6px;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .photo-uploader-confirmation-dialog {
        padding: 5px !important;
    }

    .confirmation-dialog-content {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: calc(100vh - 10px) !important;
        max-height: calc(100vh - 10px) !important;
        margin: 0 !important;
        border-radius: 12px;
        box-sizing: border-box;
    }

    .confirmation-dialog-header {
        padding: 6px 10px 4px 10px;
        min-height: auto;
    }

    .confirmation-dialog-body {
        padding: 4px 10px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
    }

    .confirmation-dialog-footer {
        padding: 4px 10px 6px 10px;
        gap: 6px;
        flex-shrink: 0;
        min-height: auto;
    }

    .confirmation-dialog-question {
        margin-bottom: 6px;
    }

    .confirmation-dialog-question p {
        font-size: 13px;
        line-height: 1.2;
    }

    .confirmation-dialog-summary {
        gap: 4px;
        margin-bottom: 6px;
    }

    .summary-card {
        padding: 6px 8px;
        gap: 6px;
    }

    .summary-icon {
        width: 20px;
        height: 20px;
    }

    .summary-number {
        font-size: 14px;
    }

    .summary-label {
        font-size: 9px;
    }

    .confirmation-dialog-note {
        padding: 6px;
        font-size: 11px;
        gap: 4px;
        margin-bottom: 4px;
        line-height: 1.2;
    }

    .note-icon {
        width: 12px;
        height: 12px;
    }

    .confirmation-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: auto;
    }

    .confirmation-btn svg {
        width: 12px;
        height: 12px;
    }
}

/* Extra small screens and landscape phones */
@media (max-width: 360px) {
    .photo-uploader-confirmation-dialog {
        padding: 2px !important;
    }

    .confirmation-dialog-content {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: calc(100vh - 4px) !important;
        max-height: calc(100vh - 4px) !important;
        margin: 0 !important;
        border-radius: 8px;
        box-sizing: border-box;
    }

    .confirmation-dialog-header {
        padding: 4px 8px 2px 8px;
        min-height: auto;
    }

    .confirmation-dialog-body {
        padding: 2px 8px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
    }

    .confirmation-dialog-footer {
        padding: 2px 8px 4px 8px;
        flex-shrink: 0;
        min-height: auto;
        gap: 4px;
    }

    .confirmation-dialog-question {
        margin-bottom: 4px;
    }

    .confirmation-dialog-question p {
        font-size: 12px;
        line-height: 1.1;
    }

    .confirmation-dialog-summary {
        margin-bottom: 4px;
        gap: 2px;
    }

    .summary-card {
        padding: 4px 6px;
        gap: 4px;
    }

    .summary-number {
        font-size: 12px;
    }

    .summary-label {
        font-size: 8px;
    }

    .confirmation-dialog-note {
        padding: 4px;
        font-size: 10px;
        margin-bottom: 2px;
        line-height: 1.1;
    }

    .confirmation-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    .photo-uploader-confirmation-dialog {
        padding: 10px !important;
    }

    .confirmation-dialog-content {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: calc(100vh - 20px) !important;
        max-height: calc(100vh - 20px) !important;
        margin: 0 !important;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
    }

    .confirmation-dialog-header {
        padding: var(--space-2) var(--space-4) var(--space-1) var(--space-4);
        flex-shrink: 0;
    }

    .confirmation-dialog-body {
        padding: var(--space-1) var(--space-4);
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
    }

    .confirmation-dialog-footer {
        padding: var(--space-1) var(--space-4) var(--space-2) var(--space-4);
        flex-shrink: 0;
        flex-direction: row;
        gap: var(--space-3);
    }

    .confirmation-dialog-icon {
        width: 32px;
        height: 32px;
        margin-bottom: var(--space-1);
    }

    .confirmation-dialog-icon svg {
        width: 14px;
        height: 14px;
    }

    .confirmation-dialog-header h3 {
        font-size: var(--text-base);
        margin-bottom: var(--space-1);
    }

    .confirmation-dialog-subtitle {
        font-size: var(--text-xs);
    }

    .confirmation-dialog-question {
        margin-bottom: var(--space-2);
    }

    .confirmation-dialog-question p {
        font-size: var(--text-sm);
    }

    .confirmation-dialog-summary {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--space-2);
        margin-bottom: var(--space-2);
    }

    .summary-card {
        flex: 0 1 auto;
        min-width: 100px;
        padding: var(--space-2) var(--space-3);
    }

    .confirmation-dialog-note {
        padding: var(--space-2);
        font-size: var(--text-xs);
        margin-bottom: var(--space-1);
    }

    .confirmation-btn {
        flex: 1;
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-sm);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .confirmation-dialog-content {
        border: 2px solid var(--color-neutral-900);
    }

    .confirmation-btn-cancel {
        border-color: var(--color-neutral-900);
    }
}

/* Very short screens - ensure dialog fits */
@media (max-height: 500px) {
    .photo-uploader-confirmation-dialog {
        padding: 5px !important;
    }

    .confirmation-dialog-content {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: calc(100vh - 10px) !important;
        max-height: calc(100vh - 10px) !important;
        margin: 0 !important;
        box-sizing: border-box;
    }

    .confirmation-dialog-header {
        padding: 2px 8px 1px 8px;
        min-height: auto;
    }

    .confirmation-dialog-body {
        padding: 1px 8px;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }

    .confirmation-dialog-footer {
        padding: 1px 8px 2px 8px;
        flex-shrink: 0;
        min-height: auto;
        gap: 4px;
    }

    .confirmation-dialog-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 0;
    }

    .confirmation-dialog-icon svg {
        width: 10px;
        height: 10px;
    }

    .confirmation-dialog-header h3 {
        font-size: 12px;
        margin-bottom: 0;
        line-height: 1.1;
    }

    .confirmation-dialog-subtitle {
        font-size: 9px;
        line-height: 1.1;
    }

    .confirmation-dialog-question {
        margin-bottom: 2px;
    }

    .confirmation-dialog-question p {
        font-size: 11px;
        line-height: 1.1;
    }

    .confirmation-dialog-summary {
        margin-bottom: 2px;
        gap: 2px;
    }

    .summary-card {
        padding: 2px 4px;
        gap: 2px;
    }

    .summary-number {
        font-size: 11px;
    }

    .summary-label {
        font-size: 7px;
    }

    .confirmation-dialog-note {
        padding: 2px;
        font-size: 9px;
        margin-bottom: 2px;
        line-height: 1.1;
    }

    .confirmation-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* Ultra-compact for very small screens */
@media (max-width: 320px) and (max-height: 480px) {
    .photo-uploader-confirmation-dialog {
        padding: 0 !important;
    }

    .confirmation-dialog-content {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0;
        box-sizing: border-box;
    }

    .confirmation-dialog-header {
        padding: 2px 6px 1px 6px;
        min-height: auto;
    }

    .confirmation-dialog-body {
        padding: 1px 6px;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
    }

    .confirmation-dialog-footer {
        padding: 1px 6px 2px 6px;
        flex-shrink: 0;
        min-height: auto;
        gap: 2px;
    }

    .confirmation-dialog-summary {
        flex-direction: column;
        gap: 1px;
        margin-bottom: 2px;
    }

    .summary-card {
        padding: 2px 4px;
        gap: 2px;
    }

    .summary-number {
        font-size: 10px;
    }

    .summary-label {
        font-size: 7px;
    }

    .confirmation-dialog-question p {
        font-size: 10px;
        line-height: 1.0;
    }

    .confirmation-dialog-note {
        padding: 2px;
        font-size: 8px;
        line-height: 1.0;
    }

    .confirmation-btn {
        padding: 3px 6px;
        font-size: 9px;
    }
}

/* Ensure dialog is always accessible and scrollable */
.photo-uploader-confirmation-dialog {
    /* Ensure dialog is above all other content */
    z-index: 999999 !important;
    /* Prevent body scroll when dialog is open */
    overscroll-behavior: contain;
}

.photo-uploader-confirmation-dialog.active {
    /* Lock body scroll when dialog is active */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Ensure content is always scrollable if needed */
.confirmation-dialog-body {
    /* Ensure scrolling works on all browsers */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* Ensure minimum height for content */
    min-height: 0;
    /* Smooth scrolling */
    scroll-behavior: smooth;
}

/* Ensure buttons are always accessible */
.confirmation-dialog-footer {
    /* Ensure footer stays at bottom */
    position: sticky;
    bottom: 0;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    /* Ensure buttons are always clickable */
    z-index: 10;
}

/* Cross-browser compatibility fixes */
.confirmation-dialog-content {
    /* Ensure proper box model */
    box-sizing: border-box;
    /* Ensure content doesn't overflow */
    contain: layout style;
    /* Ensure proper stacking */
    isolation: isolate;
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .confirmation-dialog-content {
        /* Fix iOS viewport height issues */
        max-height: 85vh;
        /* Ensure proper positioning on iOS */
        position: fixed;
    }

    @media (max-width: 768px) {
        .confirmation-dialog-content {
            /* iOS mobile specific height */
            max-height: 80vh;
        }
    }
}

/* Android Chrome specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: .001dpcm) {
    .confirmation-dialog-content {
        /* Android specific viewport handling */
        max-height: 85vh;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    .photo-uploader-confirmation-dialog,
    .confirmation-dialog-content,
    .confirmation-btn {
        transition: none;
    }

    .confirmation-dialog-overlay {
        backdrop-filter: none;
    }

    .confirmation-btn-confirm::before {
        display: none;
    }
}