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

:root {
    --primary: #1a1a1a;
    --accent: #C9A95F;
    --accent-light: #D4B574;
    --surface: #2a2a2a;
    --surface-light: #3a3a3a;
    --background: #0f0f0f;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --error: #ff4757;
    --success: #2ecc71;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    background-image: radial-gradient(circle at 20% 50%, rgba(201, 169, 95, 0.08) 0%, transparent 50%),
                      radial-gradient(circle at 80% 80%, rgba(201, 169, 95, 0.05) 0%, transparent 50%);
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 1.5rem;
    width: 100%;
}

/* Header - Inside Card */
#card-header {
    text-align: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(201, 169, 95, 0.1);
}

.logo-banner {
    font-size: 0.65rem;
    letter-spacing: 2.5px;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.main-title {
    font-size: 2.2rem;
    font-weight: 300;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    line-height: 1.1;
}

.subtitle {
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 0;
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
    line-height: 1.4;
}

/* Card - Sleek Premium */
.card {
    background: var(--primary);
    border-radius: 20px;
    padding: 2rem 1.8rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(201, 169, 95, 0.1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

/* Examples Section */
.examples-section {
    margin-bottom: 1.5rem;
}

.examples-label {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.example-carousel {
    position: relative;
    margin-bottom: 1rem;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(201, 169, 95, 0.3);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-btn.prev {
    left: 1rem;
}

.carousel-btn.next {
    right: 1rem;
}

.carousel-btn svg {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    border-color: var(--accent);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.example-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    background: var(--background);
}

.example-card img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 16px;
    display: block;
}

.toggle-container {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid rgba(201, 169, 95, 0.3);
}

.toggle-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.toggle-label.off {
    color: var(--text-secondary);
}

.toggle-label.on {
    color: var(--accent);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface);
    transition: 0.3s;
    border-radius: 24px;
    border: 2px solid rgba(201, 169, 95, 0.3);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--accent);
    border-color: var(--accent);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: var(--primary);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid rgba(201, 169, 95, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.2);
}

/* Upload CTA - Premium Button */
.upload-cta {
    text-align: center;
    padding: 1rem 0;
}

.upload-button {
    width: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    border: none;
    border-radius: 16px;
    padding: 1.5rem 2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    box-shadow: 0 8px 24px rgba(201, 169, 95, 0.3);
    position: relative;
    overflow: hidden;
}

.upload-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.upload-button:hover::before {
    left: 100%;
}

.upload-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(201, 169, 95, 0.4);
}

.upload-button:active {
    transform: translateY(-2px);
}

.upload-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
    pointer-events: none;
    flex-shrink: 0;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    pointer-events: none;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.upload-hint {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    margin: 1rem 0 0.5rem;
}

.upload-subtext {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.7;
}

/* Preview Section - Premium Feel */
.preview-section {
    text-align: center;
    margin-bottom: 0;
}

.preview-section img {
    max-width: 100%;
    max-height: 380px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.preview-section img.loading {
    opacity: 0.6;
    filter: blur(8px) brightness(0.95);
    animation: elegant-pulse 2s ease-in-out infinite;
    position: relative;
}

.preview-section img.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(201, 169, 95, 0.1) 50%, transparent 100%);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes elegant-pulse {
    0%, 100% {
        opacity: 0.6;
        filter: blur(8px) brightness(0.95);
    }
    50% {
        opacity: 0.5;
        filter: blur(10px) brightness(0.9);
    }
}

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

.button-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
}

/* Inline Error - Sophisticated */
.inline-error {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 71, 87, 0.2);
    border-left: 3px solid var(--error);
    border-radius: 8px;
    padding: 0.9rem 1.2rem;
    margin: 1rem 0;
    text-align: left;
    backdrop-filter: blur(10px);
}

.error-text {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
    letter-spacing: 0.2px;
}

/* Buttons - Luxury Style */
.btn-primary,
.btn-secondary {
    padding: 1rem 1.5rem;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    position: relative;
    border-radius: 12px;
    font-family: inherit;
}

#upload-section .btn-primary {
    margin-top: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: var(--primary);
    box-shadow: 0 8px 24px rgba(201, 169, 95, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(201, 169, 95, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: var(--surface-light);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary svg,
.btn-secondary svg {
    width: 20px;
    height: 20px;
}

.btn-loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
    margin-left: 0.5rem;
}

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

/* Loading Section */
#loading-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
    padding: 2rem 0;
    width: 100%;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 3px solid rgba(201, 169, 95, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-content h2 {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.loading-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Result Section */
#result-section {
    display: flex;
    flex-direction: column;
}

#result-heading {
    font-size: 1.5rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.result-container {
    margin: 1.2rem 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-container img {
    max-width: 100%;
    max-height: 380px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.result-subtext {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}

.action-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.action-buttons button {
    flex: 1;
    min-width: 140px;
    margin-top: 0;
    font-size: 0.85rem;
    padding: 0.9rem 1rem;
}

/* Error Section */
#error-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.error-card {
    text-align: center;
    width: 100%;
}

.error-icon {
    width: 60px;
    height: 60px;
    color: var(--error);
    margin-bottom: 1rem;
}

.error-card h2 {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--error);
    margin-bottom: 0.8rem;
}

#error-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.error-subtext {
    font-size: 0.85rem;
    color: var(--text-secondary);
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

/* Footer - Minimal Luxury */
footer {
    text-align: center;
    padding: 1.5rem 0 1rem;
    margin-top: 1rem;
}

.footer-content {
    background: transparent;
    color: var(--text-secondary);
    padding: 0;
    border: none;
}

.footer-tagline {
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 0.3rem;
    letter-spacing: 1px;
    font-weight: 500;
}

.footer-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    opacity: 0.8;
}

.footer-tech {
    font-size: 0.7rem;
    opacity: 0.5;
}

/* Responsive - Desktop gets more breathing room */
@media (min-width: 769px) {
    .container {
        padding: 2rem;
        max-width: 520px;
    }
    
    #card-header {
        margin-bottom: 2.5rem;
        padding-bottom: 2.5rem;
    }
    
    .card {
        padding: 2.8rem 2.5rem;
    }
    
    .main-title {
        font-size: 2.8rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .tagline {
        font-size: 0.85rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection styling */
::selection {
    background: rgba(201, 169, 95, 0.3);
    color: var(--text-primary);
}
