:root {
    /* ULTRA PREMIUM DARK BLUE THEME */
    --primary-dark: #020617;
    /* Absolute Darkest Blue */
    --primary-main: #0f172a;
    /* Slate 900 */
    --primary-light: #1e293b;
    /* Slate 800 */

    --accent-color: #3b82f6;
    /* Blue 500 */
    --accent-glow: rgba(59, 130, 246, 0.5);

    --text-main: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    --surface-card: #1e293b;
    --surface-hover: #334155;

    --border: #334155;
    /* Slate 700 */

    --radius-md: 12px;
    --radius-lg: 16px;

    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--primary-dark);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
.main-header {
    background: rgba(15, 23, 42, 0.95);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-color);
}

/* --- Hero Section --- */
.hero-section {
    padding: 4rem 0;
    text-align: center;
    background: radial-gradient(circle at center, #1e293b 0%, #020617 100%);
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    background: linear-gradient(135deg, #fff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.highlight {
    color: var(--accent-color);
    -webkit-text-fill-color: var(--accent-color);
}

.intro-text {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}

.benefit-list {
    display: flex;
    justify-content: center;
    gap: 1rem;
    list-style: none;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.benefit-list li {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

/* --- TOOL BOX (Compact & Centered) --- */
.tool-wrapper {
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    /* Deep shadow */
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 850px;
    /* Further reduced */
    margin: 0 auto;
    overflow: hidden;
    min-height: 450px;
    /* Further reduced */
    display: flex;
    flex-direction: column;
}

/* Upload State */
.upload-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    margin: 1.5rem;
    /* Reduced margin */
    padding: 1.5rem;
    /* Reduced padding */
    border-radius: var(--radius-md);
    transition: 0.3s;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--accent-color);
    background: rgba(59, 130, 246, 0.05);
}

.icon-upload {
    font-size: 3rem;
    color: var(--accent-color);
    margin: 0 auto 1rem auto;
    /* CENTERED HORIZONTALLY + bottom margin */
    background: rgba(59, 130, 246, 0.1);
    width: 70px;
    /* Slightly smaller circle */
    height: 70px;
    border-radius: 50%;
    display: grid;
    /* Using grid for perfect center */
    place-items: center;
    padding: 0;
}

.icon-upload svg {
    display: block;
    width: 32px;
    height: 32px;
}

/* Editor Grid */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    height: 100%;
    min-height: 600px;
}

@media(max-width: 900px) {
    .editor-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* Canvas Area */
.preview-container {
    background: #0f172a;
    /* Dark background for canvas */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2rem;
    position: relative;
    background-image: radial-gradient(#334155 1px, transparent 1px);
    background-size: 20px 20px;
}

.img-container {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    max-height: 100%;
}

#canvasPreview {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Sidebar Controls */
.controls-panel {
    background: #1e293b;
    border-left: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.control-group {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.control-group h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.input-field,
select.input-field {
    width: 100%;
    background: #020617;
    border: 1px solid var(--border);
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-family: inherit;
}

.input-field:focus {
    border-color: var(--accent-color);
    outline: none;
}

textarea.input-field {
    height: 80px;
    resize: none;
}

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Color Picker */
.color-picker-wrapper {
    background: #020617;
    border: 1px solid var(--border);
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

input[type="color"] {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
}

/* Sliders */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
}

/* Toggles */
.toggles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.toggle-switch input {
    display: none;
}

.slider {
    width: 34px;
    height: 18px;
    background: #334155;
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    left: 2px;
    bottom: 2px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked+.slider {
    background: var(--accent-color);
}

input:checked+.slider::before {
    transform: translateX(16px);
}

/* Buttons */
.primary-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.3s;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.primary-btn:hover {
    background: #2563eb;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.5);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}

.secondary-btn:hover {
    border-color: white;
    color: white;
}

/* Result View */
.result-view {
    padding: 3rem;
    text-align: center;
    color: white;
}

.result-display img {
    max-height: 400px;
    border: 4px solid var(--surface-card);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin: 2rem 0;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Content Section (SEO) */
.seo-content {
    background: white;
    /* Contrast: White content on dark site */
    color: #334155;
    padding: 5rem 0;
}

.content-block {
    max-width: 900px;
    margin: 0 auto 4rem;
}

.content-block h2 {
    color: #020617;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.content-block p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #475569;
}

.text-content ul {
    padding-left: 20px;
    color: #475569;
}

.text-content li {
    margin-bottom: 10px;
}

/* FAQ Grid */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.faq-item {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.faq-item h4 {
    color: #0f172a;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* Footer */
.main-footer {
    background: #020617;
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border);
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.brand-desc {
    color: #64748b;
    margin-top: 1rem;
    max-width: 300px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 1.5rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col a {
    color: #94a3b8;
    text-decoration: none;
    margin-bottom: 0.8rem;
    display: block;
    transition: 0.3s;
}

.footer-col a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

/* Loader */
.loader-overlay {
    background: rgba(15, 23, 42, 0.95);
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.spinner {
    border: 4px solid var(--border);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Utilities */
.hidden {
    display: none !important;
}