* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { background: black; }

body {
    font-family: 'Montserrat', sans-serif;
    background: radial-gradient(ellipse at -40% 29%, rgba(205, 110, 30, 0.4) 26%, rgba(0, 0, 0, 1) 50%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Make container full width with ~20px padding on each side */
.container {
    /* background: radial-gradient(ellipse at 0% 38%, rgba(139, 92, 72, 0.4) 26%, rgba(0, 0, 0, 1) 50%);*/
    border-radius: 20px;
    padding: 4rem 20px; /* 20px left/right padding */
    width: 100%;
    max-width: 40rem;
    /* box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);*/
}

@media (max-width: 590px) {
    .container {
        padding: 3rem 20px; /* maintain 20px sides on mobile */
        height: 100vh;
    }
}

h1 {
    text-align: center;
    color: white;
    margin-bottom: 10px;
    font-size: 28px;
}

.subtitle {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    font-size: 14px;
}

.legal {
    text-align: center;
    color: #999;
    margin-bottom: 2em;
    margin-top: 2em;
    font-size: 11px;
}

/* Photo Area with style-driven backgrounds and clickability */
.photo-area {
    width: 100%;
    aspect-ratio: 3/4;
    background-color: black;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
    transition: filter 0.2s ease;
    pointer-events: auto;
    cusror: pointer;
}

/* Default background images based on style class */
.photo-area.bg-broccolate {
    background-image: url('./assets/broccolate-bg.png');
}

.photo-area.bg-bobbate {
    background-image: url('./assets/bobbate-bg.png');
}

/* When an image is loaded, switch to a neutral background to avoid clashing */
.photo-area.has-image {
    background-image: none;
    background: #000;
}

/* Disable interactions during processing and while showing results */
.photo-area.disabled {
    pointer-events: none;
    cursor: not-allowed;
    filter: grayscale(0.1) brightness(0.9);
}

.photo-placeholder {
    color: white;
    text-align: center;
    padding: 20px;
    pointer-events: auto;
}

.photo-placeholder svg {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
    opacity: 0.3;
}

#previewImage, #resultImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    pointer-events: auto;
    cursor: pointer;
}

#previewImage.show, #resultImage.show {
    display: block;
}

#resultImage.show {
    z-index: 1000;
}

/* Toggle Switch Styling */
.style-selector {
    margin-bottom: 25px;
}

.style-selector > label {
    display: block;
    margin-bottom: 20px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
}

.style-options {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.style-option {
    position: relative;
}

.style-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.style-option-label {
    color: #666;
    font-size: 15px;
    font-weight: 600;
    transition: color 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.style-option input[type="radio"]:checked + .style-option-label {
    color: white;
}

/* Toggle Switch */
.toggle-switch {
    width: 107px;
    height: 50px;
    background: linear-gradient(90deg, rgba(253, 191, 93, 1) 0%, rgba(170, 108, 43, 1) 50%, rgba(253, 191, 93, 1) 100%);
    border-radius: 25px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(253, 191, 93, 0.3);
}

.toggle-slider {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateX(0);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

button {
    width: 100%;
    padding: 1em;
    border: none;
    border-radius: 2em;
    font-size: 1.75em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(90deg, rgba(253, 191, 93, 1) 0%, rgba(170, 108, 43, 1) 50%, rgba(253, 191, 93, 1) 100%);
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover:not(:disabled)::before {
    opacity: 1;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(245, 158, 11, 0.5);
}

.btn-secondary {
    background: linear-gradient(90deg, rgba(253, 191, 93, 1) 0%, rgba(170, 108, 43, 1) 50%, rgba(253, 191, 93, 1) 100%);
    color: white;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    padding: 20px;
    pointer-events: auto;
}

.spinner {
    border: 4px solid #333;
    border-top: 4px solid #FDBF5D;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    font-size: 14px;
}

.error-message {
    background: rgba(255, 100, 100, 0.2);
    border: 2px solid rgba(255, 100, 100, 0.5);
    color: #ff6666;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.error-message strong {
    display: block;
    margin-bottom: 5px;
}

#fileInput {
    display: none;
}

#logo {
    display: block; 
    margin: 0 auto 3.25rem; 
    max-width: 36rem;
    width: 100%;
}