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

body {
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    background: linear-gradient(to bottom, #ffffff, #f5f3ff);
    color: #333;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
}

.logo {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
}

nav {
    display: flex;
    gap: 24px;
}

.nav-link {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #333;
}

/* Main content */
main {
    text-align: center;
    padding-bottom: 20px;
}

.sparkle-container {
    display: flex;
    justify-content: center;
    margin: 48px 0;
}

.sparkle-icon {
    color: #F6C744;
}

.main-heading {
    font-size: 48px;
    font-weight: 700;
    color: #333;
    margin-bottom: 24px;
}

.subheading {
    font-size: 20px;
    color: #666;
    max-width: 800px;
    margin: 0 auto 40px;
}

/* Input section */
.input-container {
    display: flex;
    max-width: 800px;
    margin: 0 auto 16px;
}

.url-input {
    flex-grow: 1;
    height: 56px;
    padding: 0 16px;
    font-size: 16px;
    border: 1px solid #8b5cf6;
    border-right: none;
    border-radius: 6px 0 0 6px;
    outline: none;
}

.url-input:focus {
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.generate-button {
    height: 56px;
    padding: 0 24px;
    background-color: #8b5cf6;
    color: white;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.generate-button:hover {
    background-color: #7c3aed;
}

.free-text {
    color: #666;
    margin-bottom: 30px;
}

/* Settings toggle */
.settings-toggle-container {
    display: flex;
    justify-content: center;
    margin: 0 auto 24px;
}

.settings-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: white;
    border: 2px solid #8b5cf6;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #8b5cf6;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.settings-toggle:hover {
    background-color: #f5f0ff;
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.15);
}

.settings-toggle svg {
    transition: transform 0.3s ease;
}

.settings-toggle.active {
    background-color: #f5f0ff;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.settings-toggle.active svg {
    transform: rotate(180deg);
}

/* Hidden class */
.hidden {
    display: none;
}

/* Settings section */
.settings-container {
    max-width: 800px;
    margin: 0 auto 40px;
    background-color: #f8f7ff;
    border-radius: 16px;
    padding: 32px;
    text-align: left;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.settings-heading {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 28px;
    text-align: center;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}

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

.setting-label {
    font-size: 15px;
    font-weight: 600;
    color: #444;
}

/* Option buttons (for skin tone) */
.option-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hidden-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 14px;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #555;
}

.option-button:hover {
    background-color: #f5f3ff;
    border-color: #d8b4fe;
}

.option-button.selected, 
.option-button:has(input:checked) {
    background-color: #8b5cf6;
    border-color: #8b5cf6;
    color: white;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

/* Style buttons */
.style-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.style-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background-color: white;
    border: 2px solid #8b5cf6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #8b5cf6;
    min-width: 80px;
    text-align: center;
}

.style-name {
    font-size: 14px;
    color: inherit;
    transition: color 0.2s;
}

.style-button:hover {
    background-color: #f5f0ff;
    border-color: #7c3aed;
    color: #7c3aed;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.style-button.selected,
.style-button:has(input:checked) {
    background-color: #8b5cf6;
    border-color: #8b5cf6;
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

.style-button.selected:hover,
.style-button:has(input:checked):hover {
    background-color: #7c3aed;
    border-color: #7c3aed;
    color: white;
}

/* Simple style previews */
.flat-style {
    background-color: #f5f0ff;
}

.flat-style::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background-color: #d8b4fe;
    border-radius: 8px;
}

.outline-style {
    background-color: white;
}

.outline-style::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    border: 2px solid #8b5cf6;
    border-radius: 8px;
}

/* 3D style */
.threed-style {
    background-color: #f5f0ff;
    position: relative;
}

.threed-style::before {
    content: "";
    position: absolute;
    top: 40%;
    left: 40%;
    width: 50%;
    height: 50%;
    background-color: #a78bfa;
    border-radius: 6px;
    box-shadow: -4px 4px 0 0 #8b5cf6;
}

.isometric-style {
    background-color: white;
    position: relative;
    overflow: hidden;
}

.isometric-style::before, .isometric-style::after {
    content: "";
    position: absolute;
    background-color: #d8b4fe;
}

.isometric-style::before {
    width: 60%;
    height: 60%;
    top: 30%;
    left: 20%;
    transform: skew(-30deg, 15deg);
}

.isometric-style::after {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 30%;
    transform: skew(30deg, -15deg);
    background-color: #c4b5fd;
}

/* Doodle style */
.doodle-style {
    background-color: #fef3c7;
    position: relative;
}

.doodle-style::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background-color: #f59e0b;
    border-radius: 50% 20% 50% 20%;
    opacity: 0.8;
}

.doodle-style::after {
    content: "";
    position: absolute;
    top: 30%;
    left: 30%;
    width: 30%;
    height: 30%;
    background-color: #fbbf24;
    border-radius: 20% 50% 20% 50%;
    opacity: 0.6;
}

/* Ink style */
.ink-style {
    background-color: white;
    position: relative;
}

.ink-style::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background-color: #1f2937;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ink-style::after {
    content: "";
    position: absolute;
    top: 40%;
    left: 40%;
    width: 20%;
    height: 20%;
    background-color: #374151;
    border-radius: 2px;
}

/* Color controls */
.color-group {
    margin-top: 4px;
}

.color-controls {
    display: flex;
    gap: 16px;
}

.color-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.color-label {
    font-size: 13px;
    color: #666;
}

.color-picker {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-picker:hover {
    transform: scale(1.05);
}

/* Toggle switch */
.toggle-group {
    margin-top: 8px;
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e2e8f0;
    transition: .4s;
    border-radius: 34px;
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-input:checked + .toggle-label {
    background-color: #8b5cf6;
}

.toggle-input:checked + .toggle-label:before {
    transform: translateX(30px);
}

/* Background buttons */
.background-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.background-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.bg-preview {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
}

.background-button span {
    font-size: 13px;
    color: #555;
    transition: color 0.2s;
}

.background-button:hover .bg-preview {
    border-color: #d8b4fe;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.1);
}

.background-button.selected .bg-preview,
.background-button:has(input:checked) .bg-preview {
    border-color: #8b5cf6;
    border-width: 2px;
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.2);
}

.background-button.selected span,
.background-button:has(input:checked) span {
    color: #8b5cf6;
    font-weight: 500;
}

/* Simple background previews */
.transparent-bg {
    background-color: white;
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                      linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                      linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.white-bg {
    background-color: white;
}

.scene-bg {
    background-color: white;
    position: relative;
}

.scene-bg::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e2e8f0;
    box-shadow: 0 -8px 15px rgba(139, 92, 246, 0.1);
}

.scene-bg::before {
    content: "";
    position: absolute;
    width: 20%;
    height: 20%;
    bottom: 20%;
    right: 20%;
    border-radius: 50%;
    background-color: #f5f0ff;
}

/* Sample products section */
.sample-section {
    margin-bottom: 32px;
}

.sample-text {
    color: #666;
    margin-bottom: 16px;
}

.sample-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sample-button {
    padding: 8px 16px;
    background-color: #f1f5f9;
    border: none;
    border-radius: 9999px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.sample-button:hover {
    background-color: #e2e8f0;
}

/* Featured examples section */
.examples-heading {
    font-size: 36px;
    font-weight: 700;
    color: #333;
    margin-top: 80px;
    margin-bottom: 40px;
}

/* Infinite Scroll Gallery */
.infinite-scroll-gallery-container {
    margin: 40px 0 20px;
    overflow: hidden;
    position: relative;
    padding-top: 40px;
}

.infinite-scroll-gallery-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 600px;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(139, 92, 246, 0.3), transparent);
}

.gallery-heading {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.infinite-scroll-gallery {
    width: 100%;
    position: relative;
    padding: 10px 0;
    display: flex;
    align-items: center;
    overflow: hidden;
}

/* New ticker-based approach for reliable infinite scrolling */
.scroll-content {
    display: flex;
    position: relative;
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
}

.scroll-content-inner {
    display: inline-flex;
    animation: ticker 30s linear infinite;
    padding: 15px 0;
}

.scroll-content-inner:hover {
    animation-play-state: paused;
}

@keyframes ticker {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

.gallery-item {
    flex: 0 0 250px;
    aspect-ratio: 1;
    margin: 0 10px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.15);
}

.gallery-item a {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    position: relative;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transform: scale(1.03);
    transition: transform 0.3s ease;
    border-radius: 16px;
}

.gallery-item a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid rgba(139, 92, 246, 0.15);
    border-radius: 16px;
    pointer-events: none;
    transition: all 0.3s ease;
}

.gallery-item:hover a::after {
    border-color: rgba(139, 92, 246, 0.4);
    border-width: 4px;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.03);
}

/* Gallery Navigation Arrows */
.gallery-nav-arrow {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: white;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.gallery-nav-arrow:hover {
    background-color: #f5f0ff;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
    transform: scale(1.05);
}

.gallery-nav-arrow:active {
    transform: scale(0.95);
}

.gallery-prev {
    margin-right: 10px;
}

.gallery-next {
    margin-left: 10px;
}

@keyframes scrollImages {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-50% - 10px)); /* Half width plus half the gap */
    }
}

/* Pause animation on hover */
.infinite-scroll-gallery:hover .scroll-content {
    animation-play-state: paused;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-heading {
        font-size: 36px;
    }
    
    .subheading {
        font-size: 18px;
    }
    
    .input-container {
        flex-direction: column;
    }
    
    .url-input {
        border-right: 1px solid #8b5cf6;
        border-radius: 6px 6px 0 0;
    }
    
    .generate-button {
        border-radius: 0 0 6px 6px;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-container {
        padding: 20px;
    }
    
    .style-buttons,
    .background-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-item {
        flex: 0 0 180px;
        aspect-ratio: 1;
    }
    
    .gallery-nav-arrow {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .main-heading {
        font-size: 28px;
    }
    
    .sample-buttons {
        gap: 8px;
    }
    
    .option-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .option-button {
        width: 100%;
    }
    
    .gallery-item {
        flex: 0 0 140px;
        aspect-ratio: 1;
    }
    
    .gallery-nav-arrow {
        width: 36px;
        height: 36px;
    }
}

/* Google Sign-in Button */
.btn-google {
    background: #ffffff;
    color: #1c1c1e;
    border: 1px solid #dadce0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 12px;
    transition: all 150ms ease;
    cursor: pointer;
    width: 100%;
    justify-content: center;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #bdc1c6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-google:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.2);
    outline-offset: 2px;
}

/* Sign-in Alert Box Styles */
.signin-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.signin-alert-box {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
    max-width: 400px;
    width: 100%;
    animation: slideIn 0.2s ease-out;
}

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

.signin-alert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 0 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1.5rem;
}

.signin-alert-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1c1c1e;
}

.signin-alert-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #4b5563;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 150ms ease;
    line-height: 1;
}

.signin-alert-close:hover {
    background: #f1f5f9;
    color: #1c1c1e;
}

.signin-alert-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.signin-alert-content p {
    margin: 0 0 1.5rem 0;
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.5;
} 