:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #8b5cf6;
    --background: #0f172a;
    --surface: #1e2533;
    --surface-light: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #22c55e;
    --error: #ef4444;
    --radius: 16px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.2;
    font-weight: 700;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.main-header {
    padding: 20px 0;
    backdrop-filter: blur(12px);
    background: rgba(15, 23, 42, 0.85);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* Hero Section - Reduced Gap */
.hero-section {
    padding: 3.5rem 0 3rem;
    /* Reduced from 6rem */
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    filter: blur(100px);
    z-index: -1;
    animation: pulse-glow 8s infinite alternate;
}

@keyframes pulse-glow {
    0% {
        opacity: 0.5;
        transform: translateX(-50%) scale(1);
    }

    100% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1.1);
    }
}

.intro-text p {
    font-size: 1.35rem;
    color: var(--text-muted);
    max-width: 750px;
    margin: 0 auto 2rem;
    font-weight: 300;
}

.benefit-list {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    list-style: none;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.benefit-list li {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.6rem 1.25rem;
    border-radius: 100px;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s;
}

.benefit-list li:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Tool Wrapper */
.tool-wrapper {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    min-height: 500px;
    margin-bottom: 5rem;
    position: relative;
}

/* Upload Area - HIGH ENGAGING LOOK */
.upload-area {
    padding: 6rem 2rem;
    margin: 2rem;
    border-radius: 20px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.9) 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed rgba(99, 102, 241, 0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.3);
}

/* Animated Gradient Border Effect via pseudo-element */
.upload-area::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(45deg, transparent, rgba(99, 102, 241, 0.5), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.6;
    pointer-events: none;
}

.upload-area:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.5);
}

.upload-area:hover .icon-upload {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 0 20px var(--primary));
    color: #fff;
}

.upload-area.drag-over {
    border-style: solid;
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.icon-upload {
    color: var(--primary);
    margin-bottom: 1.5rem;
    transition: all 0.4s ease;
    animation: floating-icon 3s ease-in-out infinite;
}

@keyframes floating-icon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.upload-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.upload-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
}

/* Tool Editor */
.tool-editor {
    display: flex;
    height: 750px;
}

.editor-layout {
    display: flex;
    width: 100%;
    height: 100%;
}

.preview-container {
    flex: 1;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--border);
}

.img-container {
    max-width: 100%;
    max-height: 100%;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background-color: #0f172a;
}

#previewCanvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
}

.file-info-badge {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Controls Panel */
.controls-panel {
    width: 360px;
    background: var(--surface);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    overflow-y: auto;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.controls-panel::-webkit-scrollbar {
    width: 6px;
}

.controls-panel::-webkit-scrollbar-track {
    background: var(--surface);
}

.controls-panel::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 3px;
}

.control-group h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.control-group h4::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.slider-group {
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.slider-group label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.slider-group label span:last-child {
    color: var(--primary);
    font-weight: 600;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--surface-light);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border: 2px solid var(--surface);
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: #fff;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.preset-btn {
    background: var(--surface-light);
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 0.75rem;
    border-radius: 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-weight: 500;
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    transform: translateY(-2px);
}

.preset-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.toggles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 12px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 1rem;
    font-size: 0.9rem;
    justify-content: space-between;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--surface-light);
    border-radius: 20px;
    position: relative;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

.primary-btn {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    margin-top: auto;
    text-decoration: none;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.5);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.85rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.secondary-btn:hover {
    border-color: var(--text);
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.result-view {
    text-align: center;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    height: 100%;
    justify-content: center;
}

.success-header h2 {
    color: var(--success);
    margin-top: 1rem;
    font-size: 2rem;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pop 0.5s;
}

@keyframes pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* SEO Content */
.seo-content {
    background: var(--surface);
    padding: 6rem 0;
    border-top: 1px solid var(--border);
}

.content-block {
    max-width: 850px;
    margin: 0 auto 4rem;
}

.content-block h2 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.content-block h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--text);
}

.text-content p {
    margin-bottom: 1.5rem;
    text-align: left;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.8;
}

.text-content ul {
    margin: -0.5rem 0 2rem 2rem;
    color: var(--text-muted);
}

/* Internal Tool Linking Box */
.internal-tools-section {
    margin: 4rem auto;
    max-width: 1000px;
    padding-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.tool-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
}

.tool-card:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    transform: translateY(-5px);
}

.tool-card .icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.tool-card h4 {
    color: var(--text);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.tool-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* FAQs */
.faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.faq-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: transform 0.2s;
}

.faq-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

.faq-item h4 {
    color: var(--text);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.faq-item p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

/* Footer */
.main-footer {
    background: #0b1120;
    padding: 5rem 0 2rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.main-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-brand .logo {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.brand-desc {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 350px;
    line-height: 1.7;
}

.footer-col h4 {
    color: var(--text);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-col ul li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-col ul li a:hover {
    color: var(--primary);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Loader */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile */
@media (max-width: 900px) {
    .tool-editor {
        flex-direction: column;
        height: auto;
    }

    .controls-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 2rem;
        height: auto;
    }

    .preview-container {
        height: 400px;
    }

    .faq-grid,
    .footer-top,
    .tool-grid {
        grid-template-columns: 1fr;
    }

    .upload-area {
        margin: 1rem 0;
        padding: 3rem 1.5rem;
    }
}