* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    max-width: 350px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    background: white;
    min-height: 100vh;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.menu-icon {
    font-size: 24px;
    color: #333;
    cursor: pointer;
}

.logo {
    width: 40px;
    height: 40px;
}

.profile-icon {
    width: 40px;
    height: 40px;
    background: #ffd9b3;
    border-radius: 20%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-container {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.instruction-text {
    font-size: 16px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: center;
}

.illustration {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
}

.measurement-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

.requirements-list {
    list-style: none;
    margin-bottom: 30px;
}

.requirements-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    color: #333;
    font-size: 15px;
}

.requirements-list li:before {
    content: "";
    display: inline-block;
    width: 20px;
    margin-right: 10px;
}

.button-primary {
    background:#DB8E00;
    color: white;
    border: none;
    padding: 15px;
    width: 100%;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
}

.button-primary:hover {
    background:#DB8E00;
}

.button-secondary {
    background: #DB8E00;
    color: #ffffff;
    border: 1px solid #ddd;
    padding: 15px;
    width: 100%;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

.image-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.7);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 153, 0, 0.3);
    border-radius: 50%;
    border-top-color: #f90;
    animation: spin 1s ease-in-out infinite;
}

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

.measurement-figure {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.measurement-figure img {
    width: 200px;
    margin: 0 auto;
}

.pose-container {
    margin-bottom: 16px;
}

.pose-image {
    width: 100%;
    border-radius: 16px;
    margin-bottom: 8px;
}

.pose-description {
    text-align: center;
    color: #666;
    font-size: 14px;
}

.measurement-box {
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.measurement-label {
    font-size: 14px;
    color: #333;
    text-transform: uppercase;
}

.measurement-value {
    display: flex;
    align-items: center;
}

.value {
    margin-right: 5px;
    font-size: 16px;
    border: none;
    width: 40px;
    text-align: right;
    outline: none;
}

.unit {
    color: #666;
    margin-right: 5px;
}

.chevron {
    color: #666;
    transition: transform 0.3s;
}

.chevron.active {
    transform: rotate(180deg);
}

.dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px 0;
    margin-top: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none;
    z-index: 100;
    width: 100px;
}

.dropdown.active {
    display: block;
}

.dropdown-item {
    padding: 8px 15px;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
}

.overlay.active {
    display: block;
}

#part1, #part2, #part3 {
    display: none;
}

#part1.active, #part2.active, #part3.active {
    display: block;
}

/* Result Screen Styles */
.result-screen {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    display: flex;
    flex-direction: column;
    background: #f5f5f5; /* Match landing page background */
    color: #333; /* Match landing page text color */
    /* Prevent scrolling issues on mobile */
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 1000;
}

.result-header {
    display: flex;
    align-items: center;
    padding: 20px;
    background: white; /* White background like landing page */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    position: relative;
    z-index: 10;
}

.back-btn {
    background: #DB8E00; /* Golden color like landing page buttons */
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    margin-right: 15px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.back-btn:hover {
    background: #e6800a; /* Darker golden on hover */
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(219, 142, 0, 0.3);
}

.result-header h2 {
    font-size: 18px;
    margin: 0;
    flex: 1;
    text-align: center;
    color: #333; /* Match landing page text color */
    font-weight: 500;
}

.result-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.result-image-container-fullscreen {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: white; /* White background like landing page */
    border-radius: 12px; /* Rounded corners like landing page */
    margin: 10px; /* Add some margin */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Subtle shadow like landing page */
}

.result-image-container-fullscreen img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    /* Prevent image from being too large on mobile */
    max-width: 100vw;
    max-height: 100vh;
    /* Smooth scaling for large images */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    /* Fallback for better performance */
    image-rendering: auto;
}

.image-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9); /* White overlay with transparency */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #333; /* Dark text on white background */
    border-radius: 12px; /* Match container border radius */
}

.image-loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(219, 142, 0, 0.3); /* Golden color with transparency */
    border-radius: 50%;
    border-top-color: #DB8E00; /* Golden color */
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

.result-controls {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: white; /* White background like landing page */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    position: relative;
    z-index: 10;
}

.control-btn {
    flex: 1;
    background: #DB8E00; /* Golden color like landing page buttons */
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 10px; /* Match landing page button radius */
    cursor: pointer;
    font-weight: 500; /* Match landing page button weight */
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #e6800a; /* Darker golden on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(219, 142, 0, 0.3);
}

.control-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 18px;
}

.download-btn {
    background: #DB8E00; /* Keep golden color for consistency */
}

.download-btn:hover {
    background: #e6800a; /* Darker golden on hover */
    box-shadow: 0 4px 12px rgba(219, 142, 0, 0.3);
}

.try-another-btn {
    background: #DB8E00; /* Keep golden color for consistency */
}

.try-another-btn:hover {
    background: #e6800a; /* Darker golden on hover */
    box-shadow: 0 4px 12px rgba(219, 142, 0, 0.3);
}

.size {
    color: #ff9900;
}

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

.scanning {
    background: linear-gradient(90deg, #DB8E00, #ffb84d, #DB8E00);
    background-size: 200% 100%;
    animation: scanning 2s linear infinite;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.success-icon {
    position: absolute;
    width: 60px;
    height: 60px;
    background: #DB8E00;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 32px;
    left: 580px;
    top: 139px;
}

* {
}

.modal-content h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.modal-content p {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.4;
}

#viewSize {
    margin-top: 10px;
}

/* Result image container for better aspect ratio handling */
.result-image-container {
    width: 100%;
    max-height: 60vh;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f8f8;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.result-image-container img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Loading state for result image */
.result-image-container.loading {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-image-container.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid rgba(219, 142, 0, 0.3);
    border-radius: 50%;
    border-top-color: #DB8E00;
    animation: spin 1s ease-in-out infinite;
}


#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

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

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