:root {
    --primary: #003366;
    /* Deep Dark Blue (Premium) */
    --primary-dark: #002244;
    --primary-light: #336699;
    --secondary: #1a1a1a;
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #6c757d;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.06);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --transition: all 0.3s ease;
}

/* Dark Mode Support (Implicit or toggleable, stick to light for now but use variables) */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--secondary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.main-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--secondary);
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* Hero Section */
.hero-section {
    padding: 4rem 0 2rem;
    text-align: center;
    background: radial-gradient(circle at center, rgba(0, 51, 102, 0.1) 0%, transparent 70%);
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    /* Fix Lint */
}

.intro-text {
    max-width: 700px;
    margin: 0 auto 2rem;
    font-size: 1.125rem;
    color: var(--text-muted);
}

.benefit-list {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.benefit-list li {
    font-weight: 500;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
}

/* Tool Interface */
.tool-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-premium);
    padding: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    min-height: 400px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    background: #fafafa;
    transition: var(--transition);
    cursor: pointer;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(0, 51, 102, 0.05);
    /* Blue tint */
}

.icon-upload {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.upload-content p {
    color: var(--text-muted);
}

/* Tool Editor (Settings & Preview) */
.tool-editor {
    animation: fadeIn 0.4s ease;
}

.editor-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
}

.preview-container {
    background: #f1f5f9;
    /* Neutral grey background to show true colors */
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    min-height: 400px;
    /* consistent height */
    max-height: 600px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.img-container {
    max-width: 100%;
    max-height: 100%;
    overflow: auto;
    /* Allow scrolling if really big? Better: contain */
    display: flex;
    justify-content: center;
}

.img-container img {
    max-width: 100%;
    max-height: 550px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    transition: filter 0.2s ease;
}

.file-info-badge {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    backdrop-filter: blur(4px);
}

.controls-panel {
    background: #fff;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-group h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* Custom Range Slider */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    /* Standard property */
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: white;
    /* Thumb color */
    border: 2px solid var(--primary);
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: var(--border-color);
    border-radius: 2px;
}

input[type=range]:focus::-webkit-slider-runnable-track {
    background: #ccc;
}

.range-wrap {
    margin-bottom: 1rem;
}

.range-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Select */
.select-wrapper select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.2);
}

/* Radio Grid (Presets) */
.radio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.radio-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.radio-card input {
    display: none;
}

.radio-card.active {
    border-color: var(--primary);
    background: rgba(0, 51, 102, 0.05);
    color: var(--primary-dark);
    font-weight: 600;
}

.radio-card:hover {
    border-color: #adb5bd;
}

/* Toggles */
.toggles {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.toggle-switch input {
    display: none;
}

.toggle-switch .slider {
    width: 40px;
    height: 22px;
    background-color: #cbd5e1;
    border-radius: 22px;
    position: relative;
    transition: var(--transition);
}

.toggle-switch .slider:before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.slider {
    background-color: var(--primary);
}

.toggle-switch input:checked+.slider:before {
    transform: translateX(18px);
}

/* Primary Button */
.primary-btn {
    display: inline-block;
    width: 100%;
    background: var(--secondary);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn:hover {
    background: black;
    transform: translateY(-2px);
    box-shadow: var(--shadow-premium);
}

.secondary-btn {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.secondary-btn:hover {
    background: #f8f9fa;
    border-color: #cbd5e1;
}

/* Result View */
.result-view {
    text-align: center;
    padding: 2rem 0;
    animation: fadeIn 0.4s ease;
}

.success-header {
    margin-bottom: 2rem;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.result-display img {
    max-width: 100%;
    max-height: 500px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 4px solid white;
}

.stats-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.stat-value {
    color: var(--secondary);
    font-weight: 700;
}

.download-section {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.download-btn {
    background: var(--primary);
    width: auto;
    padding: 0.75rem 2rem;
}

.download-btn:hover {
    background: var(--primary-dark);
}

/* Loader */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}

/* SEO Content */
.seo-content {
    padding: 4rem 0;
    background: white;
}

.content-block {
    margin-bottom: 4rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.content-block h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.content-block h2:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

.text-content {
    font-size: 1.1rem;
    color: #4a5568;
}

.text-content p {
    margin-bottom: 1.5rem;
}

/* FAQ */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.faq-item {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--primary);
    background: white;
    box-shadow: var(--shadow-md);
}

.faq-item h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.faq-item p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}

/* Footer */
.main-footer {
    background: var(--secondary);
    color: #e2e8f0;
    padding: 4rem 0 2rem;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.brand-desc {
    margin-top: 1rem;
    color: #94a3b8;
    max-width: 300px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 1.5rem;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col ul li a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid #475569;
    padding-top: 2rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }

    .editor-layout {
        grid-template-columns: 1fr;
    }

    .tool-wrapper {
        padding: 1rem;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .preview-container {
        min-height: 250px;
    }
}