/* Enhanced Main Page Styling */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
}

/* Result page specific body styling */
body:has(.result-container) {
    background: #f8fafc !important;
    background-attachment: initial !important;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-top: 40px;
    margin-bottom: 40px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 40px;
    font-weight: 400;
}

/* Enhanced Upload Area */
.upload-area {
    border: 3px dashed #bdc3c7;
    border-radius: 15px;
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    color: #bdc3c7;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.upload-area:hover .upload-icon {
    color: #667eea;
    transform: scale(1.1);
}

.upload-text {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-weight: 500;
}

.upload-subtext {
    font-size: 0.9rem;
    color: #95a5a6;
}

/* Enhanced Submit Button */
.submit-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
    margin-top: 20px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

.submit-btn:disabled {
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Generic hidden helper */
.hidden {
    display: none !important;
}

.wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Logo Styles */
.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

.form {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-group.inline {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.form-group.checkbox {
    justify-content: center;
}

.form input[type="file"],
.form textarea,
.form select {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    resize: vertical;
}

.form textarea {
    min-height: 100px;
}

.form .required {
    color: #d32f2f;
    margin-left: 0.25rem;
}

.btn {
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn:hover {
    background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
}

.loader.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 6px solid #d1d5db;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Camera section - Base styles */
.camera-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Camera preview container with 4:6 aspect ratio - Base styles */
.camera-preview-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    aspect-ratio: 4 / 6;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.camera-section video {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    background: #000;
    object-fit: cover;   /* Fill the 4:6 container */
    display: block;
}

/* Crop overlay - now hidden since camera shows crop area directly */
.crop-overlay {
    display: none;
}

.crop-frame {
    position: absolute;
    border: 3px solid #00ff00;
    border-radius: 4px;
    background: transparent;
    box-sizing: border-box;
}

.crop-frame::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    pointer-events: none;
}

/* Hide overlay by default, show when camera is active */
.crop-overlay.hidden {
    display: none;
}

/* Camera controls */
.camera-controls {
    display: flex;
    gap: 0.5rem;
}

/* Capture frame container for preview - Base styles */
.capture-frame {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 10px auto;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ddd;
    aspect-ratio: 4 / 6; /* 4:6 aspect ratio for preview */
}

.capture-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* fill without bars */
    display: block;
}

/* Desktop-specific improvements (PC only) */
@media screen and (min-width: 1025px) {
    body {
        padding: 2rem 0;
    }
    
    .wrapper {
        max-width: 800px;
        padding: 3rem;
        margin: 2rem auto;
        min-height: auto;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 24px;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
        backdrop-filter: blur(10px);
    }
    
    .logo {
        width: 160px;
        height: 160px;
        margin-bottom: 2rem;
    }
    
    .form {
        padding: 2.5rem;
        gap: 2rem;
        border-radius: 20px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(8px);
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .form-group label {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 0.75rem;
        color: #374151;
    }
    
    .form input[type="file"],
    .form textarea,
    .form select {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        border-radius: 12px;
        border: 2px solid #e5e7eb;
        transition: all 0.3s ease;
    }
    
    .form input[type="file"]:focus,
    .form textarea:focus,
    .form select:focus {
        border-color: #8b5cf6;
        box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
        outline: none;
    }
    
    .btn {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        border-radius: 12px;
        min-height: 56px;
        font-weight: 600;
        transition: all 0.3s ease;
        cursor: pointer;
    }
    
    .btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 30px rgba(139, 92, 246, 0.4);
    }
    
    /* Desktop form layout improvements */
    .input-toggle {
        display: flex;
        gap: 1rem;
        margin-bottom: 1.5rem;
        justify-content: center;
    }
    
    /* Desktop camera styling - more specific targeting */
    .camera-preview-container {
        max-width: 500px;
        margin: 1.5rem auto;
        border: 3px solid #e5e7eb;
        border-radius: 16px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    }
    
    .camera-section video {
        border-radius: 13px;
    }
    
    .camera-controls {
        gap: 1.5rem;
        margin-top: 1.5rem;
        justify-content: center;
    }
    
    /* Desktop capture frame styling */
    .capture-frame {
        max-width: 500px;
        margin: 1.5rem auto;
        border: 3px solid #e5e7eb;
        border-radius: 16px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    }
    
    .capture-frame img {
        border-radius: 13px;
    }
    
    /* Desktop result page styling */
    .result-container {
        max-width: 900px;
        padding: 3rem;
        margin: 3rem auto;
    }
    
    .result-image-container {
        max-width: 600px;
        margin: 2rem auto;
    }
    
    .result-image-container img {
        max-width: 100%;
        height: auto;
        border-radius: 16px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    }
    
    .result-actions {
        gap: 2rem;
        margin-top: 2.5rem;
    }
    
    .result-actions .action-btn {
        width: 100px;
        height: 100px;
        min-width: 100px;
        padding: 25px;
        border-radius: 16px;
        font-size: 1.1rem;
    }
    
    .result-actions .btn-icon-svg {
        width: 28px;
        height: 28px;
    }
    
    .toggle-btn {
        flex: 1;
        max-width: 200px;
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border-radius: 12px;
        transition: all 0.3s ease;
        cursor: pointer;
        font-weight: 600;
    }
    
    .toggle-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }
    
    /* Style buttons grid for desktop */
    .style-buttons {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        margin: 1.5rem 0;
    }
    
    .style-buttons .style-btn {
        padding: 1rem;
        font-size: 0.95rem;
        min-height: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        line-height: 1.3;
    }
    
    /* Gender buttons */
    .gender-buttons {
        display: flex;
        gap: 1rem;
        justify-content: center;
        margin: 1rem 0;
    }
    
    .gender-buttons .btn {
        flex: 1;
        max-width: 200px;
    }
    
    /* Output size dropdown */
    .form select {
        background-color: white;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 0.75rem center;
        background-repeat: no-repeat;
        background-size: 1.5em 1.5em;
        padding-right: 2.5rem;
    }
    
    /* Checkbox styling */
    .form-group.checkbox {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        margin: 1.5rem 0;
    }
    
    .form-group.checkbox input[type="checkbox"] {
        width: 20px;
        height: 20px;
        accent-color: #8b5cf6;
    }
    
    .form-group.checkbox label {
        font-size: 1rem;
        margin-bottom: 0;
        cursor: pointer;
    }
}

/* Large desktop screens */
@media screen and (min-width: 1440px) {
    .wrapper {
        max-width: 900px;
        padding: 4rem;
    }
    
    .form {
        padding: 3rem;
    }
    
    .logo {
        width: 180px;
        height: 180px;
    }
}

.loader-text {
    font-size: 1rem;
    color: #4b5563;
}

.result {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.result.hidden {
    display: none;
}

.result img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s forwards ease;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.download {
    display: inline-block;
    background: #10b981;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
}

.download:hover {
    background: #059669;
}

/* Toggle between upload and camera */
.input-toggle {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.toggle-btn {
    flex: 1;
    padding: 0.5rem 0;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-btn.active {
    background: #6366f1;
    color: #ffffff;
}

.toggle-btn:not(.active):hover {
    background: #e5e7eb;
}

/* Upload section styling */
.upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

.upload-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    width: 100%;
    text-align: center;
    transition: all 0.3s ease;
    color: white;
    font-size: 1rem;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(103, 126, 234, 0.4);
}

.hidden-input {
    display: none;
}

/* Mobile Responsive Design for Different Orientations */
@media screen and (max-width: 768px) {
    .container {
        margin: 10px;
        padding: 15px;
        border-radius: 15px;
    }
    
    .camera-section video {
        max-height: 60vh;
    }
    
    .camera-controls {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }
    
    .btn {
        min-width: 120px;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
}

/* Portrait Orientation - Optimize for vertical space */
@media screen and (max-width: 768px) and (orientation: portrait) {
    .camera-preview-container {
        max-width: 300px;
    }
    
    .capture-frame {
        max-width: 300px;
        margin: 15px auto;
    }
}

/* Landscape Orientation - Optimize for horizontal space */
@media screen and (max-width: 1024px) and (orientation: landscape) {
    .container {
        max-width: 95%;
        margin: 5px auto;
        padding: 10px;
    }
    
    .camera-preview-container {
        max-width: 250px;
    }
    
    .camera-controls {
        margin-top: 10px;
    }
    
    .capture-frame {
        max-width: 250px;
        margin: 10px auto;
    }
    
    /* Fix loading animation positioning in landscape mode */
    .generation-overlay {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }
    
    .overlay-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .spinner {
        width: 80px;
        height: 80px;
        margin: 0 auto 1rem;
        flex-shrink: 0;
    }
    
    .spinner.large {
        width: 80px;
        height: 80px;
    }
    
    .overlay-content .loader-text {
        font-size: 1rem;
        margin-top: 0.5rem;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 300px;
    }
}

/* Very small screens (phones in portrait) */
@media screen and (max-width: 480px) {
    .camera-preview-container {
        max-width: 250px;
    }
    
    .btn {
        min-width: 100px;
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .capture-frame {
        max-width: 250px;
    }
}

/* Cropper button styling */
.cropper-reset, .cropper-apply {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    max-width: 140px;
    width: 140px;
    height: 48px;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.cropper-reset {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.cropper-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
}

.cropper-apply {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.cropper-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
}

/* Mobile responsive styling for cropper buttons */
@media screen and (max-width: 768px) {
    .cropper-reset, .cropper-apply {
        padding: 14px 18px;
        font-size: 0.95rem;
        min-width: 140px;
        max-width: 140px;
        width: 140px;
        height: 50px;
        border-radius: 8px;
    }
}

@media screen and (max-width: 480px) {
    .cropper-reset, .cropper-apply {
        padding: 12px 16px;
        font-size: 0.9rem;
        min-width: 130px;
        max-width: 130px;
        width: 130px;
        height: 46px;
        flex-shrink: 0;
    }
}

.btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Generation overlay */
.generation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        rgba(99,102,241,0.1) 0%, 
        rgba(139,92,246,0.15) 25%, 
        rgba(59,130,246,0.1) 50%, 
        rgba(168,85,247,0.15) 75%, 
        rgba(99,102,241,0.1) 100%);
    background-size: 400% 400%;
    animation: gradientShift 8s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    z-index: 999;
}

.generation-overlay.hidden {
    display: none;
}

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

.overlay-content {
    text-align: center;
    position: relative;
    color: white;
}

.overlay-content .loader-text {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Advanced Multi-Ring Spinner */
.spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.spinner.large {
    width: 120px;
    height: 120px;
}

/* Outer ring */
.spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top: 4px solid #6366f1;
    border-right: 4px solid #8b5cf6;
    border-radius: 50%;
    animation: spinOuter 2s linear infinite;
}

/* Middle ring */
.spinner::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    width: calc(100% - 30px);
    height: calc(100% - 30px);
    border: 3px solid transparent;
    border-bottom: 3px solid #3b82f6;
    border-left: 3px solid #a855f7;
    border-radius: 50%;
    animation: spinMiddle 1.5s linear infinite reverse;
}

/* Inner pulsing dot */
.spinner .inner-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: pulse 1s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* Orbiting particles */
.spinner .particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #6366f1;
    border-radius: 50%;
    animation: orbit 3s linear infinite;
}

.spinner .particle:nth-child(2) {
    animation-delay: -0.5s;
    background: #8b5cf6;
}

.spinner .particle:nth-child(3) {
    animation-delay: -1s;
    background: #3b82f6;
}

.spinner .particle:nth-child(4) {
    animation-delay: -1.5s;
    background: #a855f7;
}

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

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

@keyframes pulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.8;
    }
}

@keyframes orbit {
    0% {
        transform: rotate(0deg) translateX(45px) rotate(0deg);
        opacity: 1;
    }
    25% {
        opacity: 0.7;
    }
    50% {
        opacity: 0.4;
    }
    75% {
        opacity: 0.7;
    }
    100% {
        transform: rotate(360deg) translateX(45px) rotate(-360deg);
        opacity: 1;
    }
}

/* Animated loading text */
.loader-text {
    font-size: 1.1rem;
    color: #4b5563;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.loader-text::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #3b82f6);
    animation: loadingBar 2s ease-in-out infinite;
}

@keyframes loadingBar {
    0%, 100% { width: 0; left: 0; }
    50% { width: 100%; left: 0; }
    51% { width: 100%; left: 100%; }
    100% { width: 0; left: 100%; }
}

/* Floating elements around the spinner */
.overlay-content::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    right: -50px;
    bottom: -50px;
    background: radial-gradient(circle at 20% 30%, rgba(99,102,241,0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(139,92,246,0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 80%, rgba(59,130,246,0.1) 0%, transparent 50%);
    animation: floatingGlow 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes floatingGlow {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        opacity: 0.3;
    }
    33% { 
        transform: scale(1.1) rotate(120deg);
        opacity: 0.5;
    }
    66% { 
        transform: scale(0.9) rotate(240deg);
        opacity: 0.4;
    }
}

.overlay-content {
    text-align: center;
}

.spinner.large {
    width: 72px;
    height: 72px;
    border-width: 8px;
}

/* Result page specific styles */
.result-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    margin-bottom: 1rem;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn.secondary {
    background: linear-gradient(90deg, #0ea5e9 0%, #3b82f6 100%);
    color: #ffffff;
}

.btn.secondary:hover {
    background: linear-gradient(90deg, #0284c7 0%, #2563eb 100%);
}

.btn.back {
    display: inline-block;
    background: transparent;
    color: #6366f1;
    border: 2px solid #6366f1;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s, color 0.3s;
}

.btn.back:hover {
    background: #6366f1;
    color: #ffffff;
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    .wrapper {
        margin: 1rem;
        padding: 1rem;
    }
    
    .logo {
        width: 80px;
        height: 80px;
    }
    
    .camera-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    /* Unified button sizing for all button types */
    .camera-controls .btn,
    .toggle-btn,
    .upload-btn,
    .gender-btn,
    .style-btn,
    .btn,
    .cropper-reset,
    .cropper-apply,
    .action-btn {
        min-height: 44px; /* iOS touch target minimum */
        padding: 0.75rem 1rem;
        font-size: 1rem;
        font-weight: 600;
    }
    
    .camera-controls .btn {
        width: 100%;
    }
    
    .toggle-btn {
        padding: 0.75rem 1.5rem;
    }
    
    .gender-btn {
        min-width: auto;
        width: 100%;
        padding: 0.75rem 1rem;
    }
    
    .style-btn {
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    #video {
        max-height: 50vh;
        height: auto;
        object-fit: contain;
    }
    
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 120px;
    }
    
    .cropper-reset,
    .cropper-apply {
        min-height: 50px;
        min-width: 50px;
        width: 50px;
        height: 50px;
        padding: 0;
        font-size: 1.5rem;
        font-weight: 400;
        margin: 0.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        line-height: 1;
    }
    
    .action-btn {
        min-height: 50px;
        min-width: 50px;
        width: 50px;
        height: 50px;
        padding: 0;
        font-size: 1.5rem;
        font-weight: 400;
        margin: 0.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        line-height: 1;
    }
    
    .btn.primary {
        min-height: 50px;
        font-size: 1.1rem;
        padding: 0.875rem 2rem;
    }
    
    .container {
        margin: 20px;
        padding: 20px;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .gender-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .gender-btn {
        min-width: auto;
        width: 100%;
    }
    
    .style-buttons {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 6px;
    }
    
    .style-btn {
        font-size: 0.75rem;
        padding: 6px 8px;
        min-height: 35px;
    }
    
    .upload-area {
        padding: 30px 15px;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(103, 126, 234, 0.3);
    }
    
    .toggle-btn:hover {
        background: #f8f9fa;
    }
    
    .toggle-btn.active:hover {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    #video {
        -webkit-playsinline: true;
        object-fit: contain; /* don't force 9/16 on iOS */
    }
    
    .camera-section {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Gender Selection Buttons */
.gender-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

.gender-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 15px;
    padding: 15px 25px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.gender-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.gender-btn.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.gender-btn.active:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

.gender-icon {
    font-size: 20px;
}

/* Style Selection Buttons */
.style-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}

.style-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    min-height: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    word-wrap: break-word;
    hyphens: auto;
    line-height: 1.2;
    position: relative;
    overflow: hidden;
    transform: translateY(0) scale(1);
}

.style-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
    border-color: #667eea;
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
}

.style-btn:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

.style-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px) scale(1.05);
    animation: activeButtonPulse 2s ease-in-out infinite;
}

.style-description {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border-left: 4px solid #667eea;
    min-height: 50px;
    display: flex;
    align-items: center;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    opacity: 1;
}

.style-description.changing {
    transform: translateY(-10px);
    opacity: 0;
}

.style-description.entering {
    animation: slideInFromBottom 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.style-description p {
    margin: 0;
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.4;
    font-style: italic;
}

.style-btn-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

.style-btn-description {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
}

.style-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.style-btn:hover::before {
    left: 100%;
}

.style-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    z-index: 0;
}

.style-btn:active::after {
    width: 200px;
    height: 200px;
}

select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
    transition: border-color 0.3s ease;
}

select:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.preset-description {
    margin-top: 8px;
    padding: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 8px;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    min-height: 20px;
    transition: all 0.3s ease;
    border-left: 4px solid #8b5cf6;
}

.preset-description:empty {
    display: none;
}

.preset-description.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

@keyframes slideInFromBottom {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Style Grid Container Animations */
.style-buttons .style-btn {
    animation: fadeInScale 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: scale(0.8);
}

.style-buttons .style-btn:nth-child(1) { animation-delay: 0.1s; }
.style-buttons .style-btn:nth-child(2) { animation-delay: 0.2s; }
.style-buttons .style-btn:nth-child(3) { animation-delay: 0.3s; }
.style-buttons .style-btn:nth-child(4) { animation-delay: 0.4s; }
.style-buttons .style-btn:nth-child(5) { animation-delay: 0.5s; }
.style-buttons .style-btn:nth-child(6) { animation-delay: 0.6s; }
.style-buttons .style-btn:nth-child(7) { animation-delay: 0.7s; }
.style-buttons .style-btn:nth-child(8) { animation-delay: 0.8s; }
.style-buttons .style-btn:nth-child(9) { animation-delay: 0.9s; }
.style-buttons .style-btn:nth-child(10) { animation-delay: 1.0s; }
.style-buttons .style-btn:nth-child(11) { animation-delay: 1.1s; }
.style-buttons .style-btn:nth-child(12) { animation-delay: 1.2s; }
.style-buttons .style-btn:nth-child(13) { animation-delay: 1.3s; }

/* Polaroid Frame Selection Buttons */
.polaroid-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
}

.polaroid-btn {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.polaroid-btn:hover {
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.15);
}

.polaroid-btn.active {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.polaroid-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
    pointer-events: none;
}

.frame-preview {
    width: 60px;
    height: 75px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    overflow: hidden;
}

.frame-preview.no-frame {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 2px dashed #d1d5db;
}

.frame-preview.polaroid-frame {
    background-image: url('../polaroid.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    position: relative;
}

.frame-preview.polaroid1-frame {
    background-image: url('../polaroid1.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    position: relative;
}

.frame-preview.polaroid2-frame {
    background-image: url('../polaroid2.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    position: relative;
}

.preview-image {
    width: 100%;
    height: 60%;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    border-radius: 2px;
    position: relative;
}

.no-frame .preview-image {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    opacity: 0.7;
}

.polaroid-frame .preview-image {
    display: none;
}

.polaroid1-frame .preview-image {
    display: none;
}

.polaroid2-frame .preview-image {
    display: none;
}

.polaroid-btn span {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

.polaroid-btn.active span {
    color: #8b5cf6;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Floating Particles for Main Page */
.main-container {
    position: relative;
    overflow: hidden;
}

.floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    animation: floatUp 8s linear infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 6s; }
.particle:nth-child(2) { left: 20%; animation-delay: 1s; animation-duration: 8s; }
.particle:nth-child(3) { left: 30%; animation-delay: 2s; animation-duration: 7s; }
.particle:nth-child(4) { left: 40%; animation-delay: 3s; animation-duration: 9s; }
.particle:nth-child(5) { left: 50%; animation-delay: 4s; animation-duration: 6s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 8s; }
.particle:nth-child(7) { left: 70%; animation-delay: 6s; animation-duration: 7s; }
.particle:nth-child(8) { left: 80%; animation-delay: 7s; animation-duration: 9s; }
.particle:nth-child(9) { left: 90%; animation-delay: 8s; animation-duration: 6s; }

@keyframes floatUp {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Enhanced Form Animations */
.form-container {
    animation: slideInFromLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInFromLeft {
    0% {
        transform: translateX(-50px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Enhanced Result Page Styling */
.result-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Background Animations for Different Styles */
.result-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.05;
    transition: all 0.5s ease;
}

.result-container.business-theme::before {
    background: linear-gradient(45deg, #3b82f6 0%, #1e40af 100%);
    animation: businessFlow 15s ease-in-out infinite;
}

.result-container.casual-theme::before {
    background: linear-gradient(45deg, #22c55e 0%, #16a34a 100%);
    animation: casualWave 12s ease-in-out infinite;
}

.result-container.elegant-theme::before {
    background: linear-gradient(45deg, #a855f7 0%, #7c3aed 100%);
    animation: elegantShimmer 18s ease-in-out infinite;
}

.result-container.athletic-theme::before {
    background: linear-gradient(45deg, #f97316 0%, #ea580c 100%);
    animation: athleticPulse 8s ease-in-out infinite;
}

.result-container.vintage-theme::before {
    background: linear-gradient(45deg, #f59e0b 0%, #d97706 100%);
    animation: vintageGlow 20s ease-in-out infinite;
}

.result-container.creative-theme::before {
    background: conic-gradient(from 0deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3);
    animation: creativeRainbow 10s linear infinite;
}

.result-container.beach-theme::before {
    background: linear-gradient(45deg, #06b6d4 0%, #0891b2 100%);
    animation: beachWave 14s ease-in-out infinite;
}

.result-container.winter-theme::before {
    background: linear-gradient(45deg, #64748b 0%, #475569 100%);
    animation: winterDrift 16s ease-in-out infinite;
}

.result-container.horror-theme::before {
    background: linear-gradient(45deg, #dc2626 0%, #991b1b 100%);
    animation: horrorFlicker 6s ease-in-out infinite;
}

.result-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-top: 40px;
    margin-bottom: 40px;
}

.result-header {
    text-align: center;
    margin-bottom: 40px;
}

.result-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-subtitle {
    color: #7f8c8d;
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0;
}

.result-content {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.result-image-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.result-image-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.result-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.result-info {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    padding: 25px;
    color: white;
    box-shadow: 0 10px 30px rgba(240, 147, 251, 0.3);
}

.transformation-details h3 {
    margin: 0 0 20px 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.detail-label {
    font-weight: 600;
    opacity: 0.9;
}

.detail-value {
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.result-actions {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
    align-items: center;
}

.action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    min-width: 160px;
    justify-content: center;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.download-btn {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
}

.download-btn:hover {
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.share-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    width: 120px !important;
    height: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
}

.share-btn:hover {
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.back-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.back-btn:hover {
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-icon-svg {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

/* Feedback Messages */
.feedback {
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    display: none;
}

.feedback.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.feedback.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Responsive Design for Result Page */
@media (max-width: 768px) {
    .result-container {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .result-title {
        font-size: 2rem;
    }
    
    .result-actions {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .action-btn {
        width: 80px;
        height: 80px;
        min-width: 80px;
        max-width: 80px;
        padding: 20px;
        font-size: 0.9rem;
    }
}

/* Footer Styles */
.footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer p {
    margin: 0;
    color: #8b5cf6;
    font-size: 0.9rem;
    font-weight: 400;
}

.footer a {
    color: #8b5cf6;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
    border-bottom: 2px solid transparent;
}

.footer a:hover {
    color: #7c3aed;
    text-decoration: underline;
    transform: translateY(-1px);
    border-bottom: 2px solid #8b5cf6;
    text-shadow: 0 2px 8px rgba(139, 92, 246, 0.5);
}

/* Results page specific footer styling - white text */
body:has(.result-container) .footer p {
    color: white;
}

body:has(.result-container) .footer a {
    color: white;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.3);
}

body:has(.result-container) .footer a:hover {
    color: #f3f4f6;
    border-bottom: 2px solid white;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.5);
}

/* === Result action buttons styling === */
.result-actions .action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    width: 80px;
    height: 80px;
    min-width: 80px;
}

.result-actions .btn-icon-svg {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

/* keep layout tidy */
.result-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

/* Force crop buttons to be square, not circular, on mobile */
@media screen and (max-width: 768px) {
    .cropper-reset,
    .cropper-apply {
        width: 140px !important;
        height: 50px !important;
        min-width: 140px !important;
        min-height: 50px !important;
        border-radius: 8px !important; /* keeps them rectangular */
        padding: 12px 16px !important;
        font-size: 0.9rem !important;
        display: inline-flex;
        justify-content: center;
        align-items: center;
    }
}

/* Mobile result actions layout */
.result-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.result-actions .action-btn {
    flex: 0 0 auto;
}

/* Center crop view on mobile */
@media screen and (max-width: 768px) {
    .cropper-container {
        margin: 0 auto !important;
        padding: 0 10px;
        text-align: center;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .cropper-canvas {
        margin: 0 auto !important;
        display: block !important;
        max-width: calc(100vw - 20px);
        width: auto !important;
        height: auto !important;
    }
    
    .cropper-controls {
        justify-content: center !important;
        margin: 15px auto !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;
        flex-wrap: nowrap !important;
        width: 100%;
        max-width: 300px;
    }
    
    .cropper-controls .btn {
        flex: 1 1 auto;
        min-width: 120px;
        font-size: 14px;
        padding: 12px 8px;
    }
    
    .cropper-info {
        text-align: center !important;
        margin: 10px auto !important;
        font-size: 14px;
        padding: 0 10px;
    }
}

/* Dynamic Style-Based Loading Animations */

/* Business Professional - Corporate Grid Pattern */
.generation-overlay.business-style {
    background: linear-gradient(135deg, 
        rgba(30, 41, 59, 0.95) 0%, 
        rgba(51, 65, 85, 0.9) 50%, 
        rgba(30, 41, 59, 0.95) 100%);
    background-size: 200% 200%;
    animation: corporateShift 6s ease-in-out infinite;
}

.generation-overlay.business-style::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 8s linear infinite;
    z-index: -1;
}

.spinner.business-style {
    width: 140px;
    height: 140px;
}

.spinner.business-style::before {
    border: 4px solid transparent;
    border-top: 4px solid #3b82f6;
    border-right: 4px solid #1e40af;
    animation: businessSpin 2.5s ease-in-out infinite;
}

.spinner.business-style::after {
    border: 3px solid transparent;
    border-bottom: 3px solid #60a5fa;
    border-left: 3px solid #2563eb;
    animation: businessSpin 2s ease-in-out infinite reverse;
}

.spinner.business-style .inner-dot {
    background: linear-gradient(45deg, #3b82f6, #1e40af);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.8);
    animation: businessPulse 1.2s ease-in-out infinite;
}

/* Smart Casual - Flowing Waves */
.generation-overlay.casual-style {
    background: linear-gradient(45deg, 
        rgba(16, 185, 129, 0.1) 0%, 
        rgba(34, 197, 94, 0.15) 25%, 
        rgba(59, 130, 246, 0.1) 50%, 
        rgba(139, 92, 246, 0.15) 75%, 
        rgba(16, 185, 129, 0.1) 100%);
    background-size: 400% 400%;
    animation: casualFlow 10s ease-in-out infinite;
}

.spinner.casual-style {
    width: 130px;
    height: 130px;
}

.spinner.casual-style::before {
    border: 4px solid transparent;
    border-top: 4px solid #10b981;
    border-right: 4px solid #22c55e;
    animation: casualWave 3s ease-in-out infinite;
    border-radius: 60% 40% 40% 60%;
}

.spinner.casual-style::after {
    border: 3px solid transparent;
    border-bottom: 3px solid #34d399;
    border-left: 3px solid #059669;
    animation: casualWave 2.2s ease-in-out infinite reverse;
    border-radius: 40% 60% 60% 40%;
}

.spinner.casual-style .inner-dot {
    background: linear-gradient(45deg, #10b981, #22c55e);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.7);
    animation: casualBounce 1.5s ease-in-out infinite;
}

/* Elegant Evening - Luxury Shimmer */
.generation-overlay.elegant-style {
    background: linear-gradient(135deg, 
        rgba(17, 24, 39, 0.95) 0%, 
        rgba(55, 65, 81, 0.9) 25%, 
        rgba(75, 85, 99, 0.85) 50%, 
        rgba(55, 65, 81, 0.9) 75%, 
        rgba(17, 24, 39, 0.95) 100%);
    background-size: 300% 300%;
    animation: elegantShimmer 8s ease-in-out infinite;
}

.generation-overlay.elegant-style::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 215, 0, 0.1) 0%, transparent 50%);
    animation: goldSparkle 6s ease-in-out infinite;
    z-index: -1;
}

.spinner.elegant-style {
    width: 150px;
    height: 150px;
}

.spinner.elegant-style::before {
    border: 5px solid transparent;
    border-top: 5px solid #ffd700;
    border-right: 5px solid #ffed4e;
    animation: elegantRotate 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.spinner.elegant-style::after {
    border: 4px solid transparent;
    border-bottom: 4px solid #fbbf24;
    border-left: 4px solid #f59e0b;
    animation: elegantRotate 2.5s ease-in-out infinite reverse;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.4));
}

.spinner.elegant-style .inner-dot {
    background: linear-gradient(45deg, #ffd700, #fbbf24);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.9);
    animation: elegantGlow 1.8s ease-in-out infinite;
}

/* Athletic Sportswear - Energy Burst */
.generation-overlay.athletic-style {
    background: linear-gradient(45deg, 
        rgba(239, 68, 68, 0.1) 0%, 
        rgba(249, 115, 22, 0.15) 25%, 
        rgba(245, 158, 11, 0.1) 50%, 
        rgba(239, 68, 68, 0.15) 75%, 
        rgba(249, 115, 22, 0.1) 100%);
    background-size: 400% 400%;
    animation: energyBurst 4s ease-in-out infinite;
}

.spinner.athletic-style {
    width: 120px;
    height: 120px;
}

.spinner.athletic-style::before {
    border: 4px solid transparent;
    border-top: 4px solid #ef4444;
    border-right: 4px solid #f97316;
    animation: athleticSpin 1.5s linear infinite;
    transform-origin: center;
}

.spinner.athletic-style::after {
    border: 3px solid transparent;
    border-bottom: 3px solid #fb923c;
    border-left: 3px solid #dc2626;
    animation: athleticSpin 1.2s linear infinite reverse;
}

.spinner.athletic-style .inner-dot {
    background: linear-gradient(45deg, #ef4444, #f97316);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
    animation: athleticPump 0.8s ease-in-out infinite;
}

/* Vintage Classic - Retro Glow */
.generation-overlay.vintage-style {
    background: linear-gradient(135deg, 
        rgba(120, 53, 15, 0.9) 0%, 
        rgba(146, 64, 14, 0.85) 25%, 
        rgba(180, 83, 9, 0.8) 50%, 
        rgba(146, 64, 14, 0.85) 75%, 
        rgba(120, 53, 15, 0.9) 100%);
    background-size: 300% 300%;
    animation: vintageGlow 12s ease-in-out infinite;
}

.generation-overlay.vintage-style::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(251, 191, 36, 0.05) 2px,
        rgba(251, 191, 36, 0.05) 4px
    );
    animation: vintageLines 8s linear infinite;
    z-index: -1;
}

.spinner.vintage-style {
    width: 135px;
    height: 135px;
}

.spinner.vintage-style::before {
    border: 4px solid transparent;
    border-top: 4px solid #fbbf24;
    border-right: 4px solid #f59e0b;
    animation: vintageRotate 4s ease-in-out infinite;
    filter: sepia(0.3) contrast(1.2);
}

.spinner.vintage-style::after {
    border: 3px solid transparent;
    border-bottom: 3px solid #d97706;
    border-left: 3px solid #92400e;
    animation: vintageRotate 3.5s ease-in-out infinite reverse;
    filter: sepia(0.3) contrast(1.2);
}

.spinner.vintage-style .inner-dot {
    background: linear-gradient(45deg, #fbbf24, #d97706);
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.6);
    animation: vintageFlicker 2s ease-in-out infinite;
}

/* Creative Artist - Artistic Chaos */
.generation-overlay.creative-style {
    background: linear-gradient(45deg, 
        rgba(168, 85, 247, 0.1) 0%, 
        rgba(236, 72, 153, 0.15) 20%, 
        rgba(59, 130, 246, 0.1) 40%, 
        rgba(16, 185, 129, 0.15) 60%, 
        rgba(245, 158, 11, 0.1) 80%, 
        rgba(168, 85, 247, 0.15) 100%);
    background-size: 500% 500%;
    animation: artisticChaos 6s ease-in-out infinite;
}

.spinner.creative-style {
    width: 140px;
    height: 140px;
}

.spinner.creative-style::before {
    border: 4px solid transparent;
    border-top: 4px solid #a855f7;
    border-right: 4px solid #ec4899;
    animation: creativeWobble 2.8s ease-in-out infinite;
    border-radius: 30% 70% 70% 30%;
}

.spinner.creative-style::after {
    border: 3px solid transparent;
    border-bottom: 3px solid #3b82f6;
    border-left: 3px solid #10b981;
    animation: creativeWobble 2.3s ease-in-out infinite reverse;
    border-radius: 70% 30% 30% 70%;
}

.spinner.creative-style .inner-dot {
    background: linear-gradient(45deg, #a855f7, #ec4899, #3b82f6, #10b981);
    background-size: 200% 200%;
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.7);
    animation: creativeRainbow 1.5s ease-in-out infinite;
}

/* Summer Beach - Ocean Waves */
.generation-overlay.beach-style {
    background: linear-gradient(45deg, 
        rgba(6, 182, 212, 0.1) 0%, 
        rgba(14, 165, 233, 0.15) 25%, 
        rgba(59, 130, 246, 0.1) 50%, 
        rgba(14, 165, 233, 0.15) 75%, 
        rgba(6, 182, 212, 0.1) 100%);
    background-size: 400% 400%;
    animation: oceanWave 8s ease-in-out infinite;
}

.generation-overlay.beach-style::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(6, 182, 212, 0.1) 0%, transparent 70%);
    animation: waveRipple 4s ease-in-out infinite;
    z-index: -1;
}

.spinner.beach-style {
    width: 125px;
    height: 125px;
}

.spinner.beach-style::before {
    border: 4px solid transparent;
    border-top: 4px solid #06b6d4;
    border-right: 4px solid #0ea5e9;
    animation: beachFlow 3.5s ease-in-out infinite;
    border-radius: 50% 40% 50% 40%;
}

.spinner.beach-style::after {
    border: 3px solid transparent;
    border-bottom: 3px solid #0284c7;
    border-left: 3px solid #0369a1;
    animation: beachFlow 2.8s ease-in-out infinite reverse;
    border-radius: 40% 50% 40% 50%;
}

.spinner.beach-style .inner-dot {
    background: linear-gradient(45deg, #06b6d4, #0ea5e9);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.8);
    animation: beachBubble 1.8s ease-in-out infinite;
}

/* Winter Cozy - Snowfall Effect */
.generation-overlay.winter-style {
    background: linear-gradient(135deg, 
        rgba(71, 85, 105, 0.9) 0%, 
        rgba(100, 116, 139, 0.85) 25%, 
        rgba(148, 163, 184, 0.8) 50%, 
        rgba(100, 116, 139, 0.85) 75%, 
        rgba(71, 85, 105, 0.9) 100%);
    background-size: 300% 300%;
    animation: winterChill 10s ease-in-out infinite;
}

.generation-overlay.winter-style::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.4), transparent);
    background-repeat: repeat;
    background-size: 100px 100px;
    animation: snowfall 8s linear infinite;
    z-index: -1;
}

.spinner.winter-style {
    width: 130px;
    height: 130px;
}

.spinner.winter-style::before {
    border: 4px solid transparent;
    border-top: 4px solid #e2e8f0;
    border-right: 4px solid #cbd5e1;
    animation: winterSpin 3.2s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(226, 232, 240, 0.5));
}

.spinner.winter-style::after {
    border: 3px solid transparent;
    border-bottom: 3px solid #94a3b8;
    border-left: 3px solid #64748b;
    animation: winterSpin 2.7s ease-in-out infinite reverse;
    filter: drop-shadow(0 0 6px rgba(148, 163, 184, 0.4));
}

.spinner.winter-style .inner-dot {
    background: linear-gradient(45deg, #e2e8f0, #cbd5e1);
    box-shadow: 0 0 30px rgba(226, 232, 240, 0.8);
    animation: winterGlow 2.2s ease-in-out infinite;
}

/* Horror Theme - Dark Energy */
.generation-overlay.horror-style {
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.95) 0%, 
        rgba(30, 41, 59, 0.9) 25%, 
        rgba(51, 65, 85, 0.85) 50%, 
        rgba(30, 41, 59, 0.9) 75%, 
        rgba(15, 23, 42, 0.95) 100%);
    background-size: 400% 400%;
    animation: horrorPulse 5s ease-in-out infinite;
}

.generation-overlay.horror-style::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 20%, rgba(220, 38, 38, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(153, 27, 27, 0.1) 0%, transparent 50%);
    animation: horrorFlicker 3s ease-in-out infinite;
    z-index: -1;
}

.spinner.horror-style {
    width: 145px;
    height: 145px;
}

.spinner.horror-style::before {
    border: 4px solid transparent;
    border-top: 4px solid #dc2626;
    border-right: 4px solid #991b1b;
    animation: horrorTwist 2.5s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(220, 38, 38, 0.7));
}

.spinner.horror-style::after {
    border: 3px solid transparent;
    border-bottom: 3px solid #7f1d1d;
    border-left: 3px solid #450a0a;
    animation: horrorTwist 2s ease-in-out infinite reverse;
    filter: drop-shadow(0 0 10px rgba(127, 29, 29, 0.5));
}

/* Keyframe Animations for Dynamic Style-Based Loading */

/* Business Professional Animations */
@keyframes corporateShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

@keyframes businessSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes businessPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.8; }
}

/* Smart Casual Animations */
@keyframes casualFlow {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
}

@keyframes casualWave {
    0% { transform: rotate(0deg) scale(1); border-radius: 60% 40% 40% 60%; }
    25% { transform: rotate(90deg) scale(1.05); border-radius: 40% 60% 60% 40%; }
    50% { transform: rotate(180deg) scale(1.1); border-radius: 60% 40% 40% 60%; }
    75% { transform: rotate(270deg) scale(1.05); border-radius: 40% 60% 60% 40%; }
    100% { transform: rotate(360deg) scale(1); border-radius: 60% 40% 40% 60%; }
}

@keyframes casualBounce {
    0%, 100% { transform: scale(1) translateY(0); }
    25% { transform: scale(1.1) translateY(-5px); }
    50% { transform: scale(1.2) translateY(-10px); }
    75% { transform: scale(1.1) translateY(-5px); }
}

/* Elegant Evening Animations */
@keyframes elegantShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes goldSparkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.2); }
}

@keyframes elegantRotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes elegantGlow {
    0%, 100% { transform: scale(1); box-shadow: 0 0 40px rgba(255, 215, 0, 0.9); }
    50% { transform: scale(1.2); box-shadow: 0 0 60px rgba(255, 215, 0, 1); }
}

/* Athletic Sportswear Animations */
@keyframes energyBurst {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
}

@keyframes athleticSpin {
    0% { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(360deg) scale(1); }
}

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

/* Vintage Classic Animations */
@keyframes vintageGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes vintageLines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

@keyframes vintageRotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes vintageFlicker {
    0%, 100% { opacity: 1; transform: scale(1); }
    25% { opacity: 0.8; transform: scale(1.1); }
    50% { opacity: 0.9; transform: scale(1.2); }
    75% { opacity: 0.7; transform: scale(1.1); }
}

/* Creative Artist Animations */
@keyframes artisticChaos {
    0%, 100% { background-position: 0% 50%; }
    20% { background-position: 100% 0%; }
    40% { background-position: 0% 100%; }
    60% { background-position: 100% 50%; }
    80% { background-position: 50% 0%; }
}

@keyframes creativeWobble {
    0% { transform: rotate(0deg) scale(1); border-radius: 30% 70% 70% 30%; }
    25% { transform: rotate(90deg) scale(1.1); border-radius: 70% 30% 30% 70%; }
    50% { transform: rotate(180deg) scale(1.2); border-radius: 50% 50% 50% 50%; }
    75% { transform: rotate(270deg) scale(1.1); border-radius: 30% 70% 70% 30%; }
    100% { transform: rotate(360deg) scale(1); border-radius: 70% 30% 30% 70%; }
}

@keyframes creativeRainbow {
    0%, 100% { background-position: 0% 50%; transform: scale(1); }
    50% { background-position: 100% 50%; transform: scale(1.3); }
}

/* Summer Beach Animations */
@keyframes oceanWave {
    0%, 100% { background-position: 0% 50%; }
    25% { background-position: 100% 0%; }
    50% { background-position: 100% 100%; }
    75% { background-position: 0% 100%; }
}

@keyframes waveRipple {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.5); opacity: 0.1; }
}

@keyframes beachFlow {
    0% { transform: rotate(0deg) scale(1); border-radius: 50% 40% 50% 40%; }
    25% { transform: rotate(90deg) scale(1.05); border-radius: 40% 50% 40% 50%; }
    50% { transform: rotate(180deg) scale(1.1); border-radius: 50% 40% 50% 40%; }
    75% { transform: rotate(270deg) scale(1.05); border-radius: 40% 50% 40% 50%; }
    100% { transform: rotate(360deg) scale(1); border-radius: 50% 40% 50% 40%; }
}

@keyframes beachBubble {
    0%, 100% { transform: scale(1) translateY(0); }
    50% { transform: scale(1.2) translateY(-8px); }
}

/* Winter Cozy Animations */
@keyframes winterChill {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes snowfall {
    0% { transform: translateY(0); }
    100% { transform: translateY(100px); }
}

@keyframes winterSpin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

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

/* Horror Theme Animations */
@keyframes horrorPulse {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes horrorFlicker {
    0%, 100% { opacity: 0.1; }
    10% { opacity: 0.3; }
    20% { opacity: 0.1; }
    30% { opacity: 0.4; }
    40% { opacity: 0.1; }
    50% { opacity: 0.2; }
    60% { opacity: 0.1; }
    70% { opacity: 0.3; }
    80% { opacity: 0.1; }
    90% { opacity: 0.2; }
}

@keyframes horrorTwist {
    0% { transform: rotate(0deg) scale(1) skew(0deg); }
    25% { transform: rotate(90deg) scale(1.1) skew(5deg); }
    50% { transform: rotate(180deg) scale(1.2) skew(0deg); }
    75% { transform: rotate(270deg) scale(1.1) skew(-5deg); }
    100% { transform: rotate(360deg) scale(1) skew(0deg); }
}

@keyframes horrorBeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
    75% { transform: scale(1.4); }
}

/* Advanced Futuristic Loading Effects */
.generation-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(0,0,0,0.1) 100%);
    animation: pulseOverlay 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

.generation-overlay::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    margin: -150px 0 0 -150px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    animation: expandRing 4s ease-out infinite;
    pointer-events: none;
    z-index: 1;
}

/* Floating particles for futuristic effect */
.generation-overlay .floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
}

.generation-overlay .particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255,255,255,0.6);
    border-radius: 50%;
    animation: floatParticle 6s linear infinite;
}

.generation-overlay .particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.generation-overlay .particle:nth-child(2) { left: 20%; animation-delay: 1s; }
.generation-overlay .particle:nth-child(3) { left: 30%; animation-delay: 2s; }
.generation-overlay .particle:nth-child(4) { left: 40%; animation-delay: 3s; }
.generation-overlay .particle:nth-child(5) { left: 50%; animation-delay: 4s; }
.generation-overlay .particle:nth-child(6) { left: 60%; animation-delay: 5s; }
.generation-overlay .particle:nth-child(7) { left: 70%; animation-delay: 0.5s; }
.generation-overlay .particle:nth-child(8) { left: 80%; animation-delay: 1.5s; }
.generation-overlay .particle:nth-child(9) { left: 90%; animation-delay: 2.5s; }

/* Holographic scan lines */
.generation-overlay .scan-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        transparent 0%,
        rgba(0,255,255,0.03) 50%,
        transparent 100%
    );
    background-size: 100% 4px;
    animation: scanLines 2s linear infinite;
    pointer-events: none;
    z-index: 3;
}

/* Style-specific particle colors and effects */
.generation-overlay.business-style .particle {
    background: rgba(59, 130, 246, 0.8);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
}

.generation-overlay.casual-style .particle {
    background: rgba(34, 197, 94, 0.8);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.generation-overlay.elegant-style .particle {
    background: rgba(168, 85, 247, 0.8);
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.6);
}

.generation-overlay.athletic-style .particle {
    background: rgba(249, 115, 22, 0.8);
    box-shadow: 0 0 6px rgba(249, 115, 22, 0.6);
    animation: energeticFloat 4s ease-in-out infinite;
}

.generation-overlay.vintage-style .particle {
    background: rgba(180, 83, 9, 0.8);
    box-shadow: 0 0 6px rgba(180, 83, 9, 0.6);
}

.generation-overlay.creative-style .particle {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    animation: colorShift 3s ease-in-out infinite, floatParticle 6s linear infinite;
}

.generation-overlay.beach-style .particle {
    background: rgba(6, 182, 212, 0.8);
    box-shadow: 0 0 6px rgba(6, 182, 212, 0.6);
}

.generation-overlay.winter-style .particle {
    background: rgba(219, 234, 254, 0.9);
    box-shadow: 0 0 8px rgba(219, 234, 254, 0.7);
    animation: snowfall 8s linear infinite;
}

.generation-overlay.horror-style .particle {
    background: rgba(220, 38, 38, 0.8);
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.8);
    animation: ominousFloat 5s ease-in-out infinite;
}

/* Advanced keyframe animations */
@keyframes pulseOverlay {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

@keyframes expandRing {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes scanLines {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100vh);
    }
}

@keyframes energeticFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    25% {
        transform: translateY(-20px) scale(1.2);
    }
    75% {
        transform: translateY(10px) scale(0.8);
    }
}

@keyframes colorShift {
    0% { filter: hue-rotate(0deg); }
    25% { filter: hue-rotate(90deg); }
    50% { filter: hue-rotate(180deg); }
    75% { filter: hue-rotate(270deg); }
    100% { filter: hue-rotate(360deg); }
}

@keyframes snowfall {
    0% {
        transform: translateY(-100px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

@keyframes ominousFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        filter: brightness(1);
    }
    50% {
        transform: translateY(-30px) scale(1.3);
        filter: brightness(1.5);
    }
}

/* Cropper mobile sanity fixes */
.cropper-container {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.cropper-canvas {
  display: block;
  max-width: 100%;
  height: auto !important;   /* keep aspect ratio; no stretching */
  margin: 0 auto !important; /* Center the canvas horizontally */
}

/* Keep the two buttons side-by-side and square on mobile */
.cropper-controls {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

@media (max-width: 768px) {
  .cropper-container {
    max-width: calc(100vw - 40px) !important;  /* Account for container margins */
    margin: 0 auto;
    box-sizing: border-box;
  }
  
  #cropperContainer {
    max-width: 100% !important;
    margin: 15px 0 !important;
    padding: 10px !important;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .cropper-container {
    max-width: calc(100vw - 20px) !important;  /* Even tighter on small screens */
    margin: 0 auto;
  }
  
  #cropperContainer {
    margin: 10px 0 !important;
    padding: 8px !important;
  }
  
  .cropper-controls { 
    gap: 8px !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .cropper-reset,
  .cropper-apply {
    flex: 1 1 auto !important;
    max-width: calc(50% - 4px) !important;  /* Split available width minus gap */
    width: auto !important;
    min-width: 100px !important;
    height: 44px !important;
    border-radius: 6px !important;
    padding: 8px 12px !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    box-sizing: border-box !important;
  }
}

/* Result Page Loading Overlay Styles */
.result-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8fafc; /* Match the result page background */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.result-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.result-loading-content {
    text-align: center;
    color: #374151; /* Dark text for light background */
    position: relative;
    z-index: 2;
}

.result-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}

.result-spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: resultSpinnerRotate 2s linear infinite;
}

.result-spinner-ring:nth-child(1) {
    border-top-color: rgba(103, 126, 234, 0.9); /* Use theme colors for visibility */
    animation-duration: 1.5s;
}

.result-spinner-ring:nth-child(2) {
    border-right-color: rgba(118, 75, 162, 0.6);
    animation-duration: 2s;
    animation-direction: reverse;
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
}

.result-spinner-ring:nth-child(3) {
    border-bottom-color: rgba(103, 126, 234, 0.3);
    animation-duration: 2.5s;
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
}

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

.result-loading-text h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: resultFadeInUp 0.8s ease forwards 0.3s;
}

.result-loading-text p {
    font-size: 1rem;
    opacity: 0.8;
    margin: 0;
    opacity: 0;
    animation: resultFadeInUp 0.8s ease forwards 0.6s;
    transition: opacity 0.3s ease;
}

.result-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.result-particles::before,
.result-particles::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: resultFloatParticles 4s ease-in-out infinite;
}

.result-particles::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.result-particles::after {
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

@keyframes resultFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes resultFloatParticles {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.8;
    }
}

/* Result Container Smooth Entrance */
.result-container {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent; /* Let body background show through */
    min-height: 100vh; /* Ensure full height coverage */
    position: relative;
    z-index: 1; /* Ensure it's above any background elements */
}

.result-container.loaded {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.result-image-container {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.result-image-container.loaded {
    opacity: 1;
    transform: translateY(0);
}

.result-actions {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.result-actions.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced Style-Specific Spinner Animations */

/* Enhanced Keyframe Animations for Each Style */

/* Business Professional Animations */
@keyframes businessRotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

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

@keyframes businessOrbit {
    0% { transform: rotate(0deg) translateX(40px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(40px) rotate(-360deg); }
}

/* Smart Casual Animations */
/* Removed duplicate keyframes that were overriding original animations */

/* Athletic Sportswear Animations */
@keyframes athleticBurst {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.3) rotate(90deg); }
    50% { transform: scale(0.8) rotate(180deg); }
    75% { transform: scale(1.2) rotate(270deg); }
}

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

@keyframes athleticSprint {
    0% { transform: translateX(-60px) scale(0.5); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(60px) scale(1.5); opacity: 0; }
}

/* Vintage Classic Animations */
@keyframes vintageClockwork {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes vintageGear {
    0% { transform: rotate(0deg) translateX(45px) rotate(0deg); }
    100% { transform: rotate(360deg) translateX(45px) rotate(-360deg); }
}

/* Creative Artist Animations */
@keyframes creativeSwirl {
    0%, 100% { transform: rotate(0deg) scale(1); }
    33% { transform: rotate(120deg) scale(1.2); }
    66% { transform: rotate(240deg) scale(0.8); }
}

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

@keyframes creativeSplash {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { transform: scale(1.5) rotate(180deg); opacity: 1; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

/* Summer Beach Animations */
@keyframes beachWave {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(180deg); }
}

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

@keyframes beachFlow {
    0% { transform: translateX(-50px) rotate(0deg); }
    50% { transform: translateX(0) rotate(180deg); }
    100% { transform: translateX(50px) rotate(360deg); }
}

/* Cozy Winter Animations */
@keyframes winterDrift {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    50% { transform: rotate(180deg) translateY(-10px); }
}

@keyframes winterSparkle {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* Background Animation Keyframes */
@keyframes businessFlow {
    0%, 100% { transform: translateX(0) scale(1); }
    50% { transform: translateX(10px) scale(1.02); }
}

/* Removed duplicate keyframes that were overriding original animations */

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

@keyframes vintageGlow {
    0%, 100% { filter: brightness(1) hue-rotate(0deg); }
    50% { filter: brightness(1.1) hue-rotate(10deg); }
}

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

@keyframes beachWave {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(5px) translateY(-3px); }
    75% { transform: translateX(-5px) translateY(3px); }
}

@keyframes winterDrift {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.01); }
}

@keyframes horrorFlicker {
    0%, 100% { opacity: 0.05; }
    10%, 20%, 30%, 40% { opacity: 0.1; }
    15%, 25%, 35% { opacity: 0.03; }
    50% { opacity: 0.08; }
}

@keyframes winterSnowfall {
    0% { transform: translateY(-30px) rotate(0deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(30px) rotate(360deg); opacity: 0; }
}

/* Horror Theme Animations */
@keyframes horrorThrob {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes horrorPulse {
    0%, 100% { 
        box-shadow: 0 0 25px rgba(220, 38, 38, 0.8);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 50px rgba(220, 38, 38, 1);
        transform: scale(1.1);
    }
}

@keyframes horrorFlicker {
    0%, 100% { opacity: 1; }
    25% { opacity: 0.3; }
    50% { opacity: 1; }
    75% { opacity: 0.6; }
}

/* Style-Specific Visual Effects */

/* Business Professional Effects */
.business-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.floating-document {
    position: absolute;
    font-size: 24px;
    animation: businessFloat 4s ease-in-out infinite;
    opacity: 0.7;
}

.floating-document:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.floating-document:nth-child(2) { top: 60%; right: 15%; animation-delay: 1s; }
.floating-document:nth-child(3) { bottom: 30%; left: 20%; animation-delay: 2s; }
.floating-document:nth-child(4) { top: 40%; right: 25%; animation-delay: 3s; }

@keyframes businessFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* Smart Casual Effects */
.casual-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.floating-casual {
    position: absolute;
    font-size: 22px;
    animation: casualDrift 5s ease-in-out infinite;
    opacity: 0.6;
}

.floating-casual:nth-child(1) { top: 15%; left: 15%; animation-delay: 0s; }
.floating-casual:nth-child(2) { top: 70%; right: 10%; animation-delay: 1.5s; }
.floating-casual:nth-child(3) { bottom: 25%; left: 25%; animation-delay: 3s; }
.floating-casual:nth-child(4) { top: 45%; right: 30%; animation-delay: 4.5s; }

@keyframes casualDrift {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-10px) translateX(5px); }
    75% { transform: translateY(10px) translateX(-5px); }
}

/* Elegant Evening Effects */
.elegant-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.floating-sparkle {
    position: absolute;
    font-size: 20px;
    animation: elegantSparkle 3s ease-in-out infinite;
    opacity: 0.8;
}

.floating-sparkle:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.floating-sparkle:nth-child(2) { top: 50%; right: 15%; animation-delay: 0.8s; }
.floating-sparkle:nth-child(3) { bottom: 20%; left: 30%; animation-delay: 1.6s; }
.floating-sparkle:nth-child(4) { top: 30%; right: 25%; animation-delay: 2.4s; }

@keyframes elegantSparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.8; }
    50% { transform: scale(1.3) rotate(180deg); opacity: 1; }
}

/* Athletic Sportswear Effects */
.athletic-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.floating-energy {
    position: absolute;
    font-size: 26px;
    animation: athleticBurst 2s ease-in-out infinite;
    opacity: 0.9;
}

.floating-energy:nth-child(1) { top: 25%; left: 10%; animation-delay: 0s; }
.floating-energy:nth-child(2) { top: 65%; right: 20%; animation-delay: 0.5s; }
.floating-energy:nth-child(3) { bottom: 35%; left: 15%; animation-delay: 1s; }
.floating-energy:nth-child(4) { top: 40%; right: 10%; animation-delay: 1.5s; }

@keyframes athleticBurst {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.4) rotate(90deg); }
    50% { transform: scale(0.8) rotate(180deg); }
    75% { transform: scale(1.2) rotate(270deg); }
}

/* Vintage Classic Effects */
.vintage-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.floating-vintage {
    position: absolute;
    font-size: 24px;
    animation: vintageSwing 6s ease-in-out infinite;
    opacity: 0.7;
}

.floating-vintage:nth-child(1) { top: 20%; left: 25%; animation-delay: 0s; }
.floating-vintage:nth-child(2) { top: 55%; right: 20%; animation-delay: 1.5s; }
.floating-vintage:nth-child(3) { bottom: 30%; left: 15%; animation-delay: 3s; }
.floating-vintage:nth-child(4) { top: 35%; right: 30%; animation-delay: 4.5s; }

@keyframes vintageSwing {
    0%, 100% { transform: rotate(-5deg) translateY(0); }
    50% { transform: rotate(5deg) translateY(-15px); }
}

/* Creative Artist Effects */
.creative-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.floating-art {
    position: absolute;
    font-size: 28px;
    animation: creativeSplash 4s ease-in-out infinite;
    opacity: 0.8;
}

.floating-art:nth-child(1) { top: 15%; left: 20%; animation-delay: 0s; }
.floating-art:nth-child(2) { top: 60%; right: 15%; animation-delay: 1s; }
.floating-art:nth-child(3) { bottom: 25%; left: 30%; animation-delay: 2s; }
.floating-art:nth-child(4) { top: 40%; right: 25%; animation-delay: 3s; }

@keyframes creativeSplash {
    0%, 100% { transform: scale(1) rotate(0deg); }
    33% { transform: scale(1.5) rotate(120deg); }
    66% { transform: scale(0.7) rotate(240deg); }
}

/* Summer Beach Effects */
.beach-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.floating-beach {
    position: absolute;
    font-size: 25px;
    animation: beachWave 5s ease-in-out infinite;
    opacity: 0.7;
}

.floating-beach:nth-child(1) { top: 10%; left: 15%; animation-delay: 0s; }
.floating-beach:nth-child(2) { top: 50%; right: 20%; animation-delay: 1.25s; }
.floating-beach:nth-child(3) { bottom: 20%; left: 25%; animation-delay: 2.5s; }
.floating-beach:nth-child(4) { top: 30%; right: 15%; animation-delay: 3.75s; }

@keyframes beachWave {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(10deg); }
}

/* Cozy Winter Effects */
.winter-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.floating-winter {
    position: absolute;
    font-size: 23px;
    animation: winterSnowfall 7s ease-in-out infinite;
    opacity: 0.8;
}

.floating-winter:nth-child(1) { top: 5%; left: 20%; animation-delay: 0s; }
.floating-winter:nth-child(2) { top: 45%; right: 25%; animation-delay: 1.75s; }
.floating-winter:nth-child(3) { bottom: 15%; left: 30%; animation-delay: 3.5s; }
.floating-winter:nth-child(4) { top: 25%; right: 15%; animation-delay: 5.25s; }

@keyframes winterSnowfall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(20px) rotate(360deg); opacity: 0; }
}

/* Enhanced Button Animations */
@keyframes activeButtonPulse {
    0%, 100% { 
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
        transform: translateY(-2px) scale(1.05);
    }
    50% { 
        box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
        transform: translateY(-3px) scale(1.08);
    }
}

@keyframes buttonGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.1); }
}

/* Style-Specific Button Themes */
.style-btn[data-style="professional_business"]:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.25);
}

.style-btn[data-style="smart_casual"]:hover {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #22c55e;
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.25);
}

.style-btn[data-style="elegant_evening"]:hover {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    border-color: #a855f7;
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.25);
}

.style-btn[data-style="sporty_athletic"]:hover {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    border-color: #f97316;
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.25);
}

.style-btn[data-style="vintage_classic"]:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #f59e0b;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.25);
}

.style-btn[data-style="creative_artist"]:hover {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    border-color: #ec4899;
    box-shadow: 0 8px 25px rgba(236, 72, 153, 0.25);
}

.style-btn[data-style="beach_summer"]:hover {
    background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
    border-color: #06b6d4;
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.25);
}

.style-btn[data-style="winter_cozy"]:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #64748b;
    box-shadow: 0 8px 25px rgba(100, 116, 139, 0.25);
}

.style-btn[data-style="horror"]:hover {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: #dc2626;
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.25);
}

/* Horror Theme Effects */
.horror-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.floating-horror {
    position: absolute;
    font-size: 24px;
    animation: horrorHaunt 4s ease-in-out infinite;
    opacity: 0.6;
}

.floating-horror:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.floating-horror:nth-child(2) { top: 60%; right: 15%; animation-delay: 1s; }
.floating-horror:nth-child(3) { bottom: 30%; left: 25%; animation-delay: 2s; }
.floating-horror:nth-child(4) { top: 35%; right: 20%; animation-delay: 3s; }

@keyframes horrorHaunt {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.6; }
    25% { transform: translateY(-15px) scale(1.1); opacity: 0.3; }
    50% { transform: translateY(-5px) scale(0.9); opacity: 0.8; }
    75% { transform: translateY(-10px) scale(1.05); opacity: 0.4; }
}

/* Registration Page Styles */
.registration-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.registration-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 500px;
    width: 100%;
    animation: slideInUp 0.6s ease-out;
}

.registration-header {
    text-align: center;
    margin-bottom: 30px;
}

.registration-logo {
    width: 80px;
    height: auto;
    margin-bottom: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    object-fit: contain;
}

.registration-header h1 {
    color: #333;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

.registration-header p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

.registration-form-container {
    width: 100%;
}

.registration-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input {
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-group input::placeholder {
    color: #999;
}

.checkbox-group {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.terms-link, .privacy-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.terms-link:hover, .privacy-link:hover {
    text-decoration: underline;
}

.registration-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.registration-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

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

.registration-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-loader .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.registration-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.registration-footer p {
    color: #666;
    margin: 0;
}

/* User Info and Logout Styles */
.user-info {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
}

.welcome-text {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.logout-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    color: white;
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
}

.notification {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    border-left: 4px solid #e74c3c;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-error {
    border-left-color: #e74c3c;
}

.notification-success {
    border-left-color: #27ae60;
}

.notification-warning {
    border-left-color: #f39c12;
}

.notification-info {
    border-left-color: #3498db;
}

.notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
}

.notification-message {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
    margin-right: 10px;
}

.notification-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: #666;
}

/* Existing User Section */Styles */
.existing-user-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #e1e5e9;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
}

.existing-user-section h3 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

.existing-user-section p {
    color: #666;
    font-size: 14px;
    text-align: center;
    margin-bottom: 20px;
}

.existing-user-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.existing-user-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.existing-user-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

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

.existing-user-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Form Divider */
.form-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.form-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e1e5e9;
}

.form-divider span {
    background: rgba(255, 255, 255, 0.95);
    padding: 0 15px;
    color: #666;
    font-weight: 600;
    font-size: 14px;
    position: relative;
}

/* New User Section */
.new-user-section h3 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.login-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.login-link:hover {
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-body p {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.modal-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .registration-container {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .registration-header h1 {
        font-size: 24px;
    }
    
    .form-group input {
        padding: 12px;
        font-size: 16px;
    }
    
    .registration-btn {
        padding: 14px 20px;
    }
}

@media (max-width: 480px) {
    .registration-container {
        padding: 25px 15px;
    }
    
    .registration-logo {
        width: 60px;
        height: auto;
    }
    
    .registration-header h1 {
        font-size: 22px;
    }
    
    .checkbox-label {
        font-size: 13px;
    }
}
}