:root {
    /* "Vibrant Studio" Professional Design System */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;

    /* Vibrant Gradient Pulse */
    --brand-primary: #6366f1;
    /* Indigo 500 */
    --brand-secondary: #a855f7;
    /* Purple 500 */
    --brand-gradient: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);

    /* Neutral System */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;

    --text-primary: var(--slate-900);
    --text-secondary: var(--slate-500);
    --border-light: var(--slate-200);

    /* Shadows: Dynamic Atmosphere */
    --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);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

    /* Typography */
    --font-heading: 'Syne', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-main);
    -webkit-font-smoothing: antialiased;
}

/* --- Header & Navigation --- */
header {
    background: #ffffff;
    text-align: center;
    padding: 6rem 1.5rem 1rem;
    position: relative;
    border-bottom: 1px solid var(--border-light);
}

/* --- Breadcrumb System --- */
.breadcrumb {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    background: transparent;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    color: var(--slate-400);
}

.breadcrumb li:not(:last-child)::after {
    content: "/";
    margin-left: 0.75rem;
    color: var(--slate-300);
    font-weight: 300;
}

.breadcrumb a {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--brand-secondary);
}

.breadcrumb [itemprop="name"] {
    color: inherit;
}

.main-nav {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.nav-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    padding: 0.5rem;
    border-radius: 100px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
}

.nav-button {
    background: transparent;
    color: var(--slate-600);
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 100px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-button:hover {
    background: var(--slate-50);
    color: var(--brand-primary);
}

header h1 {
    font-size: 3.5rem;
    font-family: var(--font-heading);
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.04em;
}

header p {
    color: var(--slate-500);
    font-size: 1.25rem;
    max-width: 1200px;
    white-space: nowrap;
    margin: 0.5rem auto 0;
}

/* --- Dropdown Menus --- */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    border-radius: 28px;
    box-shadow: 0 15px 50px -12px rgba(0, 0, 0, 0.15);
    padding: 2.5rem;
    min-width: 800px;
    display: none;
    z-index: 1001;
    border: 1px solid var(--border-light);
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    animation: zoomIn 0.2s ease-out;
}

/* Invisible bridge to prevent menu from closing when moving mouse from toggle to menu */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -1.5rem;
    left: 0;
    right: 0;
    height: 1.5rem;
    background: transparent;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: translate(-50%, 10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

.dropdown:hover .dropdown-menu {
    display: grid;
}

.dropdown-section h4 {
    color: var(--brand-primary);
    font-family: var(--font-heading);
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid var(--slate-100);
    padding-bottom: 0.5rem;
}

.dropdown-link {
    display: block;
    color: var(--slate-600);
    text-decoration: none;
    padding: 0.6rem;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.dropdown-link:hover {
    background: var(--slate-50);
    color: var(--brand-primary);
    transform: translateX(5px);
}

.lang-toggle {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    background: #ffffff;
    border: 1px solid var(--border-light);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--slate-600);
    transition: all 0.2s;
}

.lang-toggle:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

/* --- Main Layout --- */
main {
    max-width: 1200px;
    margin: 0.5rem auto 0;
    padding: 1rem 1.5rem;
}

/* --- How it Works (Vibrant Style) --- */
.how-it-works {
    margin-bottom: 2rem;
    text-align: center;
}

.how-it-works h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.step-card {
    background: #ffffff;
    display: flex;
    align-items: center;
    text-align: left;
    padding: 1rem;
    gap: 1rem;
}

.step-card:hover {
    transform: translateY(-4px);
}

.step-icon {
    width: 48px;
    height: 48px;
    background: var(--brand-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
    flex-shrink: 0;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
}

.step-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.step-card p {
    color: var(--slate-500);
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.8;
}

/* --- Converter Utility --- */
.converter {
    background: #ffffff;
    border-radius: 32px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-light);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.08);
}

.upload-area {
    border: 2px dashed var(--slate-300);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background: var(--slate-50);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-area:hover {
    border-color: var(--brand-primary);
    background: #ffffff;
    box-shadow: var(--shadow-lg);
}

.upload-content svg {
    color: var(--brand-primary);
    margin-bottom: 1rem;
    filter: drop-shadow(0 5px 10px rgba(99, 102, 241, 0.2));
}

.upload-content h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.controls {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--slate-100);
    flex-wrap: wrap;
    justify-content: center;
}

.controls button {
    background: var(--brand-gradient);
    color: white;
    border: none;
    padding: 1.25rem 4rem;
    border-radius: 100px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 15px 30px -10px rgba(99, 102, 241, 0.5);
    transition: all 0.3s;
}

.controls button:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.6);
}

/* --- All Image Tools (Fixed Critical Styling) --- */
.tools-directory {
    margin-bottom: 4rem;
}

.tools-directory h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    text-align: center;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: table;
    margin: 0 auto 3rem;
}

.directory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.directory-category {
    background: #ffffff;
    padding: 2rem;
    border-radius: 24px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.directory-category:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-lg);
}

.directory-category h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--slate-900);
}

.directory-category ul {
    list-style: none;
    padding: 0;
}

.directory-category li {
    margin-bottom: 0.75rem;
}

.directory-category a {
    color: var(--slate-600);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
    display: block;
}

.directory-category a:hover {
    color: var(--brand-primary);
    transform: translateX(5px);
}

/* --- Why Choose Us (Bento Row) --- */
.features {
    margin-bottom: 4rem;
}

.features h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2.5rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.feature {
    background: #ffffff;
    padding: 1.75rem;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

.feature:hover {
    border-color: var(--brand-primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.feature p {
    color: var(--slate-500);
    font-size: 0.9rem;
}

/* --- FAQ Section --- */
.faq {
    margin-bottom: 4rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.faq h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.faq details {
    background: #ffffff;
    margin-bottom: 1rem;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq details:hover {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
}

.faq details[open] {
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
    padding-bottom: 1rem;
}

.faq summary {
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    position: relative;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--slate-900);
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--brand-primary);
    transition: transform 0.3s ease;
    line-height: 1;
}

.faq details[open] summary::after {
    transform: rotate(45deg);
}

.faq details p {
    padding: 0 1.5rem 0.5rem;
    color: var(--slate-600);
    line-height: 1.6;
    margin: 0;
}

/* --- Footer --- */
footer {
    background: #ffffff;
    padding: 6rem 2rem;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

footer p {
    color: var(--slate-600);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

/* --- Blog Index Styling --- */
.blog-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.blog-card {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-primary);
}

.blog-card h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.blog-card h2 a {
    color: var(--slate-900);
    text-decoration: none;
    transition: color 0.2s;
}

.blog-card:hover h2 a {
    color: var(--brand-primary);
}

.blog-meta {
    color: var(--slate-400);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
}

.blog-card p:not(.blog-meta) {
    color: var(--slate-600);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex-grow: 1;
}

.blog-card .read-more {
    color: var(--brand-primary);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.blog-card .read-more:hover {
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .blog-list {
        grid-template-columns: 1fr;
    }
}

/* --- Blog Content Optimization --- */
.blog-article {
    max-width: 1000px;
    margin: 4rem auto;
    background: #ffffff;
    padding: 3.5rem;
    border-radius: 32px;
    box-shadow: var(--shadow-premium);
    border: 1px solid var(--border-light);
}

.blog-article h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.article-meta {
    color: var(--slate-400);
    font-size: 0.95rem;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.blog-article h2 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--slate-900);
    position: relative;
    padding-bottom: 0.5rem;
}

.blog-article h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 4px;
    background: var(--brand-gradient);
    border-radius: 2px;
}

.blog-article h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--slate-800);
}

.blog-article p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--slate-600);
    margin-bottom: 1.5rem;
}

.blog-article ul,
.blog-article ol {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.blog-article li {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--slate-600);
    margin-bottom: 0.75rem;
}

.blog-article strong {
    color: var(--slate-900);
}

/* Code Blocks */
.blog-article pre {
    background: var(--slate-900);
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 16px;
    overflow-x: auto;
    margin: 2rem 0;
    box-shadow: var(--shadow-lg);
}

.blog-article code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    background: var(--slate-100);
    color: var(--brand-primary);
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
}

.blog-article pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* CTA Box in Articles */
.cta-box {
    margin-top: 5rem;
    background: var(--brand-gradient);
    padding: 3.5rem;
    border-radius: 24px;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.4);
}

.cta-box h3 {
    font-family: var(--font-heading);
    color: #ffffff !important;
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

.cta-box p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
}

.cta-button {
    display: inline-block;
    background: #ffffff;
    color: var(--brand-primary);
    padding: 1.25rem 3rem;
    border-radius: 100px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
}

.cta-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-lg);
    color: var(--brand-secondary);
}

/* --- Responsive Engineering --- */
@media (max-width: 1024px) {

    .directory-grid,
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dropdown-menu {
        min-width: 90vw;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.75rem;
    }

    header p {
        white-space: normal;
        font-size: 1.1rem;
        padding: 0 1rem;
    }

    .directory-grid,
    .steps-grid,
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .converter {
        padding: 2rem;
    }
}

/* --- Decorative Elements --- */
.bg-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 20%, rgba(102, 126, 234, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(118, 75, 162, 0.05) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}