:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-panel: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --success: #22c55e;
    --radius: 12px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    --font-main: 'Outfit', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-panel);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

/* Hero & Tool Section */
.hero-section {
    padding: 4rem 0;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.highlight {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-text {
    max-width: 700px;
    margin: 0 auto 2rem;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.benefit-list {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    list-style: none;
    margin-bottom: 3rem;
}

.benefit-list li {
    background: var(--bg-card);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

/* Tool Wrapper */
.tool-wrapper {
    width: 100%;
    max-width: 1000px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

/* Upload Area */
.upload-area {
    width: 100%;
    height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px dashed var(--border);
    margin: 1rem;
    width: calc(100% - 2rem);
    border-radius: var(--radius);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.icon-upload {
    color: var(--primary);
    margin-bottom: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Editor Interface */
.tool-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.editor-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Canvas Area */
.canvas-container {
    flex: 1;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    padding: 2rem;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    background-image: linear-gradient(45deg, #1e293b 25%, transparent 25%),
        linear-gradient(-45deg, #1e293b 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1e293b 75%),
        linear-gradient(-45deg, transparent 75%, #1e293b 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Controls Sidebar */
.controls-sidebar {
    width: 320px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.control-group {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.control-group h4 {
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-main);
}

.control-row {
    margin-bottom: 1.25rem;
}

.control-row:last-child {
    margin-bottom: 0;
}

.label-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Sliders */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: var(--bg-panel);
    border-radius: 2px;
}

/* Buttons */
.btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.tool-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.tool-btn:hover,
.tool-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.secondary-btn:hover {
    color: var(--text-main);
    border-color: var(--text-main);
}

/* Internal Link Strategy */
.internal-links-block {
    text-align: center;
}

.internal-links-block h3 {
    color: var(--text-main);
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tool-link-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.tool-link-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    background: rgba(99, 102, 241, 0.05);
}

.tool-link-card .icon {
    font-size: 2rem;
}

.tool-link-card .meta {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.tool-link-card .meta strong {
    color: var(--text-main);
    font-size: 1.1rem;
}

.tool-link-card .meta span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Result View */
.result-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    height: 100%;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.result-display img {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

/* Loading */
.loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-panel);
    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);
    }
}

/* Utility */
.hidden {
    display: none !important;
}

/* SEO Content */
.seo-content {
    background: var(--bg-dark);
    padding: 4rem 0;
    border-top: 1px solid var(--border);
}

.content-block {
    max-width: 800px;
    margin: 0 auto 3rem;
}

.content-block h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.text-content p {
    margin-bottom: 1.5rem;
    color: #cbd5e1;
    font-size: 1.05rem;
}

.text-content ul {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
    color: #cbd5e1;
}

.text-content li {
    margin-bottom: 0.5rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.faq-item h4 {
    color: var(--text-main);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.faq-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Footer */
.main-footer {
    background: #020617;
    padding: 3rem 0;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.footer-col ul {
    list-style: none;
    margin-top: 1rem;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .tool-editor {
        flex-direction: column;
    }

    .controls-sidebar {
        width: 100%;
        height: 50%;
        max-height: 50vh;
    }

    .canvas-container {
        height: 50vh;
    }

    .editor-layout {
        flex-direction: column;
    }

    .editor-layout>.canvas-container {
        min-height: 300px;
    }
}

/* FAQ Section */
.faq-section {
    margin-top: 4rem;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-question {
    padding: 1.5rem;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-main);
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-item.active {
    box-shadow: var(--shadow);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(15, 23, 42, 0.3);
}

.faq-item.active .faq-answer {
    max-height: 500px;
    /* Allow expansion */
}

.faq-answer p {
    padding: 1.5rem;
    padding-top: 0;
    color: var(--text-muted);
    line-height: 1.7;
    margin: 0;
}

/* Enhanced Footer */
.main-footer {
    background: #020617;
    padding: 5rem 0 2rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 1rem;
    max-width: 300px;
    font-size: 0.95rem;
}

.footer-col h4 {
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-col a:hover {
    color: var(--primary);
    transform: translateX(5px);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
    }
}