:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --accent: #8b5cf6;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --glass: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Outfit', sans-serif;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 20%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s ease;
}

/* Navbar */
.main-header {
    background: var(--glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-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;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    font-weight: 400;
    color: var(--text);
    -webkit-text-fill-color: var(--text);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* Hero Section */
.hero-section {
    padding: 4rem 0 2rem;
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.highlight {
    background: linear-gradient(120deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-text {
    max-width: 700px;
    margin: 0 auto 2rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.benefit-list {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.benefit-list li {
    background: var(--surface);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    border: 1px solid var(--glass-border);
}

/* Tool Interface */
.tool-wrapper {
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

/* Upload Area */
.upload-area {
    padding: 4rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    cursor: pointer;
    transition: 0.3s;
    border: 2px dashed var(--border);
    margin: 2rem;
    border-radius: 12px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.icon-upload {
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.upload-content p {
    color: var(--text-muted);
}

/* Tool Editor (Preview & Settings) */
.tool-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editor-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem;
    align-items: flex-start;
}

.preview-container {
    flex: 2;
    min-width: 300px;
}

.frames-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 2rem;
    max-height: 300px;
    overflow-y: auto;
    background: var(--surface-light);
    padding: 1rem;
    border-radius: 8px;
}

.frame-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: grab;
    border: 2px solid transparent;
}

.frame-item.dragging {
    opacity: 0.5;
}

.frame-item:hover {
    border-color: var(--primary);
}

.frame-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.frame-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-box {
    text-align: center;
    background: var(--background);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.preview-box img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.controls-panel {
    flex: 1;
    min-width: 250px;
    background: var(--surface-light);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-group h4 {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Range Slider */
.range-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

input[type=range] {
    width: 100%;
    accent-color: var(--primary);
}

.range-val {
    font-weight: bold;
    color: var(--primary);
    min-width: 40px;
}

/* Select */
.premium-select {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    outline: none;
}

.premium-select:focus {
    border-color: var(--primary);
}

/* Buttons */
.primary-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    width: 100%;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
}

.secondary-btn:hover {
    background: var(--surface-light);
}

/* Logic Helpers */
.hidden {
    display: none !important;
}

/* Loader */
.loader-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--glass-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Result View */
.result-view {
    padding: 2rem;
    text-align: center;
}

.success-header {
    margin-bottom: 2rem;
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.result-display img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 2px solid var(--border);
}

.download-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
}

/* SEO Content Styling (Advanced) */
.seo-content {
    padding: 6rem 0;
    max-width: 800px;
    margin: 0 auto;
}

.content-block {
    margin-bottom: 4rem;
    background: var(--surface);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

.intro-block {
    border-left: 4px solid var(--primary);
}

.content-block h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.content-block h3 {
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-heading {
    background: rgba(99, 102, 241, 0.2);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.2rem;
}

.text-content {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

.text-content p {
    margin-bottom: 1.5rem;
}

.text-content ul {
    list-style: none;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
}

.text-content ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.8rem;
}

.text-content ul li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 1.2rem;
    line-height: 1;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.step-card {
    background: var(--surface-light);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.step-num {
    position: absolute;
    top: -10px;
    right: -10px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 4rem;
    font-weight: 900;
    opacity: 0.2;
    color: var(--primary);
}

.step-card h4 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.step-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Use Case Grid */
.use-case-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.case-item {
    background: var(--background);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--secondary);
}

.case-item strong {
    display: block;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.case-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* FAQ Grid */
.faq-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.faq-item {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.faq-item h4 {
    margin-bottom: 0.8rem;
    color: var(--text);
    font-size: 1.05rem;
}

.faq-item p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Internal Links Box */
.internal-links-box {
    margin-top: 4rem;
    background: linear-gradient(135deg, var(--surface) 0%, rgba(99, 102, 241, 0.1) 100%);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--primary-dark);
    text-align: center;
}

.internal-links-box h3 {
    margin-bottom: 1.5rem;
}

.link-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.tool-card-small {
    background: var(--background);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border);
    transition: transform 0.2s;
    text-align: left;
}

.tool-card-small:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.tool-card-small .icon {
    font-size: 1.5rem;
    background: var(--surface-light);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.tool-card-small .meta {
    display: flex;
    flex-direction: column;
}

.tool-card-small .meta strong {
    color: var(--text);
    font-size: 0.95rem;
}

.tool-card-small .meta span {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Footer */
.main-footer {
    background: var(--surface);
    padding: 3rem 0;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h4 {
    margin-bottom: 1rem;
    color: var(--text);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .editor-layout {
        flex-direction: column;
    }

    .footer-top {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .use-case-grid {
        grid-template-columns: 1fr;
    }
}