.product-image {
    position: absolute;
    width: 100%;
    max-width: 640px;
    height: auto;
    bottom: 0;
    left: 0;
    z-index: 15;
    transition: bottom 0.5s ease-out;
}

/* Alternative option - processed image scaling when headline is hidden */
.image-section.scale-image .result-image {
    transform: scale(1.2);
    transform-origin: center bottom;
    transition: transform 0.3s ease-out;
}

@font-face {
    font-family: 'EuclidCircularB-Medium';
    src: url('../assets/fonts/EuclidCircularB-Medium.eot');
    src: url('../assets/fonts/EuclidCircularB-Medium.eot?#iefix') format('embedded-opentype'),
        url('../assets/fonts/EuclidCircularB-Medium.woff2') format('woff2'),
        url('../assets/fonts/EuclidCircularB-Medium.woff') format('woff'),
        url('../assets/fonts/EuclidCircularB-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'EuclidCircularB-Regular';
    src: url('../assets/fonts/EuclidCircularB-Regular.eot');
    src: url('../assets/fonts/EuclidCircularB-Regular.eot?#iefix') format('embedded-opentype'),
        url('../assets/fonts/EuclidCircularB-Regular.woff2') format('woff2'),
        url('../assets/fonts/EuclidCircularB-Regular.woff') format('woff'),
        url('../assets/fonts/EuclidCircularB-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'EuclidCircularB-Bold';
    src: url('../assets/fonts/EuclidCircularB-Bold.eot');
    src: url('../assets/fonts/EuclidCircularB-Bold.eot?#iefix') format('embedded-opentype'),
        url('../assets/fonts/EuclidCircularB-Bold.woff2') format('woff2'),
        url('../assets/fonts/EuclidCircularB-Bold.woff') format('woff'),
        url('../assets/fonts/EuclidCircularB-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}


@font-face {
    font-family: 'EuclidCircularB-LightItalic';
    src: url('../assets/fonts/EuclidCircularB-LightItalic.eot');
    src: url('../assets/fonts/EuclidCircularB-LightItalic.eot?#iefix') format('embedded-opentype'),
        url('../assets/fonts/EuclidCircularB-LightItalic.woff2') format('woff2'),
        url('../assets/fonts/EuclidCircularB-LightItalic.woff') format('woff'),
        url('../assets/fonts/EuclidCircularB-LightItalic.ttf') format('truetype');
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'EuclidCircularB-Light';
    src: url('../assets/fonts/EuclidCircularB-Light.eot');
    src: url('../assets/fonts/EuclidCircularB-Light.eot?#iefix') format('embedded-opentype'),
        url('../assets/fonts/EuclidCircularB-Light.woff2') format('woff2'),
        url('../assets/fonts/EuclidCircularB-Light.woff') format('woff'),
        url('../assets/fonts/EuclidCircularB-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'EuclidCircularB-SemiBold';
    src: url('../assets/fonts/EuclidCircularB-SemiBold.eot');
    src: url('../assets/fonts/EuclidCircularB-SemiBold.eot?#iefix') format('embedded-opentype'),
        url('../assets/fonts/EuclidCircularB-SemiBold.woff2') format('woff2'),
        url('../assets/fonts/EuclidCircularB-SemiBold.woff') format('woff'),
        url('../assets/fonts/EuclidCircularB-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'EuclidCircularB-SemiBoldItalic';
    src: url('../assets/fonts/EuclidCircularB-SemiBoldItalic.eot');
    src: url('../assets/fonts/EuclidCircularB-SemiBoldItalic.eot?#iefix') format('embedded-opentype'),
        url('../assets/fonts/EuclidCircularB-SemiBoldItalic.woff2') format('woff2'),
        url('../assets/fonts/EuclidCircularB-SemiBoldItalic.woff') format('woff'),
        url('../assets/fonts/EuclidCircularB-SemiBoldItalic.ttf') format('truetype');
    font-weight: 600;
    font-style: italic;
    font-display: swap;
}


/* Updated error messages and loader styles */
.error-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 20;
    border-radius: 5px;
}

.error-content {
    background: #FEEAAE;
    background: radial-gradient(circle, rgba(254, 234, 174, 1) 0%, rgba(147, 120, 85, 1) 100%);
    padding: 20px;
    border-radius: 10px;
    max-width: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.error-content p {
    color: black;
    font-weight: bold;
    margin-bottom: 15px;
    font-size: 16px;
}

.retry-btn {
    background-color: black;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    min-width: 120px;
}

.retry-btn:hover {
    background-color: #333;
}

.loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    border-radius: 5px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #b39a68;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

.loader p {
    color: white;
    font-weight: bold;
    font-family: 'EuclidCircularB-Bold';
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}





/* body {
    background-color: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
} */
/* .container {
    max-width: 100%;
    width: 400px;
    padding: 3% 1%;
    position: relative;
    z-index: 1;
} */

.container {
    max-width: 100%;
    width: max-content;
    padding: 0;
    position: absolute;
    z-index: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 100vh;
    left: 0;
    right: 0;
    margin: 0 auto;
}

body {
    background-color: #000;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

#page3 .header-section {
    top: 50px;
    padding: 20px 0px;
    height: 100%;
    position: absolute;
}

#page3 .image-section {
    flex-grow: 1;
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    overflow: hidden;
    bottom: 9%;
    height: 100%;
    max-width: 385px;
}

#page4 {
    overflow: visible !important;
}

#page4 .scaler-container-class {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    /* height: 100%; */
    margin: 0 auto !important;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

#page4 .scaler-container-class img {
    height: auto;
    display: block;
    margin: 0 auto;
}







.logo-container {
    position: absolute;
    top: 3%;
    text-align: center;
    width: 100%;
    z-index: 1;
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.blurred-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/bg3.jpg');
    background-position: center;
    background-size: cover;
    /* No blur by default (for mobile/vertical) */
}

.sparkle {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: white;
    box-shadow: 0 0 4px 1px white;
    transform: rotate(45deg);
    z-index: 0;
}



.logo-image {
    width: 30%;
    max-width: 150px;
    height: auto;
}

.header {
    background: #FEEAAE;
    background: radial-gradient(circle, rgba(254, 234, 174, 1) 0%, rgba(147, 120, 85, 1) 100%);
    color: #000;
    text-align: center;
    margin-bottom: 20px;
    font-size: 18px;
    text-transform: uppercase;
}

.upload-container {
    background-color: rgba(0, 0, 0, 0.7);
    border: 2px solid;
    border-image: radial-gradient(circle, rgba(254, 234, 174, 1) 0%, rgba(147, 120, 85, 1) 100%) 1;
    border-radius: 15px;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

.selfiephoto {
    color: #000;
    background: #FEEAAE;
    background: radial-gradient(circle, rgba(254, 234, 174, 1) 0%, rgba(147, 120, 85, 1) 100%);
    font-family: 'EuclidCircularB-Medium';
    font-size: 1.1em;
    font-weight: normal;
    text-align: center;
    margin-bottom: 15px;
    letter-spacing: 0.1em;
}

.upload-preview {
    background-color: rgba(34, 34, 34, 0.8);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.preview-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-outline {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 90%;
    border: 2px dashed rgba(147, 120, 85, 0.7);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: radial-gradient(circle, rgba(254, 234, 174, 0.1) 0%, rgba(147, 120, 85, 0.1) 100%);
    display: none;
    /* Hide the outline */
}

.instruction-image {
    width: 100%;
    height: auto;
    z-index: 1;
}

.preview-image {
    display: none;
    /* Always hide preview image */
}

.check-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background-color: #a2d14b;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 5;
}

.check-icon.active {
    opacity: 1;
}

.check-icon::before {
    content: "";
    width: 15px;
    height: 8px;
    border-left: 3px solid white;
    border-bottom: 3px solid white;
    transform: rotate(-45deg) translate(1px, -2px);
}

.upload-instructions {
    text-align: center;
    color: white;
    font-size: 12px;
    margin-bottom: 5%;
    font-family: 'EuclidCircularB-LightItalic';
}

.upload-btn {
    color: black;
    border-radius: 25px;
    padding: 4%;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    width: 100%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: background-color 0.3s;
    border: 2px solid #fff;
    font-family: 'EuclidCircularB-Bold';
    background: #FEEAAE;
    background: radial-gradient(circle, rgba(254, 234, 174, 1) 0%, rgba(147, 120, 85, 1) 100%);
}

.upload-btn:hover {
    background-color: #c5af7f;
}

.upload-btn::after {
    content: "";
    position: absolute;
    right: 20px;
    width: 10px;
    height: 10px;
    border-top: 2px solid black;
    border-right: 2px solid black;
    transform: rotate(45deg);
}

#file-input {
    display: none;
}

/* Media query for desktop/landscape mode */
@media (min-width: 769px) {
    .container {
        max-width: 400px;
        margin: 0 auto;
        z-index: 2;
        /* Ensure content is above background layers */
    }

    /* Create the desktop experience with centered app and blurred bg */
    .background-container {
        /* Contains two background layers */
        overflow: hidden;
    }

    .blurred-bg {
        /* Main background that's centered and full height */
        background-position: center;
        background-size: auto 100%;
        background-repeat: no-repeat;
    }

    /* Add a pseudo-element for the blurred background copy */
    .background-container::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-image: url('../assets/bg3.jpg');
        background-position: center;
        background-size: cover;
        filter: blur(10px);
        z-index: -1;
    }
}

.page1-content {
    text-align: center;
    padding: 40px 20px;
}

.page2-content {
    display: block;
    width: 90%;
    margin: 0 auto;
}


.page1-content h1 {
    font-size: 1.3em;
    font-family: 'EuclidCircularB-Bold';
    text-transform: uppercase;
    margin-top: 10px;
    letter-spacing: 2px;
    background: #8F795A;
    background: repeating-linear-gradient(to right, #8F795A 0%, #FCECB6 54%, #CEBB8D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.button-group {
    margin: 20px 0;
}

.style-btn {
    margin: 10px;
    padding: 12px 20px;
    font-size: 1em;
    font-family: 'EuclidCircularB-Medium';
    border: none;
    border-radius: 8px;
    background-color: #b39a68;
    color: #000;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

.style-btn:hover {
    background-color: #dddada;
}

/* Base styles */

.page1-content p {
    color: #FFF;
    font-size: 1rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-family: 'EuclidCircularB-Regular';
}

.page1-content h1 {
    font-size: 1.3rem;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
}

.btnstyle {
    flex: 1 1 250px;
    min-width: 250px;
    text-align: center;
    padding: 12px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 25px;
    background-color: #b39a68;
    color: #000;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
    font-family: 'EuclidCircularB-Regular';
}

.btnstyle:hover {
    background-color: #FFF;
}

.hair-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.hair-option-img {
    width: 120px;
    height: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.hair-option-img:hover {
    transform: scale(1);
}


.next-button {
    /* flex: 1 1 250px; */
    min-width: 250px;
    margin-top: 15px;
    text-align: center;
    padding: 12px 24px;
    font-size: 1rem;
    border: 2px solid #FFF;
    border-radius: 25px;
    color: #000;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
    font-family: 'EuclidCircularB-Bold';
    background: #FEEAAE;
    background: radial-gradient(circle, rgba(254, 234, 174, 1) 0%, rgba(147, 120, 85, 1) 100%);
}

.next-button:hover {
    background-color: #FFF;
}

.btnstyle.selected {
    border: 2px solid #b39a68;
    background-color: #fff;
    color: #000;
}

.hair-option-img.selected-hair {
    transform: scale(1.05);
}

#face-shape {
    margin-top: 1rem;
    font-weight: bold;
    text-align: center;
}

.hidden {
    display: none;
}

/* Tablet view */
@media (max-width: 768px) {
    .page1-content p {
        font-size: 1rem;
    }

    .page1-content h1 {
        font-size: 1.3rem;
    }

    .style-btn {
        font-size: 0.95rem;
        padding: 10px 20px;
    }
}

/* Mobile view */
@media (max-width: 480px) {


    .page1-content p {
        font-size: 0.95rem;
    }

    .page1-content h1 {
        font-size: 1.3rem;
    }

    .button-group {
        flex-direction: column;
        align-items: center;
    }

    .btnstyle {
        width: 100%;
        max-width: 300px;
    }
}

/* Styles for the results page */
.results-container {
    padding: 20px;
    overflow: hidden;
    position: relative;
    color: white;
    max-width: 100%;
}

.results-container h2 {
    color: #e0c088;
    text-align: center;
    font-family: 'EuclidCircularB-Bold';
    margin-bottom: 20px;
    text-transform: uppercase;
}

.result-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    overflow: hidden;
    max-height: 480px;
    position: relative;
}

.result-image {
    max-width: 100%;
    max-height: 480px;
    object-fit: contain;
}

.result-section {
    margin-bottom: 15px;
}

.result-section h3 {
    color: #e0c088;
    font-family: 'EuclidCircularB-Medium';
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.result-section p {
    margin-bottom: 10px;
    line-height: 1.4;
}

.result-section ul {
    list-style-type: none;
    padding-left: 10px;
}

.result-section ul li {
    position: relative;
    padding-left: 15px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.result-section ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #e0c088;
}

.back-button {
    background-color: transparent;
    color: white;
    border: 2px solid white;
    border-radius: 25px;
    padding: 10px 20px;
    text-align: center;
    text-transform: uppercase;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: 'EuclidCircularB-Medium';
}

.back-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .results-container {
        padding: 15px;
    }

    .results-container h2 {
        font-size: 1.3rem;
    }

    .result-section h3 {
        font-size: 1rem;
    }
}

/* Style icons container */
.style-icons-container img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.3s, border-color 0.3s;
}

.style-icons-container img:hover {
    transform: scale(1.1);
}

/* Active (selected) icon */
.style-icons-container img.active {
    border-color: #e0c088;
    /* Gold border */
}

/* Add a processing class for the image */
.result-image.processing {
    opacity: 0.7;
    filter: blur(2px);
}

/* Add a pulsing animation for clicking on the already selected icon */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.hairstyle-circle.pulse-animation {
    animation: pulse 0.3s ease;
}

/* Style for the icon container to properly show the scaled icons */
.style-icons-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 10px 0;
    position: absolute;
    left: 0;
    right: 0;
    top: 80%;
    background: linear-gradient(0deg, rgba(0, 0, 0, 1) 0%, rgba(255, 255, 255, 0) 100%);
}

.style-icon {
    cursor: pointer;
    padding: 2px;
    box-sizing: border-box;
    transition: transform 0.3s ease;
}

.style-icon.active {
    border: 2px solid #ff1493;
    /* Hot pink border for selected icon */
    border-radius: 5px;
}

.card-container h2 {
    text-align: center;
    color: #e0c088;
    text-transform: uppercase;
    font-size: 1.2em;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.card-container p {
    text-align: center;
    color: #FFF;
    font-size: 0.8em;
}

.download-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 20px;
    flex-wrap: wrap;
    /* stack vertically on small screens */
}

.icon-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    /* space between two images */
}

.placeholder,
.icondownload {
    max-width: 120px;
    height: auto;
}

.button-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.buynow-button,
.join-button {
    padding: 12px 20px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    width: 100%;
    max-width: 220px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* Button specific colors */
.buynow-button {
    background-color: #e0c088;
    color: #fff;
}

.join-button {
    background-color: #e0c088;
    color: #fff;
}

.buynow-button:hover {
    background-color: #FFF;
}

.join-button:hover {
    background-color: #FFF;
}

/* Additional styles for the new results page (page3) */
#page3 {
    width: 100%;
    height: 100%;
    position: relative;
}

.header-section {
    position: relative;
    width: 100%;
    padding: 20px 20px 30px;
    z-index: 10;
    flex-shrink: 0;
}

#page3 .logo {
    width: 150px;
    height: auto;
}

#page3 .headline {
    width: 100%;
    /* margin-top: 30px; */
    margin-top: 90px;
    text-align: center;
    color: #e6d6a8;
    font-size: 24px;
    font-weight: bold;
    padding: 0 20px;
    /* text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5); */
    text-transform: uppercase;
    font-family: 'EuclidCircularB-Bold';
    background: #8F795A;
    background: repeating-linear-gradient(to right, #8F795A 0%, #FCECB6 54%, #CEBB8D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.image-section {
    flex-grow: 1;
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    overflow: hidden;
}

#processed-image {
    width: 100%;
    height: auto;
    max-height: calc(100vh - 170px);
    /* Subtract header height to prevent overflow */
    object-fit: contain;
}

.hairstyle-options {
    position: absolute;
    bottom: 50px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 0 10px;
    z-index: 20;
}

.hairstyle-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 30%;
}

.hairstyle-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #e6d6a8;
    border: 1px solid #e6d6a8;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    transition: transform 0.3s, border-color 0.3s;
}

.hairstyle-circle:hover {
    transform: scale(1);
}

.hairstyle-circle.active {
    border-color: #997a42;
    border-width: 2px;
    /* box-shadow: 0 0 10px rgba(224, 192, 136, 0.5); */
}

.hairstyle-icon {
    width: 80%;
    height: auto;
}

.hairstyle-label {
    color: white;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    font-family: 'EuclidCircularB-Bold';
}

.submit-button {
    position: absolute;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    background: #FEEAAE;
    background: radial-gradient(circle, rgba(254, 234, 174, 1) 0%, rgba(147, 120, 85, 1) 100%);
    color: #3a2c0e;
    border: none;
    border-radius: 25px;
    padding: 10px 40px;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    font-family: 'EuclidCircularB-Bold';
}

.submit-button:hover {
    background-color: #d6c698;
}

@media (max-width: 480px) {
    .header-section {
        padding-bottom: 20px;
    }

    #page3 .headline {
        font-size: 20px;
        margin-top: 20px;
    }

    .hairstyle-circle {
        width: 70px;
        height: 70px;
    }

    .hairstyle-label {
        font-size: 12px;
    }

    #page3 .logo {
        width: 120px;
    }

    .hairstyle-options {
        bottom: 15%;
    }

    #processed-image {
        max-width: 100%;
        max-height: calc(100vh - 140px);
    }

    .submit-button {
        font-size: 14px;
        padding: 8px 30px;
        bottom: 10%;
    }
}

/* For shorter screens, adjust positions to ensure everything fits */
@media (max-height: 600px) {
    .header-section {
        padding-top: 15px;
        padding-bottom: 15px;
    }

    #page3 .headline {
        margin-top: 15px;
    }

    .hairstyle-options {
        bottom: 15%;
    }

    .hairstyle-circle {
        width: 60px;
        height: 60px;
    }

    #processed-image {
        max-height: calc(100vh - 120px);
    }
}

/* Reset existing results page style to avoid conflicts */
#page3 .results-container {
    padding: 0;
    overflow: visible;
    position: static;
    color: white;
    max-width: 100%;
    height: 100%;
}

#page3 .result-image-container {
    margin-bottom: 0;
    overflow: visible;
    position: static;
    max-height: none;
}

#style-processing {
    z-index: 30;
    /* Above hairstyle options */
}

/* Page 4 specific styles - product page */
#page4 {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
}

.page4-outside-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.page4-outside-background {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bg-pattern {
    z-index: 1;
}

.bg-main {
    z-index: 2;
}

#scaler-container {
    position: relative;
    width: 640px;
    height: 100vh;
    /* transform-origin: center; */
    z-index: 10;
    /* Center the container properly */
    margin: 0 auto;
}

#scaler-container .products {
    position: absolute;
    width: 640px;
    height: 477px;
    top: 50%;
}

#scaler-container .frame {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 300px;
    height: 533.33px;
    transform: translate(-50%, -50%) translate3d(-158px, 41px, 0px);
    object-fit: contain;
}

#scaler-container .logo {
    position: absolute;
    width: 158px;
    height: 68px;
    left: 50%;
    top: 0px;
    transform: translate(-50%, 0%) translate3d(0px, 40px, 0px);
}

#scaler-container .button1 {
    position: absolute;
    width: 286px;
    height: 48px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translate3d(151px, -111px, 0px);
    cursor: pointer;
}

#scaler-container .button2 {
    position: absolute;
    width: 286px;
    height: 48px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translate3d(151px, -41px, 0px);
    cursor: pointer;
}

#scaler-container .text3 {
    position: absolute;
    width: 273px;
    height: 42px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) translate3d(152px, 19px, 0px);
}

#scaler-container .text2 {
    position: absolute;
    width: 555px;
    height: 20px;
    top: 6%;
}

#scaler-container .text1 {
    position: absolute;
    width: 582px;
    height: 25px;
    top: 0px;
}

#scaler-container .download {
    position: absolute;
    width: 63px;
    height: 66px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) translate3d(23px, -192px, 0px);
    cursor: pointer;
}

@media (width: 640px) and (height: 960px) {
    #scaler-container .frame {
        transform: translate(-50%, -50%) translate3d(-145px, 50px, 0px);
    }

    #scaler-container .button2 {
        transform: translate(-50%, -50%) translate3d(162px, -38px, 0px);
    }

    #scaler-container .button1 {
        transform: translate(-50%, -50%) translate3d(162px, -109px, 0px);
    }

    #scaler-container .text3 {
        transform: translate(-50%, -50%) translate3d(160px, 18px, 0px);
    }

    #scaler-container .download {
        transform: translate(-50%, -50%) translate3d(39px, -181px, 0px);
    }
}
.home-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(254, 234, 174, 1) 0%, rgba(147, 120, 85, 1) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease-in-out;
}

.home-button:hover {
    transform: scale(1.1);
}

.home-icon {
    width: 24px;
    height: 24px;
}
