/* Memory Tee Custom Styles */

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Utility Classes */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

.shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

/* Style Options */
.style-option {
    transition: all 0.3s ease;
}

.style-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.style-option input:checked + div {
    border-color: #7c3aed;
    background-color: #f3f4f6;
}

/* Sticky CTA for mobile */
@media (max-width: 768px) {
    .sticky-cta {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
        z-index: 50;
        border-top: 1px solid rgba(229, 231, 235, 1);
    }

    .sticky-cta button {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 1.125rem;
        font-weight: 600;
        min-height: 3rem;
        border-radius: 0.5rem;
        pointer-events: auto;
        cursor: pointer;
        position: relative;
        z-index: 10;
    }

    /* Add bottom padding to body when sticky CTA is present */
    body.has-sticky-cta {
        padding-bottom: 5rem;
    }
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Form Enhancements */
.form-group {
    position: relative;
}

.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

/* Progress Bar Enhancements */
.progress-step {
    transition: all 0.3s ease;
}

.progress-step.active {
    transform: scale(1.1);
}

/* Testimonials */
.testimonial-card {
    transition: all 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Emotional Design Elements */
.memory-glow {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* FOMO Elements */
.fomo-alert {
    animation: pulse 2s infinite;
    border-left: 4px solid #ef4444;
}

/* Success States */
.success-checkmark {
    animation: checkmark 0.6s ease-in-out;
}

@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    /* Container and Layout */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    main.container {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    /* Typography - Mobile Responsive */
    .text-4xl {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }

    .text-3xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }

    .text-2xl {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }

    .text-xl {
        font-size: 1.125rem;
        line-height: 1.75rem;
    }

    .text-lg {
        font-size: 1rem;
        line-height: 1.5rem;
    }

    /* Progress Steps - Mobile Optimized */
    .bg-white.border-b .container {
        padding: 0.5rem 0.75rem;
    }

    .bg-white.border-b .flex.items-center.justify-between {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .bg-white.border-b .flex.items-center.space-x-4 {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
        margin: 0;
    }

    .bg-white.border-b .flex.items-center.space-x-4 > .flex {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0.25rem;
        min-width: 3.5rem;
    }

    .bg-white.border-b .w-8.h-8 {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.75rem;
        margin-right: 0;
        margin-bottom: 0.25rem;
    }

    .bg-white.border-b .w-8.h-px {
        display: none;
    }

    .bg-white.border-b span {
        font-size: 0.625rem;
        line-height: 0.875rem;
        margin-top: 0.125rem;
    }

    /* Grid Layouts - Mobile Responsive */
    .grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Step 2 Design Styles - 2 per row, same size boxes */
    .grid.grid-cols-2.md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    /* Step 2 Colors - Single Row on Mobile */
    .grid-cols-3 {
        grid-template-columns: repeat(auto-fit, minmax(4rem, 1fr));
        gap: 0.5rem;
        justify-items: center;
    }

    .md\:grid-cols-6 {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .lg\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Cards and Containers */
    .bg-white.rounded-lg.shadow-xl {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 0.5rem;
    }

    .max-w-2xl,
    .max-w-4xl,
    .max-w-6xl {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    /* Form Elements - Touch Friendly */
    input[type="text"],
    input[type="email"],
    input[type="date"],
    select,
    textarea {
        padding: 0.875rem 0.75rem;
        font-size: 1rem;
        line-height: 1.5;
        min-height: 2.75rem;
    }

    /* Buttons - Larger Touch Targets */
    button,
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        min-height: 2.75rem;
        border-radius: 0.5rem;
    }

    button[type="submit"] {
        padding: 1rem 1.5rem;
        font-size: 1.125rem;
        min-height: 3rem;
        font-weight: 600;
    }

    /* Style Options - Mobile Layout (Same Size Boxes) */
    .style-option {
        padding: 0.75rem;
        min-height: 5rem;
        height: 5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .style-option .w-16 {
        width: 2.5rem;
        height: 2.5rem;
        margin-bottom: 0.5rem;
        flex-shrink: 0;
    }

    .style-option span {
        font-size: 0.875rem;
        line-height: 1.25rem;
        margin-top: auto;
    }

    /* Color Options - Enhanced Mobile Design */
    .color-option {
        padding: 1rem 0.5rem;
        min-height: 6rem;
        height: 6rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        text-align: center;
        box-sizing: border-box;
        width: 100%;
        overflow: hidden;
        border-radius: 0.75rem;
        background: linear-gradient(145deg, #ffffff, #f8fafc);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        transition: all 0.2s ease-in-out;
        position: relative;
    }

    .color-option:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }

    .color-option.selected {
        background: linear-gradient(145deg, #f3e8ff, #ede9fe);
        border-color: #8b5cf6 !important;
        box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1), 0 8px 15px -3px rgba(0, 0, 0, 0.1);
    }

    .color-option .w-16 {
        width: 3.5rem;
        height: 3.5rem;
        margin-bottom: 0.375rem;
        flex-shrink: 0;
        border-radius: 50%;
        border: 3px solid rgba(255, 255, 255, 0.9);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.3);
        position: relative;
    }

    .color-option .w-16::after {
        content: '';
        position: absolute;
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        border-radius: 50%;
        border: 2px solid transparent;
        background: linear-gradient(45deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
        z-index: -1;
    }

    .color-option .w-8 {
        width: 3rem;
        height: 3rem;
        border-radius: 50%;
        border: 3px solid rgba(255, 255, 255, 0.9);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }

    .color-option span {
        font-size: 0.875rem;
        line-height: 1.25rem;
        font-weight: 600;
        color: #374151;
        display: block;
        width: 100%;
        text-align: center;
        margin: 0;
        flex-shrink: 0;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    }

    .color-option p {
        font-size: 0.6875rem;
        line-height: 1rem;
        font-weight: 500;
        color: #6b7280;
        margin: 0;
        padding: 0;
        display: block;
        width: 100%;
        text-align: center;
        flex-shrink: 0;
        opacity: 0.8;
    }

    /* Size Options - Mobile Layout */
    .size-option {
        padding: 0.75rem;
        min-height: 3rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Date Input Groups */
    .flex.items-center.space-x-2 {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    .flex.items-center.space-x-2 input {
        width: 100%;
        margin: 0;
    }

    .flex.items-center.space-x-2 button {
        align-self: flex-end;
        width: auto;
        padding: 0.5rem;
        min-height: auto;
    }

    /* Modal Optimizations */
    .fixed.inset-0 .bg-white.rounded-2xl,
    .fixed.inset-0 .bg-white.rounded-lg {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        border-radius: 1rem;
    }

    .fixed.inset-0 .max-w-md {
        max-width: calc(100vw - 2rem);
        width: 100%;
    }

    /* Generation Modal Specific */
    #generationModal {
        z-index: 9999;
    }

    #generationModal .bg-white {
        position: relative;
        z-index: 10000;
    }

    /* Ensure modal content is visible */
    #generationModal .space-y-4 {
        display: block;
        visibility: visible;
    }

    #generationModal .space-y-4 > div {
        display: flex;
        visibility: visible;
        opacity: 1;
    }

    /* Force visibility of progress elements */
    #generationModal .step-icon {
        display: flex !important;
        visibility: visible !important;
        width: 1.5rem !important;
        height: 1.5rem !important;
        border-radius: 50% !important;
        align-items: center !important;
        justify-content: center !important;
        margin-right: 0.75rem !important;
        flex-shrink: 0 !important;
    }

    #generationModal .spinner {
        display: block !important;
        visibility: visible !important;
        width: 0.75rem !important;
        height: 0.75rem !important;
        border: 1px solid white !important;
        border-top-color: transparent !important;
        border-radius: 50% !important;
    }

    #generationModal .check-icon {
        display: block !important;
        visibility: visible !important;
        width: 0.75rem !important;
        height: 0.75rem !important;
        color: white !important;
    }

    #generationModal .step-text {
        display: block !important;
        visibility: visible !important;
        flex: 1 !important;
    }

    #generationModal .spinner.hidden {
        display: none !important;
    }

    #generationModal .check-icon.hidden {
        display: none !important;
    }

    #generationModal .spinner:not(.hidden) {
        display: block !important;
        animation: spin 1s linear infinite !important;
        visibility: visible !important;
    }

    #generationModal .check-icon:not(.hidden) {
        display: block !important;
        visibility: visible !important;
    }

    /* Progress Modal Steps - Enhanced Mobile */
    #generationModal .space-y-4 > div {
        padding: 0.875rem 0.75rem;
        border-radius: 0.5rem;
        background-color: rgba(249, 250, 251, 0.3);
        margin-bottom: 0.75rem;
        min-height: 3.5rem;
        display: flex !important;
        align-items: center !important;
        text-align: left !important;
    }

    #generationModal .step-icon.w-6.h-6 {
        width: 2rem !important;
        height: 2rem !important;
        margin-right: 1rem !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50% !important;
        position: relative !important;
    }

    #generationModal .step-icon .spinner.w-3.h-3 {
        width: 1rem !important;
        height: 1rem !important;
        border-width: 2px !important;
        display: block !important;
        border: 2px solid white !important;
        border-top-color: transparent !important;
        border-radius: 50% !important;
    }

    #generationModal .step-icon .check-icon.w-3.h-3 {
        width: 1rem !important;
        height: 1rem !important;
        display: block !important;
        color: white !important;
    }

    #generationModal .step-text {
        font-size: 0.9375rem !important;
        line-height: 1.375rem !important;
        font-weight: 500 !important;
        flex: 1 !important;
        display: block !important;
    }

    .step-text {
        font-size: 0.9375rem;
        line-height: 1.375rem;
        font-weight: 500;
        flex: 1;
    }

    /* Step 3 - Full Width Layout */
    .grid.lg\\:grid-cols-2 {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .grid.lg\\:grid-cols-2 > div {
        width: 100%;
        max-width: none;
    }

    /* Mockup Display - Full Width */
    #currentMockup {
        width: 100% !important;
        max-width: 100% !important;
        height: auto;
        margin: 0 auto;
    }

    /* Mockup Gallery - Mobile */
    .mockup-gallery {
        width: 100%;
    }

    .mockup-gallery .grid {
        grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
        gap: 0.5rem;
        width: 100%;
    }

    .mockup-option {
        padding: 0.5rem;
        border-radius: 0.5rem;
        width: 100%;
    }

    .mockup-option img {
        width: 100%;
        height: 3rem;
        object-fit: cover;
        border-radius: 0.25rem;
    }

    .mockup-option p {
        font-size: 0.625rem;
        margin-top: 0.25rem;
    }

    /* Size Quantity Section - Full Width */
    #sizeQuantitySection {
        width: 100%;
        max-width: none;
    }

    #sizeQuantityOptions {
        width: 100%;
    }

    /* Size Quantity Options - Mobile Full Width */
    .space-y-4 {
        width: 100%;
    }

    .space-y-4 > div {
        padding: 0.75rem;
        border-radius: 0.5rem;
        margin-bottom: 0.75rem;
        width: 100%;
        box-sizing: border-box;
    }

    .space-y-4 .flex.items-center.justify-between {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        width: 100%;
    }

    .space-y-4 .flex.items-center.space-x-3 {
        justify-content: center;
        gap: 1rem;
        width: 100%;
    }

    .space-y-4 .w-8.h-8 {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.125rem;
    }

    /* Order Summary - Full Width */
    #orderSummary {
        width: 100%;
        max-width: none;
    }

    #orderItems {
        width: 100%;
    }

    #proceedToCheckout {
        width: 100%;
    }

    /* Order Summary - Mobile */
    #orderSummary {
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 0.5rem;
        background-color: rgba(249, 250, 251, 1);
    }

    #orderItems .flex {
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(229, 231, 235, 1);
    }

    /* Testimonials - Mobile */
    .md\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .testimonial-card,
    .bg-gray-50.p-6 {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }

    /* Header - Mobile */
    header .container {
        padding: 1rem 0.75rem;
    }

    header .text-3xl {
        font-size: 1.5rem;
    }

    header .flex.items-center.justify-between {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    /* Footer - Mobile */
    footer {
        padding: 1.5rem 0;
    }

    footer .container {
        padding: 0 0.75rem;
    }

    /* Additional Mobile Optimizations */

    /* Loading Spinners - Mobile */
    .animate-spin.rounded-full.h-16.w-16 {
        width: 3rem;
        height: 3rem;
    }

    .animate-spin.rounded-full.h-8.w-8 {
        width: 2rem;
        height: 2rem;
    }

    /* Examples Section - Mobile */
    .bg-purple-50.p-4 {
        padding: 0.75rem;
        margin: 1rem 0;
    }

    .bg-purple-50 ul {
        font-size: 0.875rem;
        line-height: 1.25rem;
    }

    /* Space-y utilities - Mobile */
    .space-y-6 > * + * {
        margin-top: 1rem;
    }

    .space-y-8 > * + * {
        margin-top: 1.5rem;
    }

    /* Text alignment - Mobile */
    .text-center {
        text-align: center;
    }

    /* Specific button improvements */
    #addDate {
        padding: 0.5rem 0.75rem;
        margin-top: 0.5rem;
        display: inline-block;
        border-radius: 0.375rem;
        background-color: rgba(124, 58, 237, 0.1);
        min-height: 2.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Loading states - Mobile */
    .text-center.py-8 {
        padding: 1.5rem 0;
    }

    .text-center.py-12 {
        padding: 2rem 0;
    }

    /* Specific grid improvements */
    .grid.grid-cols-3.gap-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    /* Step 2 specific improvements for small screens */
    .grid.grid-cols-3.gap-4 {
        grid-template-columns: repeat(auto-fit, minmax(3.5rem, 1fr));
        gap: 0.25rem;
        justify-items: center;
    }

    /* SVG icons - Mobile */
    .w-16.h-16 {
        width: 3rem;
        height: 3rem;
    }

    .w-8.h-8 {
        width: 2rem;
        height: 2rem;
    }

    .w-5.h-5 {
        width: 1.25rem;
        height: 1.25rem;
    }

    .w-3.h-3 {
        width: 0.875rem;
        height: 0.875rem;
    }
}

/* Checkout Page Mobile Optimizations */
@media (max-width: 768px) {
    /* Checkout Grid Layout */
    .lg\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Checkout Form Fields */
    .grid.grid-cols-2.gap-4 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .grid.grid-cols-3.gap-4 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Stripe Card Element */
    #card-element {
        padding: 1rem 0.75rem;
        font-size: 1rem;
        min-height: 2.75rem;
    }

    /* Order Summary Items */
    .space-y-3 .flex.justify-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .space-y-3 .flex.justify-between > div:first-child {
        width: 100%;
    }

    .space-y-3 .flex.justify-between > span:last-child {
        align-self: flex-end;
        font-weight: 600;
    }

    /* FOMO Alert - Mobile */
    .bg-red-50.border.border-red-200 {
        padding: 0.75rem;
        margin-top: 1rem;
    }

    .bg-red-50 .flex.items-center {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        text-align: left;
    }

    .bg-red-50 svg {
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
}

/* Small Mobile Devices (320px - 480px) */
@media (max-width: 480px) {
    /* Extra small screens */
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* Typography for very small screens */
    .text-4xl {
        font-size: 1.5rem;
        line-height: 2rem;
    }

    .text-3xl {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }

    /* Progress steps for small screens */
    .bg-white.border-b .flex.items-center.space-x-4 {
        gap: 0.125rem;
    }

    .bg-white.border-b .flex.items-center.space-x-4 > .flex {
        min-width: 3rem;
        padding: 0.125rem;
    }

    .bg-white.border-b .w-8.h-8 {
        width: 1.25rem;
        height: 1.25rem;
        font-size: 0.625rem;
    }

    .bg-white.border-b span {
        font-size: 0.5rem;
        line-height: 0.75rem;
    }

    /* Cards for small screens */
    .bg-white.rounded-lg.shadow-xl {
        padding: 0.75rem;
        border-radius: 0.375rem;
    }

    /* Buttons for small screens */
    button[type="submit"] {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        min-height: 2.75rem;
    }

    /* Style and color options for small screens */
    .style-option {
        padding: 0.5rem;
        min-height: 4.5rem;
        height: 4.5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .color-option {
        padding: 0.75rem 0.375rem;
        min-height: 5.5rem;
        height: 5.5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        box-sizing: border-box;
        width: 100%;
        overflow: hidden;
        border-radius: 0.625rem;
        background: linear-gradient(145deg, #ffffff, #f8fafc);
        box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.1), 0 2px 3px -1px rgba(0, 0, 0, 0.06);
        transition: all 0.2s ease-in-out;
    }

    .style-option .w-16 {
        width: 2rem;
        height: 2rem;
        margin-bottom: 0.25rem;
        flex-shrink: 0;
    }

    .color-option .w-16 {
        width: 3rem;
        height: 3rem;
        border-radius: 50%;
        margin-bottom: 0.25rem;
        flex-shrink: 0;
        border: 2px solid rgba(255, 255, 255, 0.9);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.3);
    }

    .color-option .w-8 {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50%;
        border: 2px solid rgba(255, 255, 255, 0.9);
        box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    }

    .color-option span {
        font-size: 0.75rem;
        line-height: 1rem;
        font-weight: 600;
        color: #374151;
        margin: 0;
        display: block;
        width: 100%;
        text-align: center;
        flex-shrink: 0;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    }

    .color-option p {
        font-size: 0.625rem;
        line-height: 0.875rem;
        font-weight: 500;
        color: #6b7280;
        margin: 0;
        padding: 0;
        display: block;
        width: 100%;
        text-align: center;
        flex-shrink: 0;
        opacity: 0.8;
    }

    /* Step 2 grid layouts for very small screens */
    .grid.grid-cols-2.md\:grid-cols-4,
    .md\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .grid.grid-cols-3.gap-4 {
        grid-template-columns: repeat(auto-fit, minmax(3rem, 1fr));
        gap: 0.125rem;
        justify-items: center;
    }



    /* Modal for small screens */
    .fixed.inset-0 .bg-white.rounded-2xl,
    .fixed.inset-0 .bg-white.rounded-lg {
        margin: 0.5rem;
        border-radius: 0.75rem;
    }

    /* Generation Modal - Small Screens */
    #generationModal .space-y-4 > div {
        padding: 0.625rem 0.5rem !important;
        margin-bottom: 0.5rem !important;
        min-height: 3rem !important;
    }

    #generationModal .step-icon.w-6.h-6 {
        width: 1.875rem !important;
        height: 1.875rem !important;
        margin-right: 0.625rem !important;
    }

    #generationModal .step-icon .spinner.w-3.h-3 {
        width: 0.75rem !important;
        height: 0.75rem !important;
        border-width: 1.5px !important;
        border: 1.5px solid white !important;
        border-top-color: transparent !important;
    }

    #generationModal .step-icon .check-icon.w-3.h-3 {
        width: 0.75rem !important;
        height: 0.75rem !important;
    }

    #generationModal .step-text {
        font-size: 0.75rem !important;
        line-height: 1rem !important;
    }

    /* Mockup gallery for small screens */
    .mockup-gallery .grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .mockup-option {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .mockup-option img {
        width: 3rem;
        height: 3rem;
        flex-shrink: 0;
    }

    .mockup-option p {
        font-size: 0.875rem;
        margin: 0;
    }
}

/* Landscape Mobile Optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    /* Adjust for landscape mobile */
    .progress-container {
        padding: 0.5rem;
    }

    .bg-white.rounded-lg.shadow-xl {
        padding: 0.75rem;
    }

    /* Modal adjustments for landscape */
    .fixed.inset-0 .bg-white.rounded-2xl,
    .fixed.inset-0 .bg-white.rounded-lg {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }

    /* Progress modal steps in landscape */
    .space-y-4 .flex.items-center {
        padding: 0.75rem 0.5rem;
        margin-bottom: 0.5rem;
        min-height: 3rem;
    }

    .step-icon {
        width: 2rem;
        height: 2rem;
        margin-right: 0.75rem;
    }

    .step-icon .spinner {
        width: 0.875rem;
        height: 0.875rem;
        border-width: 2px;
    }

    .step-icon .check-icon {
        width: 0.875rem;
        height: 0.875rem;
    }

    .step-text {
        font-size: 0.8125rem;
        line-height: 1.125rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for touch devices */
    button,
    .btn,
    label.cursor-pointer {
        min-height: 2.75rem;
        padding: 0.875rem 1rem;
    }

    /* Enhanced color options for touch devices */
    .color-option {
        min-height: 6rem;
        padding: 1rem 0.5rem;
        transform: none;
        transition: all 0.3s ease;
    }

    .color-option:active {
        transform: scale(0.98);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    /* Style and size options touch targets */
    .style-option,
    .size-option {
        min-height: 3.5rem;
        padding: 0.875rem;
    }

    /* Enhanced touch feedback for color options */
    .color-option:hover {
        transform: none;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }

    /* Remove hover effects on other elements */
    .style-option:hover,
    .size-option:hover,
    .mockup-option:hover {
        transform: none;
        box-shadow: none;
    }

    /* Enhanced focus states for touch devices */
    .color-option:focus-within {
        outline: 3px solid #8b5cf6;
        outline-offset: 2px;
        box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    }

    .style-option:focus-within,
    .size-option:focus-within {
        outline: 2px solid #7c3aed;
        outline-offset: 2px;
    }
}

/* Final Mobile Optimizations - Ensure No Element is Missed */
@media (max-width: 768px) {
    /* Ensure all text inputs are properly sized */
    input[type="text"],
    input[type="email"],
    input[type="date"],
    input[type="password"],
    select,
    textarea {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        font-size: 16px; /* Prevents zoom on iOS */
        line-height: 1.5;
        padding: 0.875rem 0.75rem;
        min-height: 2.75rem;
        border-radius: 0.375rem;
        width: 100%;
        box-sizing: border-box;
    }

    /* Ensure all buttons are touch-friendly */
    button,
    input[type="submit"],
    input[type="button"],
    .btn,
    a.btn {
        min-height: 2.75rem;
        padding: 0.875rem 1rem;
        font-size: 1rem;
        line-height: 1.5;
        border-radius: 0.375rem;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        pointer-events: auto;
        position: relative;
        z-index: 1;
    }

    /* Ensure submit buttons are extra large */
    button[type="submit"],
    input[type="submit"] {
        min-height: 3rem;
        padding: 1rem 1.5rem;
        font-size: 1.125rem;
        font-weight: 600;
    }

    /* Ensure all clickable elements have proper spacing */
    label.cursor-pointer,
    .cursor-pointer {
        min-height: 2.75rem;
        display: flex;
        align-items: center;
        padding: 0.5rem;
        -webkit-tap-highlight-color: transparent;
    }

    /* Ensure proper spacing for all containers */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        max-width: 100%;
    }

    /* Ensure proper spacing for sections */
    section {
        padding: 2rem 0;
    }

    /* Ensure proper spacing for cards */
    .bg-white.rounded-lg,
    .bg-white.rounded-xl,
    .bg-white.shadow-lg,
    .bg-white.shadow-xl {
        margin: 0.5rem 0;
        padding: 1rem;
        border-radius: 0.5rem;
    }

    /* Ensure proper image sizing */
    img {
        max-width: 100%;
        height: auto;
        border-radius: 0.375rem;
    }

    /* Ensure proper modal sizing */
    .fixed.inset-0 > div {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    /* Ensure proper flex layouts */
    .flex.items-center {
        align-items: center;
    }

    .flex.justify-between {
        justify-content: space-between;
    }

    /* Ensure all style options are exactly the same size */
    .style-option {
        box-sizing: border-box;
        width: 100%;
        aspect-ratio: 1;
        max-height: 5rem;
    }

    .style-option .w-16.h-16 {
        flex-shrink: 0;
        margin: 0 auto 0.5rem auto;
    }

    .style-option span {
        display: block;
        width: 100%;
        text-align: center;
        margin-top: auto;
        padding-top: 0.25rem;
    }

    /* Enhanced color options for all screen sizes */
    .color-option {
        box-sizing: border-box;
        width: 100%;
        aspect-ratio: 1;
        max-height: 6rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        overflow: hidden;
        border-radius: 0.75rem;
        background: linear-gradient(145deg, #ffffff, #f8fafc);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        transition: all 0.2s ease-in-out;
        position: relative;
    }

    .color-option .w-16,
    .color-option .w-8 {
        flex-shrink: 0;
        margin: 0 auto 0.375rem auto;
        border: 3px solid rgba(255, 255, 255, 0.9);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), inset 0 1px 2px rgba(255, 255, 255, 0.3);
        border-radius: 50%;
    }

    .color-option span {
        display: block;
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 0;
        font-weight: 600;
        color: #374151;
        flex-shrink: 0;
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    }

    .color-option p {
        display: block;
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 0;
        flex-shrink: 0;
        font-weight: 500;
        color: #6b7280;
        opacity: 0.8;
    }

    /* Ensure proper grid layouts */
    .grid {
        display: grid;
        gap: 0.75rem;
    }

    /* Ensure proper text sizing */
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.25;
        margin-bottom: 0.5rem;
    }

    p {
        line-height: 1.5;
        margin-bottom: 0.75rem;
    }

    /* Ensure proper list styling */
    ul, ol {
        padding-left: 1.25rem;
        margin-bottom: 0.75rem;
    }

    li {
        margin-bottom: 0.25rem;
        line-height: 1.5;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bg-purple-600 {
        background-color: #000;
    }

    .text-purple-600 {
        color: #000;
    }

    .border-purple-500 {
        border-color: #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile Utility Classes */
.mobile-hidden {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .mobile-flex {
        display: flex !important;
    }

    .mobile-grid {
        display: grid !important;
    }

    /* Mobile spacing utilities */
    .mobile-p-2 {
        padding: 0.5rem !important;
    }

    .mobile-p-4 {
        padding: 1rem !important;
    }

    .mobile-m-2 {
        margin: 0.5rem !important;
    }

    .mobile-m-4 {
        margin: 1rem !important;
    }

    .mobile-text-sm {
        font-size: 0.875rem !important;
        line-height: 1.25rem !important;
    }

    .mobile-text-base {
        font-size: 1rem !important;
        line-height: 1.5rem !important;
    }

    .mobile-text-lg {
        font-size: 1.125rem !important;
        line-height: 1.75rem !important;
    }

    /* Mobile layout utilities */
    .mobile-full-width {
        width: 100% !important;
    }

    .mobile-center {
        text-align: center !important;
    }

    .mobile-left {
        text-align: left !important;
    }

    /* Mobile button utilities */
    .mobile-btn-lg {
        padding: 1rem 1.5rem !important;
        font-size: 1.125rem !important;
        min-height: 3rem !important;
    }

    .mobile-btn-block {
        width: 100% !important;
        display: block !important;
    }
}

/* Image and Media Mobile Optimizations */
@media (max-width: 768px) {
    img {
        max-width: 100%;
        height: auto;
    }

    /* T-shirt mockup images */
    #currentMockup,
    .mockup-preview img {
        max-width: 100%;
        width: auto;
        height: auto;
        max-height: 60vh;
        object-fit: contain;
    }

    /* Ensure images don't overflow containers */
    .w-full.max-w-md {
        max-width: 100%;
        width: 100%;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .bg-white {
        background-color: #1f2937;
        color: #f9fafb;
    }

    .text-gray-800 {
        color: #f9fafb;
    }

    .text-gray-600 {
        color: #d1d5db;
    }

    .border-gray-300 {
        border-color: #4b5563;
    }

    .bg-gray-50 {
        background-color: #374151;
    }
}

/* Animation Keyframes */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Ensure spinner animation works on all devices */
.animate-spin,
.spinner {
    animation: spin 1s linear infinite;
}

/* Generation Modal Animation Fixes */
#generationModal .animate-spin {
    animation: spin 1s linear infinite !important;
}

#generationModal .spinner:not(.hidden) {
    animation: spin 1s linear infinite !important;
    display: block !important;
    visibility: visible !important;
}

#generationModal .check-icon:not(.hidden) {
    display: block !important;
    visibility: visible !important;
}

/* Desktop Optimizations */
@media (min-width: 1024px) {
    /* Step 3 Desktop Layout */
    .grid.lg\\:grid-cols-2 {
        grid-template-columns: 1fr 1fr !important;
        gap: 3rem;
        width: 100%;
    }

    .grid.lg\\:grid-cols-2 > div {
        width: 100%;
    }

    /* Mockup Display Desktop */
    #currentMockup {
        max-width: 500px;
        width: 100%;
    }

    /* Mockup Gallery Desktop */
    .mockup-gallery .grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    /* Size Quantity Desktop Layout */
    .space-y-4 .flex.items-center.justify-between {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }

    /* Larger screens get more space */
    .container {
        max-width: 1200px;
    }
}
