:root {
    /* Light Mode Variables */
    --bg-color: #f7f9facc;
    --text-main: #111827;
    --text-muted: #4b5563;
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(255, 255, 255, 0.5);
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-bg: #e5e7eb;
    --secondary-hover: #d1d5db;
    --dropzone-border: #9ca3af;
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: #d1d5db;
    
    /* Background Gradients */
    --gradient-1: #e0c3fc;
    --gradient-2: #8ec5fc;
}

[data-theme="dark"] {
    /* Dark Mode Variables */
    --bg-color: #111827cc;
    --text-main: #f9fafb;
    --text-muted: #d1d5db;
    --card-bg: rgba(31, 41, 55, 0.7);
    --card-border: rgba(75, 85, 99, 0.5);
    --primary-color: #818cf8;
    --primary-hover: #6366f1;
    --secondary-bg: #374151;
    --secondary-hover: #4b5563;
    --dropzone-border: #6b7280;
    --input-bg: rgba(17, 24, 39, 0.8);
    --input-border: #4b5563;
    
    /* Dark Background Gradients */
    --gradient-1: #4c1d95;
    --gradient-2: #1e3a8a;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background Animations */
.background-animations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background-color: var(--bg-color); /* fallback */
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.5;
    animation: drift 20s infinite alternate ease-in-out;
    border-radius: 50%;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--gradient-1);
    animation-duration: 25s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--gradient-2);
    animation-delay: -5s;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 10%) scale(1.1); }
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.glass-header {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 1rem 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.highlight {
    color: var(--primary-color);
}

.main-nav {
    display: none;
}

@media (min-width: 768px) {
    .main-nav {
        display: block;
    }
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus {
    color: var(--primary-color);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.theme-toggle:hover {
    background: var(--secondary-bg);
}

/* Main Layout */
.main-content {
    flex-grow: 1;
    padding-top: 4rem;
    padding-bottom: 4rem;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.text-center {
    text-align: center;
}

/* Hero */
.hero h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .hero h1 { font-size: 3.5rem; }
    .hero p { font-size: 1.25rem; }
}

/* Tool Sections */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--dropzone-border);
    border-radius: 1rem;
    padding: 3rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.formats-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 1rem;
}

.hidden {
    display: none !important;
}

/* Editor Zone */
.preview-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .preview-layout {
        grid-template-columns: 3fr 2fr;
    }
}

.preview-container {
    background: var(--secondary-bg);
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 300px;
}

canvas {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.controls-container h3 {
    margin-bottom: 1.5rem;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    margin: 0.5rem 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--secondary-bg);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
}

.full-width {
    width: 100%;
}

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }

/* Toggle switch */
.toggle-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--secondary-bg);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* How It Works */
.steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .steps-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.step-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    padding: 2rem 1.5rem;
    border-radius: 1rem;
    transition: transform 0.3s;
}

.step-card:hover {
    transform: translateY(-5px);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step-card h3 {
    margin-bottom: 0.5rem;
}

.step-card p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* SEO Content */
.seo-content {
    padding: 3rem;
}

.seo-content h2 {
    margin-bottom: 1.5rem;
}

.seo-content p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.seo-content strong {
    color: var(--text-main);
}

/* FAQ */
.faq-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .faq-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.faq-item {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    padding: 1.5rem;
    border-radius: 1rem;
}

.faq-item h4 {
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.faq-item p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Footer */
footer {
    border-top: 1px solid var(--card-border);
    padding: 2rem 0;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.social-links a:hover {
    color: var(--primary-color);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 1rem;
}
