:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #ec4899;
    --accent: #8b5cf6;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #10b981;
    --white: #ffffff;
    --glass: rgba(30, 41, 59, 0.7);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--dark-bg);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* Hero Section */
.hero-section {
    padding-top: 120px;
    padding-bottom: 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Abstract Background Glows */
.hero-section::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.15;
    filter: blur(80px);
    z-index: -1;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    opacity: 0.1;
    filter: blur(80px);
    z-index: -1;
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-text {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.benefit-list {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.benefit-list li {
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    border: 1px solid var(--border);
    font-size: 0.95rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tool Interface - Enhanced Premium Look */
.tool-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    background: rgba(30, 41, 59, 0.4);
    /* Glass tint */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    /* Larger radius */
    box-shadow:
        0 20px 40px -10px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
    min-height: 500px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-wrapper:hover {
    box-shadow:
        0 30px 60px -12px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 1px rgba(79, 70, 229, 0.2);
    /* Subtle glow border */
}

/* Upload Area - Smoother Interaction */
.upload-area {
    padding: 5rem 2rem;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    margin: 2rem;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: radial-gradient(circle at center, rgba(79, 70, 229, 0.05) 0%, transparent 70%);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: radial-gradient(circle at center, rgba(79, 70, 229, 0.1) 0%, transparent 70%);
    transform: scale(1.01);
}

/* Workspace / Editor */
.tool-workspace {
    display: grid;
    grid-template-columns: 1fr 340px;
    min-height: 600px;
}

.image-canvas-area {
    background: #0f0f13;
    /* Very dark for contrast */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
    cursor: crosshair;
}

.image-canvas-area.empty {
    cursor: default;
}

#imageCanvas {
    max-width: 100%;
    max-height: 550px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}

/* Magnifier */
.magnifier {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 3px solid var(--white);
    border-radius: 50%;
    pointer-events: none;
    z-index: 100;
    display: none;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
    background-repeat: no-repeat;
    background-color: #000;
}

.magnifier.active {
    display: block;
}

.magnifier-grid {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
    background-size: 10px 10px;
    /* Adjust based on zoom level */
    opacity: 0.5;
}

.magnifier-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border: 1px solid red;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 1px white;
    background: transparent;
}

/* Sidebar Controls */
.sidebar-panel {
    background: var(--card-bg);
    border-left: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.panel-section h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Current Color Display */
.current-color-box {
    width: 100%;
    height: 80px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
    transition: background-color 0.1s;
}

/* Value Rows */
.color-value-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.color-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 35px;
}

.color-input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    flex: 1;
    outline: none;
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    padding: 4px;
    border-radius: 4px;
}

.copy-btn:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Palette */
.palette-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
}

.palette-swatch {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--border);
    position: relative;
    transition: var(--transition);
}

.palette-swatch:hover {
    transform: scale(1.1);
    z-index: 2;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.palette-swatch.empty {
    background:
        repeating-linear-gradient(45deg,
            transparent,
            transparent 5px,
            rgba(255, 255, 255, 0.03) 5px,
            rgba(255, 255, 255, 0.03) 10px);
    border-style: dashed;
}

/* Action Buttons */
.primary-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.secondary-btn {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    margin-top: 0.5rem;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

/* Hidden Utility */
.hidden {
    display: none !important;
}

/* SEO Content */
.seo-content {
    padding: 5rem 0;
    background: #0b1120;
    border-top: 1px solid var(--border);
}

.content-block {
    margin-bottom: 4rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.content-block h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.text-content p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.text-content h3 {
    color: var(--text-main);
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
}

.text-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.text-content li {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

/* FAQs - High Engaging Cards */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    /* Dense flexible grid */
    gap: 1.5rem;
    margin-top: 2rem;
}

.faq-item {
    background: linear-gradient(145deg, #111827, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.75rem;
    position: relative;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.faq-item:hover {
    transform: translateY(-5px);
    border-color: rgba(79, 70, 229, 0.3);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 0 20px rgba(79, 70, 229, 0.05);
}

/* Question Styling */
.faq-item h4 {
    color: var(--text-main);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    line-height: 1.5;
}

.faq-item h4::before {
    content: '?';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 800;
}

.faq-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    padding-left: 2rem;
    /* Indent body to align with text */
    opacity: 0.9;
}


/* Internal Linking Strategy - Engaging "Explore More" Cards */
.internal-links-block {
    margin-top: 6rem;
    padding: 3rem;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.5), rgba(30, 41, 59, 0.5));
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.internal-links-block h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-link-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: #1e293b;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.tool-link-card .icon {
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.tool-link-card .meta {
    text-align: left;
    display: flex;
    flex-direction: column;
}

.tool-link-card strong {
    color: var(--text-main);
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.tool-link-card span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Hover Effects for Cards */
.tool-link-card:hover {
    background: #253347;
    /* Slightly lighter */
    border-color: rgba(79, 70, 229, 0.5);
    /* Primary color border */
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(79, 70, 229, 0.2);
}

.tool-link-card:hover .icon {
    transform: scale(1.1) rotate(5deg);
    background: var(--primary);
    color: white;
}

/* Little shimmer effect on hover */
.tool-link-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: 0.5s;
}

.tool-link-card:hover::after {
    left: 100%;
}


/* ----------------------------------------------------
   Footer (Premium Sequence Style)
------------------------------------------------------- */
.main-footer {
    background: #020617;
    padding: 5rem 0 2rem;
    border-top: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

/* Subtle glow at footer bottom */
.main-footer::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 100px;
    background: radial-gradient(ellipse at center, rgba(79, 70, 229, 0.15) 0%, transparent 70%);
    filter: blur(40px);
    pointer-events: none;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-brand .logo {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.brand-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 300px;
    line-height: 1.6;
}

.footer-col h4 {
    color: var(--text-main);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 0.75rem;
}

.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-col a:hover {
    color: var(--primary);
    transform: translateX(3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: #64748b;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Social Icons Placeholder */
.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary);
    color: white;
}

/* Fix lint: background-clip */
.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    /* Standard property */
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .tool-workspace {
        grid-template-columns: 1fr;
    }

    .sidebar-panel {
        height: auto;
        border-left: none;
        border-top: 1px solid var(--border);
    }

    .hero-section h1 {
        font-size: 2.5rem;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }
}