:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --background: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --success: #22c55e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Background */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #4f46e5 0%, transparent 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, #ec4899 0%, transparent 70%);
    animation-delay: -5s;
}

.blob-3 {
    top: 40%;
    left: 40%;
    width: 30vw;
    height: 30vw;
    background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

/* Navbar */
.navbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 10;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
}

.logo .highlight {
    color: var(--primary);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

.container {
    width: 100%;
    max-width: 800px;
    padding: 8rem 2rem 4rem;
    /* Added top padding for fixed nav visual */
    z-index: 1;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(135deg, #6366f1, #ec4899);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

.converter-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.icon-wrapper {
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.drop-zone h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.drop-zone p {
    color: var(--text-muted);
}

.browse-btn {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* Processing State */
.processing-area {
    text-align: center;
    padding: 2rem;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--border);
    border-bottom-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Result Area */
.result-area {
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.image-comparison {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
}

.img-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.img-box {
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border);
}

.img-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.size-tag {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* Quality Control */
.quality-control {
    margin: 1.5rem 0;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.quality-control label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.quality-control input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 5px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.quality-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: background .15s ease-in-out;
}

.quality-control input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary-hover);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.powered-by {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.powered-by a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.powered-by a:hover {
    color: var(--primary);
}

.reset-link {
    display: block;
    margin-top: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
}

.reset-link:hover {
    color: var(--text-main);
}

/* How to Section */
.how-to-section {
    margin-top: 5rem;
    color: var(--text-main);
}

.how-to-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.step-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    position: relative;
}

.step-number {
    position: absolute;
    top: -15px;
    left: -15px;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.step-card h3 {
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
    color: var(--primary);
}

.step-card p {
    color: var(--text-muted);
    line-height: 1.5;
    font-size: 0.95rem;
}


/* Relocated Footer */
.powered-by-footer {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.9rem;
    width: 100%;
}

.powered-by-footer a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.powered-by-footer a:hover {
    color: var(--primary);
}

/* Prose for content pages */
.prose {
    line-height: 1.8;
}

.prose p {
    margin-bottom: 1.5rem;
    color: #cbd5e1;
}

.prose h2 {
    font-size: 2rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

@media (max-width: 600px) {
    .nav-container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .container {
        padding-top: 8rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    .converter-card {
        padding: 1.5rem;
    }

    .img-box {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .image-comparison {
        flex-direction: column;
        gap: 1rem;
    }

    .arrow {
        transform: rotate(90deg);
    }


}