:root {
    /* Night Mode Premium Palette */
    --primary: #3b82f6;
    /* Bright Blue for dark mode visibility */
    --primary-main: #60a5fa;
    /* Lighter blue for hovers */
    --primary-dark: #1e3a8a;
    /* Deep blue for deep accents */
    --accent: #0ea5e9;
    /* Sky blue */

    --bg: #0b1120;
    /* Deepest Blue/Black Background */
    --card-bg: #1e293b;
    /* Slate 800 for cards */
    --text: #f1f5f9;
    /* Slate 100 for main text */
    --text-light: #94a3b8;
    /* Slate 400 for secondary text */
    --border: #334155;
    /* Slate 700 for borders */

    --success: #22c55e;
    --radius: 16px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
/* Header Premium Dark */
.main-header {
    background: rgba(15, 23, 42, 0.9);
    /* Dark Glass */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    /* White/Light text for dark mode */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    letter-spacing: -0.03em;
}

.logo-icon {
    font-size: 1.8rem;
}

.logo span {
    color: var(--primary-main);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    align-items: center;
}

.nav-item {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    color: var(--primary);
    background: #f1f5f9;
}

/* The Active "Pill" Button */
.nav-item.active-pill {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    font-weight: 600;
}

.nav-item.active-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    background: var(--primary-main);
}

/* Hero Section */
.hero-section {
    padding: 5rem 0 3rem;
    text-align: center;
    background: radial-gradient(circle at 50% 0%, #172554 0%, var(--bg) 100%);
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.highlight {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-text p {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.benefit-list {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.benefit-list li {
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    box-shadow: var(--shadow);
    font-weight: 500;
    border: 1px solid var(--border);
    color: var(--text);
}

/* Tool Wrapper */
.tool-wrapper {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    min-height: 400px;
}

/* Upload Area */
.upload-area {
    padding: 4rem 2rem;
    border: 2px dashed var(--border);
    margin: 1rem;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(30, 41, 59, 0.4);
    /* Dark transparency */
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: #f0fdf4;
    /* Very light tint */
}

.icon-upload {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

/* Editor & Preview */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    height: 100%;
    min-height: 600px;
}

.preview-container {
    background: #e2e8f0;
    /* Darker bg for contrast */
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    background-image:
        linear-gradient(45deg, #cbd5e1 25%, transparent 25%),
        linear-gradient(-45deg, #cbd5e1 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #cbd5e1 75%),
        linear-gradient(-45deg, transparent 75%, #cbd5e1 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.canvas-wrapper {
    box-shadow: var(--shadow-lg);
    max-width: 100%;
    max-height: 500px;
    line-height: 0;
}

#previewCanvas {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.controls-panel {
    background: var(--card-bg);
    padding: 1.5rem;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    max-height: 600px;
}

.control-group h4 {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

/* Controls */
label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}

.range-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.range-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    width: 40px;
    text-align: right;
}

input[type="color"] {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    width: 100%;
    height: 40px;
    cursor: pointer;
    border-radius: 8px;
    padding: 2px;
    background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--border);
    border-radius: 6px;
}

.frame-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.type-btn {
    padding: 1rem;
    border: 2px solid var(--border);
    background: var(--bg);
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text);
}

.type-btn:hover {
    border-color: var(--primary-main);
    background: #eff6ff;
    transform: translateY(-2px);
}

.type-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-main));
    color: white;
    border: none;
    padding: 1.2rem;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.primary-btn:hover {
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px);
    filter: brightness(110%);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    background: var(--text-light);
}

/* Result View */
.result-view {
    text-align: center;
    padding: 3rem;
}

.success-header {
    margin-bottom: 2rem;
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pop {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

.result-display {
    margin-bottom: 2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.result-display img {
    max-width: 100%;
    border-radius: 4px;
    box-shadow: var(--shadow-lg);
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .controls-panel {
        border-left: none;
        border-top: 1px solid var(--border);
        max-height: none;
    }

    h1 {
        font-size: 2rem;
    }
}

/* Spinner */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 50;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    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);
    }
}

/* SEO Content */
/* SEO Content - Premium Cards */
.seo-content {
    margin-top: 5rem;
    padding: 4rem 0;
    background: #0f172a;
    /* Match Footer/Slightly lighter than body */
    border-top: 1px solid var(--border);
}

.content-block {
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(30, 41, 59, 0.5);
    /* Card look */
    border-radius: 20px;
    border: 1px solid var(--border);
}

.content-block h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: white;
    /* Strong white */
}

.text-content {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 100%;
}

.text-content h3,
.text-content h4 {
    color: var(--text);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
}

.text-content ul {
    list-style-position: inside;
    margin-bottom: 1rem;
}

/* Table Dark Styling */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    color: var(--text-light);
}

.comparison-table th {
    background: var(--card-bg);
    color: white;
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--border);
}

.comparison-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.comparison-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Premium FAQ Styling */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.faq-item {
    background: var(--card-bg);
    padding: 1.8rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.faq-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
    background: linear-gradient(to bottom right, var(--card-bg), rgba(30, 58, 138, 0.2));
}

.faq-item h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: white;
    font-weight: 700;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

/* Question Icon */
.faq-item h4::before {
    content: '?';
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-main));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.faq-item p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
    padding-left: 2.3rem;
    /* Align text with question text, ignoring icon */
}

/* Links */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.tool-link-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--dark);
    transition: 0.2s;
}

.tool-link-card:hover {
    background: #e0e7ff;
}

/* Footer Premium */
footer {
    background: #0f172a;
    /* Slate 900 */
    color: #e2e8f0;
    padding: 4rem 0 2rem;
    margin-top: auto;
    border-top: 1px solid #1e293b;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand-col p {
    color: #94a3b8;
    /* Slate 400 */
    font-size: 0.9rem;
    margin-top: 1rem;
    line-height: 1.6;
    max-width: 300px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white !important;
    /* Force override of .logo color */
    text-decoration: none;
}

.footer-col h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    font-weight: 600;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-col ul li a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: var(--primary-main);
}

/* Newsletter Input */
.newsletter-input {
    display: flex;
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #334155;
    padding: 4px;
    border-radius: 8px;
}

.newsletter-input input {
    background: none;
    border: none;
    color: white;
    padding: 8px 12px;
    width: 100%;
    outline: none;
    font-family: inherit;
}

.newsletter-input button {
    background: var(--primary);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: default;
    /* Disabled for now */
    display: flex;
    /* Flex to center character */
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.footer-bottom-bar {
    border-top: 1px solid #1e293b;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .navbar-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        /* Allow wrapping on small screens */
        font-size: 0.8rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Basic Updates for new controls */
.radio-grid-text {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: var(--bg);
    /* Darker background for pill container */
    padding: 4px;
    border-radius: 12px;
}

.ratio-btn input {
    display: none;
}

.ratio-btn {
    text-align: center;
    padding: 8px 4px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
    transition: 0.2s;
}

.ratio-btn:hover {
    color: var(--primary);
}

.ratio-btn:has(input:checked) {
    background: var(--primary);
    /* Blue background for active */
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

.color-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type="color"] {
    flex: 1;
    height: 48px;
}

.shadow-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
}

.shadow-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.premium-select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    font-size: 0.95rem;
    color: var(--text);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 1rem center/1.2rem;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.premium-select:focus {
    border-color: var(--primary);
    outline: none;
}