:root {
    --primary: #818cf8;
    --primary-glow: rgba(129, 140, 248, 0.4);
    --accent: #c084fc;
    --bg-dark: #020617;
    --card-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --danger: #f43f5e;
    --success: #10b981;
    --font-main: 'Outfit', sans-serif;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1.5rem;
    overflow-x: hidden;
}

/* Enhanced Mesh Background */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at 0% 0%, #0f172a 0%, #020617 100%);
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    filter: blur(100px);
    border-radius: 50%;
    opacity: 0.5;
}

.blob-1 {
    top: -200px;
    right: -100px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    animation: floating 25s infinite ease-in-out;
}

.blob-2 {
    bottom: -200px;
    left: -100px;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.2) 0%, transparent 70%);
    animation: floating 30s infinite ease-in-out reverse;
}

@keyframes floating {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(50px, 100px) scale(1.1);
    }

    66% {
        transform: translate(-50px, 50px) scale(0.9);
    }
}

.app-container {
    width: 100%;
    max-width: 1000px;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 4rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    color: var(--primary);
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.logo h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo h1 span {
    background: linear-gradient(to right, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 300;
}

/* Modernized Upload Area */
.upload-section {
    perspective: 1000px;
    cursor: pointer;
}

.upload-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px dashed var(--glass-border);
    border-radius: 32px;
    padding: 6rem 3rem;
    text-align: center;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.upload-section.drag-over .upload-card {
    border-color: var(--primary);
    background: rgba(129, 140, 248, 0.08);
    transform: scale(1.02);
    box-shadow: 0 0 40px var(--primary-glow);
}

.upload-icon-wrapper {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.1), rgba(192, 132, 252, 0.1));
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--primary);
}

.upload-card:hover .upload-icon-wrapper {
    transform: rotate(5deg) scale(1.1);
    border-color: var(--primary);
}

.upload-card h3 {
    font-size: 1.75rem;
    font-weight: 600;
}

.upload-card p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.specs {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 1.5rem;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
}

/* Image Grid Enhancements */
.preview-section {
    margin-top: 3rem;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2.5rem 0 4rem;
}

.image-item {
    position: relative;
    background: #1e293b;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    aspect-ratio: 1;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.image-item:hover {
    transform: translateY(-8px) rotate(1deg);
    border-color: var(--primary);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.4);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.image-item:hover img {
    transform: scale(1.1);
}

.image-item .remove-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(244, 63, 94, 0.9);
    backdrop-filter: blur(4px);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: var(--transition);
    z-index: 10;
}

.image-item:hover .remove-btn {
    opacity: 1;
    transform: scale(1);
}

.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(2, 6, 23, 0.9));
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    transform: translateY(100%);
    transition: var(--transition);
}

.image-item:hover .image-info {
    transform: translateY(0);
}

/* Buttons */
.btn {
    font-family: inherit;
    padding: 0.85rem 1.75rem;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 10px 20px rgba(129, 140, 248, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(129, 140, 248, 0.4);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-secondary);
}

.btn-lg {
    padding: 1.25rem 3.5rem;
    font-size: 1.25rem;
    border-radius: 18px;
}

.btn-block {
    width: 100%;
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.btn-text:hover {
    color: var(--text-primary);
}

.convert-section {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* Features Styling */
.features-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-top: 8rem;
    padding: 0 1rem;
}

.feature-card {
    text-align: center;
}

.feature-card i {
    width: 32px;
    height: 32px;
    color: var(--primary);
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 5px var(--primary-glow));
}

.feature-card h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Modals & Overlays */
.modal-overlay,
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal,
.loader-card {
    background: #0f172a;
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 3rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.success-icon-wrapper {
    width: 80px;
    height: 80px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
}

.success-icon {
    width: 40px;
    height: 40px;
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(129, 140, 248, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
    margin: 0 auto 2rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    margin-top: 2rem;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--accent));
    box-shadow: 0 0 15px var(--primary-glow);
    transition: width 0.4s ease;
}

.hidden {
    display: none !important;
}

/* Footer Improvements */
.footer {
    border-top: 1px solid var(--glass-border);
    padding: 4rem 1rem;
    margin-top: 8rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

@media (max-width: 1024px) {
    .features-section {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 2rem 1rem;
    }

    .logo h1 {
        font-size: 2.25rem;
    }

    .features-section {
        grid-template-columns: 1fr;
        margin-top: 4rem;
    }

    .btn-lg {
        width: 100%;
    }

    .image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}