:root {
    --primary: #1e40af;
    /* Dark Blue (Blue-800) */
    --primary-dark: #1e3a8a;
    /* Deeper Blue (Blue-900) */
    --primary-light: #3b82f6;
    /* Lighter Blue (Blue-500) */
    --secondary: #0f172a;
    /* Slate-900 */
    --accent: #2563eb;
    /* Blue-600 */
    --dark: #020617;
    /* Slate-950 */
    --light: #f1f5f9;
    /* Slate-100 */
    --gray: #475569;
    /* Slate-600 */
    --gray-light: #cbd5e1;
    /* Slate-300 */
    --success: #10b981;
    --error: #ef4444;
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --surface: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(30 58 138 / 0.05);
    --shadow: 0 4px 6px -1px rgb(30 58 138 / 0.1), 0 2px 4px -2px rgb(30 58 138 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(30 58 138 / 0.1), 0 4px 6px -4px rgb(30 58 138 / 0.1);
    --radius: 12px;
    --radius-lg: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.main-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--gray);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* Hero - Dark Blue Theme Update */
.hero-section {
    padding: 5rem 0 4rem;
    text-align: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    /* Deep Blue Gradient */
    color: white;
    margin-bottom: 2rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, var(--dark), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section h1 {
    color: white;
    -webkit-text-fill-color: white;
    /* Override previous gradient text */
    margin-bottom: 1.5rem;
}

.highlight {
    color: var(--primary);
}

.hero-section .highlight {
    color: #60a5fa;
    /* Lighter blue for highlight text on dark bg */
}

.intro-text p {
    font-size: 1.125rem;
    color: var(--gray);
    max-width: 700px;
    margin: 0 auto 2rem;
}

.hero-section .intro-text p {
    color: #e2e8f0;
    /* Light slate text for contrast */
    font-size: 1.25rem;
    max-width: 750px;
}

.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: 100px;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
    color: var(--dark);
    border: 1px solid var(--gray-light);
}

/* Benefit List on Dark bg */
.hero-section .benefit-list li {
    background: rgba(255, 255, 255, 0.1);
    /* Glassy white */
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: none;
    backdrop-filter: blur(5px);
}

/* Tool Wrapper - slightly overlapping hero? */
/* Tool Wrapper - slightly overlapping hero? */
.tool-wrapper {
    background: var(--surface);
    color: var(--dark);
    /* Fix: Ensure text is dark on white background */
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden;
    min-height: 400px;
    position: relative;
    border: 1px solid var(--gray-light);
    /* Negative margin to pull it up into the blue area */
    transform: translateY(2rem);
    margin-bottom: 4rem;
}

/* Upload Area - Premium Redesign */
.upload-area {
    padding: 5rem 2rem;
    border: 3px dashed #cbd5e1;
    /* Thicker, softer border */
    margin: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
    position: relative;
    overflow: hidden;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(30 58 138 / 0.1);
}

.upload-area .icon-upload {
    color: var(--primary);
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.upload-area:hover .icon-upload {
    transform: scale(1.1);
}

.upload-area h3 {
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-size: 1.5rem;
}

.upload-area p {
    color: var(--gray);
    font-size: 1.1rem;
}

/* Editor */
.editor-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    height: 600px;
}

.preview-container {
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 2rem;
}

/* Canvas/Image wrapper for cropping */
.cropper-wrapper {
    max-width: 100%;
    max-height: 100%;
    position: relative;
    box-shadow: var(--shadow);
}

#imagePreview {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.controls-panel {
    padding: 1.5rem;
    background: var(--surface);
    border-left: 1px solid var(--gray-light);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.control-group h4 {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Buttons */
.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.primary-btn:hover {
    background: var(--primary-dark);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--gray-light);
    padding: 0.8rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    color: var(--gray);
    width: 100%;
}

.secondary-btn:hover {
    border-color: var(--gray);
    color: var(--dark);
}

/* Inputs & Selects */
.premium-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-light);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    background-color: #fff;
}

/* Ranges */
input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--gray-light);
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

/* Result View */
.result-view {
    text-align: center;
    padding: 3rem;
}

.success-header {
    margin-bottom: 2rem;
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.result-display {
    margin-bottom: 2rem;
    display: inline-block;
    padding: 10px;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSIxMCIgdmlld0JveD0iMCAwIDEwIDEwIiBmaWxsPSJub25lIj48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iNSIgaGVpZ2h0PSI1IiBmaWxsPSIjZTZlNmU2IiAvPjxyZWN0IHg9IjUiIHk9IjUiIHdpZHRoPSI1IiBoZWlnaHQ9IjUiIGZpbGw9IiNlNmU2ZTYiIC8+PC9zdmc+') repeat;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

#resultImage {
    max-width: 300px;
    display: block;
    border-radius: 50%;
    /* Just for display in case */
}

/* Responsive */
@media (max-width: 768px) {
    .editor-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .preview-container {
        height: 400px;
    }

    .nav-links {
        display: none;
    }

    h1 {
        font-size: 2rem;
    }
}

/* Utility */
.hidden {
    display: none !important;
}

.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-light);
    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);
    }
}

/* Cropper Custom Styles (If using a library or custom implementation) */
/* We will likely use Cropper.js styling if we use that library, but let's assume we might need some overrides */
.cropper-view-box,
.cropper-face {
    border-radius: 50%;
}

/* SEO Content & Typography */
.seo-content {
    padding: 6rem 0 4rem;
    /* Extra top padding for the tool overlap */
    background: #fdfdfd;
    margin-top: 4rem;
    border-top: 1px solid var(--gray-light);
}

.content-block {
    margin-bottom: 4rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    padding: 2.5rem;
    border-radius: var(--radius);
    border: 1px solid #f1f5f9;
    box-shadow: var(--shadow-sm);
}

.content-block h2 {
    font-size: 2rem;
    color: #0f172a;
    /* Darkest slate */
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.content-block h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

.text-content p {
    margin-bottom: 1.5rem;
    color: #334155;
    font-size: 1.1rem;
    line-height: 1.8;
}

.text-content ul,
.text-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: #334155;
}

.text-content li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

/* Premium FAQ Grid (Cards) */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Responsive 2 column */
    gap: 2rem;
    margin-top: 3rem;
}

.faq-item h4 {
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.faq-item {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.faq-item h4 {
    color: var(--primary-dark);
    font-size: 1.15rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    font-weight: 700;
}

.faq-item p {
    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Internal Link Cards */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tool-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.3s;
}

.tool-link-card:hover {
    border-color: var(--primary);
    background: #eff6ff;
    transform: translateY(-2px);
}

.tool-link-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.tool-link-card .meta strong {
    display: block;
    color: var(--dark);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.tool-link-card .meta span {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Footer styles update */
.main-footer {
    background: #020617;
    /* Very dark blue/black */
    padding-top: 4rem;
    color: white;
    padding: 3rem 0;
    margin-top: auto;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.footer-col h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-col ul {
    list-style: none;
}

.footer-col a {
    color: var(--gray);
    text-decoration: none;
    margin-bottom: 0.5rem;
    display: block;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: var(--gray);
}