* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Source Sans 3', sans-serif;
    background: #0a0a14;
    color: #fff;
}

.title-font {
    font-family: 'Playfair Display', serif;
}

.app-bg {
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(139, 69, 19, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 0, 0, 0.1) 0%, transparent 40%),
        linear-gradient(180deg, #0a0a14 0%, #12121f 50%, #0a0a14 100%);
    min-height: 100vh;
}

.header-gradient {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    position: relative;
}

.header-gradient::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
}

.sparkles {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, rgba(255, 215, 0, 0.4), transparent),
        radial-gradient(2px 2px at 40% 70%, rgba(255, 215, 0, 0.3), transparent),
        radial-gradient(1px 1px at 90% 40%, rgba(255, 215, 0, 0.5), transparent),
        radial-gradient(2px 2px at 60% 20%, rgba(255, 215, 0, 0.3), transparent),
        radial-gradient(1px 1px at 80% 60%, rgba(255, 215, 0, 0.4), transparent);
    animation: sparkle 4s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.glass-card {
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 215, 0, 0.15);
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Upload Zone Styles */
.upload-zone {
    border: 3px dashed rgba(255, 215, 0, 0.4);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 215, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, transparent 50%, rgba(255, 215, 0, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-zone:hover {
    border-color: rgba(255, 215, 0, 0.7);
    background: rgba(255, 215, 0, 0.08);
    transform: translateY(-2px);
}

.upload-zone:hover::before {
    opacity: 1;
}

.upload-zone.dragging {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.uploaded-photo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.uploaded-photo-frame {
    position: relative;
    width: 200px;
    height: 200px;
    border: 4px solid #ffd700;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.3),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.3), inset 0 0 20px rgba(255, 215, 0, 0.1); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), inset 0 0 30px rgba(255, 215, 0, 0.2); }
}

.uploaded-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-success-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.5);
    animation: pop-in 0.3s ease-out;
}

@keyframes pop-in {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.remove-photo-btn {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.remove-photo-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.7);
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.celebrity-chip {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.celebrity-chip:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
}

.celebrity-chip.active {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #1a1a2e;
    border-color: transparent;
    font-weight: 600;
}

.scene-card {
    background: rgba(30, 30, 50, 0.5);
    border: 2px solid rgba(255, 215, 0, 0.2);
    border-radius: 1rem;
    padding: 1rem;
    text-align: center;
    color: #ffd700;
    transition: all 0.3s ease;
    cursor: pointer;
}

.scene-card:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateY(-4px);
}

.scene-card.active {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 170, 0, 0.2));
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.toggle-switch {
    width: 48px;
    height: 24px;
    background: rgba(100, 100, 100, 0.3);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.peer:checked ~ .toggle-switch {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
}

.peer:checked ~ .toggle-switch::after {
    transform: translateX(24px);
}

.accessory-btn {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.accessory-btn:hover {
    background: rgba(255, 215, 0, 0.2);
}

.accessory-btn.active {
    background: rgba(255, 215, 0, 0.3);
    border-color: #ffd700;
}

.prompt-card {
    background: 
        linear-gradient(rgba(26, 26, 46, 0.9), rgba(26, 26, 46, 0.9)),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(255, 215, 0, 0.02) 10px,
            rgba(255, 215, 0, 0.02) 20px
        );
    border: 2px solid transparent;
    border-image: linear-gradient(135deg, #ffd700, #8b4513, #ffd700) 1;
    position: relative;
}

.prompt-card::before,
.prompt-card::after {
    content: '✦';
    position: absolute;
    color: #ffd700;
    font-size: 1rem;
}

.prompt-card::before {
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
}

.prompt-card::after {
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
}

.generate-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 50%, #ffd700 100%);
    background-size: 200% 100%;
    color: #1a1a2e;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.generate-btn:hover:not(:disabled) {
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.3);
}

.generate-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.generate-btn.disabled-no-photo {
    background: linear-gradient(135deg, #666 0%, #444 50%, #666 100%);
    opacity: 0.6;
}

.shimmer-overlay {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(26, 26, 46, 0.3);
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top-color: #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.polaroid-frame {
    background: #fff;
    padding: 12px 12px 48px;
    max-width: 400px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(0, 0, 0, 0.1);
    transform: rotate(-1deg);
    transition: transform 0.3s ease;
}

.polaroid-frame:hover {
    transform: rotate(0deg) scale(1.02);
}

.polaroid-frame-large {
    background: #fff;
    padding: 16px 16px 64px;
    box-shadow: 
        0 8px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(0, 0, 0, 0.1);
}

.polaroid-caption {
    text-align: center;
    color: #333;
    padding-top: 12px;
    font-family: 'Playfair Display', serif;
}

.flash-overlay {
    position: absolute;
    inset: 0;
    background: white;
    animation: flash 0.5s ease-out forwards;
    pointer-events: none;
    z-index: 10;
}

@keyframes flash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.action-btn {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-2px);
}

.gallery-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.3) transparent;
}

.gallery-scroll::-webkit-scrollbar {
    height: 8px;
}

.gallery-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 4px;
}

.gallery-thumb-container {
    position: relative;
}

.gallery-thumb {
    width: 100px;
    height: 100px;
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.gallery-thumb:hover {
    border-color: #ffd700;
    transform: scale(1.05);
}

.gallery-thumb-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 0.5rem;
    color: white;
}

.gallery-delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-thumb-container:hover .gallery-delete-btn {
    opacity: 1;
}

.gallery-delete-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffd700' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

select option {
    background: #1a1a2e;
    color: white;
}

@media (max-width: 768px) {
    .title-font {
        font-size: 1.5rem;
    }
    
    .header-gradient h1 {
        font-size: 2rem !important;
    }
    
    .scene-card {
        padding: 0.75rem 0.5rem;
    }
    
    .scene-card span:first-child {
        font-size: 1.5rem;
    }
    
    .polaroid-frame {
        max-width: 100%;
    }
    
    .gallery-thumb {
        width: 80px;
        height: 80px;
    }
    
    .upload-zone {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .uploaded-photo-frame {
        width: 150px;
        height: 150px;
    }
    
    .celebrity-chip {
        padding: 0.375rem 0.75rem;
        font-size: 0.8rem;
    }
}