:root {
    --bg-gradient-start: #e8f4f8;
    --bg-gradient-end: #f5e6d3;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --accent: #74b9ff;
    --accent-hover: #0984e3;
    --success: #00b894;
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.12);
    --border-radius: 24px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Animated background elements */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #a29bfe, #74b9ff);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #fd79a8, #fdcb6e);
    bottom: -50px;
    left: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #55efc4, #81ecec);
    top: 50%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(30px, -30px) rotate(5deg);
    }

    50% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }

    75% {
        transform: translate(20px, 10px) rotate(3deg);
    }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 48px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--accent), #a29bfe);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: var(--shadow-soft);
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
    margin-top: 8px;
}

.main-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    padding: 48px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: all 0.4s ease;
}

.main-card:hover {
    box-shadow: var(--shadow-hover);
}

.upload-zone {
    border: 3px dashed rgba(116, 185, 255, 0.4);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(116, 185, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(116, 185, 255, 0.1);
    transform: scale(1.01);
}

.upload-zone.has-image {
    border: none;
    background: transparent;
    padding: 0;
    cursor: default;
    transform: none;
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.8;
}

.upload-text h3 {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.upload-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

#fileInput {
    display: none;
}

.preview-container {
    display: none;
    text-align: center;
}

.preview-container.visible {
    display: block;
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 20px;
}

.preview-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.options-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: none;
}

.options-section.visible {
    display: block;
}

.options-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-group label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent) 0%, #a29bfe 100%);
    opacity: 0.8;
    transition: opacity 0.3s;
}

.slider:hover {
    opacity: 1;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider-value {
    font-weight: 600;
    color: var(--accent-hover);
    min-width: 24px;
    text-align: center;
}

.btn {
    padding: 16px 32px;
    border-radius: 16px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    box-shadow: 0 4px 16px rgba(116, 185, 255, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(116, 185, 255, 0.5);
}

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

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent-hover);
}

/* Gallery Section */
.gallery-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: none;
}

.gallery-section.visible {
    display: block;
}

.gallery-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item .progress-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

.gallery-item .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    flex-direction: column;
    gap: 24px;
}

.loading-overlay.visible {
    display: flex;
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(116, 185, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.loading-subtext {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.feature {
    text-align: center;
    padding: 24px;
    background: var(--card-bg);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-soft);
}

.feature-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.feature h4 {
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 1rem;
}

.feature p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 500;
    z-index: 1001;
    opacity: 0;
    transition: all 0.4s ease;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    background: #d63031;
}

.toast.success {
    background: var(--success);
}

@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .main-card {
        padding: 32px 24px;
    }

    .upload-zone {
        padding: 40px 24px;
    }

    .upload-icon {
        font-size: 48px;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 14px 24px;
        width: 100%;
        justify-content: center;
    }

    .preview-actions {
        flex-direction: column;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}