:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.4);
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --radius: 12px;
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
.main-header {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    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.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
}

/* Hero */
.hero-section {
    padding: 4rem 1.5rem;
    text-align: center;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.highlight {
    background: linear-gradient(135deg, #60a5fa, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-text {
    max-width: 600px;
    margin: 1rem auto 2rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.benefit-list {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.benefit-list li {
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

/* Tool Container */
.tool-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
    min-height: 400px;
}

/* Upload View */
.upload-area {
    padding: 5rem 2rem;
    text-align: center;
    border: 2px dashed var(--border);
    margin: 1.5rem;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.icon-upload {
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-content h3 {
    margin-bottom: 0.5rem;
}

.upload-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Editor View */
.tool-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-layout {
    display: flex;
    flex-wrap: wrap;
    height: 100%;
}

.preview-container {
    flex: 2;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    min-height: 400px;
    overflow: hidden;
}

.img-container {
    max-width: 100%;
    max-height: 600px;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.img-container img {
    max-width: 100%;
    max-height: 600px;
    display: block;
    width: auto;
    height: auto;
}

.controls-panel {
    flex: 1;
    min-width: 320px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.control-group h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Custom Radios for Type */
.radio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.radio-card {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    position: relative;
}

.radio-card input {
    position: absolute;
    opacity: 0;
}

.radio-card.active {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
    color: #fff;
}

/* Sliders */
.range-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type=range] {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--primary);
    margin-top: -7px;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.3);
    cursor: pointer;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
}

.value-badge {
    background: var(--bg-dark);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    min-width: 40px;
    text-align: center;
}

/* Toggles */
.toggles {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.toggle-switch {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.toggle-switch input {
    display: none;
}

.toggle-switch .slider {
    width: 40px;
    height: 22px;
    background: var(--border);
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
}

.toggle-switch .slider:before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked+.slider {
    background: var(--primary);
}

.toggle-switch input:checked+.slider:before {
    transform: translateX(18px);
}

/* Buttons */
.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
    text-align: center;
    display: inline-block;
}

.primary-btn:hover {
    background: var(--primary-dark);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
}

.secondary-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

/* Loader */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
    backdrop-filter: blur(4px);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Helpers */
.hidden {
    display: none !important;
}

/* SEO Content Enhancements */
.container-text {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.content-block {
    margin-bottom: 3rem;
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.content-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0.5;
}

.content-block h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #fff;
    font-weight: 700;
}

.content-block h3 {
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #e2e8f0;
}

.text-content p {
    margin-bottom: 1.2rem;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

.text-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.text-content ul li {
    margin-bottom: 0.8rem;
    padding-left: 0.5rem;
}

.comparison-box {
    background: rgba(15, 23, 42, 0.6);
    border-left: 4px solid var(--primary);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
}

.comparison-box p {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.comparison-box strong {
    color: var(--primary);
}

/* FAQ Grid Improvements */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.faq-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s, border-color 0.2s;
}

.faq-item:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.faq-item h4 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

/* Internal Linking Cards */
.internal-links-block {
    margin-top: 5rem;
    text-align: center;
}

.internal-links-block h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tool-link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-link-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.3);
}

.tool-link-card .icon {
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.1);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.tool-link-card .meta {
    text-align: left;
    display: flex;
    flex-direction: column;
}

.tool-link-card .meta strong {
    color: #fff;
    font-size: 1.1rem;
}

.tool-link-card .meta span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* New Control Labels */
.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.control-group h4 {
    margin-bottom: 0;
}

/* Status Badge (Non-blocking) */
.status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: pulseBadge 1.5s infinite;
}

@keyframes pulseBadge {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
        border-color: var(--primary);
    }

    100% {
        opacity: 0.7;
    }
}

/* --- ULTIMATE FOOTER DESIGN (Premium Box + Reference Layout) --- */
.main-footer {
    width: 100%;
    margin-top: 5rem;
    padding: 2rem 1rem 4rem;
    background: transparent;
    border: none;
    display: flex;
    justify-content: center;
}

/* The Floating Box Container */
.footer-box {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;

    /* Deep Premium Surface */
    background: #0f172a;
    /* Slate 900 */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;

    /* Refined Shadow - "Levitating" Effect */
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.3),
        0 10px 10px -5px rgba(0, 0, 0, 0.2);

    padding: 3.5rem 3rem 2rem;
    position: relative;
    overflow: hidden;
}

/* Top Accent Line (Subtle) */
.footer-box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.3), transparent);
}

/* Grid Layout - Perfectly Balanced */
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    /* Brand gets slightly more space */
    gap: 4rem;
    margin-bottom: 3rem;
    border: none;
    text-align: left;
}

/* Brand Branding */
.footer-brand .logo {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1rem;
    display: inline-block;
    color: #fff;
}

.footer-brand .logo span {
    color: var(--primary);
}

.footer-brand p {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 340px;
    margin-top: 0.5rem;
}

/* Link Columns */
.footer-links {
    padding-top: 0.5rem;
    /* Align with logo baseline visually */
}

.footer-links h5 {
    color: #f8fafc;
    /* Slate 50 */
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    opacity: 0.9;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: #fff;
    transform: translateX(4px);
}

/* Copyright Bar */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 2rem;
    margin-top: 2rem;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

.footer-bottom .heart {
    color: #ef4444;
    display: inline-block;
    vertical-align: middle;
    margin: 0 3px;
    animation: heartBeat 2s infinite;
}

@keyframes heartBeat {

    0%,
    100% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.15);
    }

    30% {
        transform: scale(1);
    }
}

/* Responsive */
@media(max-width: 900px) {
    .footer-box {
        padding: 2.5rem 1.5rem;
        border-radius: 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .footer-brand {
        grid-column: span 2;
    }

    .footer-brand p {
        max-width: 100%;
    }
}

@media(max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }

    .footer-brand {
        grid-column: span 1;
    }

    .footer-brand p {
        margin: 0 auto;
    }
}