:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;

    --primary-color: #4f46e5;
    /* Indigo */
    --primary-hover: #4338ca;

    --success-color: #10b981;
    /* Emerald */
    --success-hover: #059669;

    --border-color: #e2e8f0;
    --input-bg: #f1f5f9;

    --font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    --radius: 16px;
    --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background decorations */
.main-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2rem 1rem;
}

.background-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #e0e7ff;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #d1fae5;
    bottom: -50px;
    right: -50px;
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Navbar specific container alignment */
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary-color);
}

/* Nav Links Update */
.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--primary-color);
    background: #eef2ff;
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 700;
    background: #e0e7ff;
}

/* Card */
.app-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 700px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.card-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card-header p {
    color: var(--text-secondary);
}

/* Sections */
section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.active-section {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Upload Area */
.upload-area {
    border: 3px dashed #cbd5e1;
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    background: #f8fafc;
    transition: all 0.2s;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: #eef2ff;
}

.drag-text {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Buttons */
.btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 1rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: var(--success-hover);
    transform: translateY(-1px);
}

.btn-download {
    background: #0ea5e9;
    /* Sky blue */
    color: white;
}

.btn-download:hover {
    background: #0284c7;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
    display: flex;
}

.mt-4 {
    margin-top: 1rem;
}

/* Editor View */
.preview-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 12px;
}

.mini-thumb {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: #e2e8f0;
    border: 1px solid var(--border-color);
}

.mini-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.file-dims {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.text-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.85rem;
    padding: 0;
    text-align: left;
    margin-top: 4px;
    cursor: pointer;
    text-decoration: underline;
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

.resize-controls h3 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Radio Toggles */
.mode-toggles {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
}

.radio-label input {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s;
}

.radio-label input:checked+.radio-custom {
    border-color: var(--primary-color);
}

.radio-label input:checked+.radio-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
}

/* Sliders & Inputs */
.slider-container {
    padding: 1rem 0;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 4px;
    outline: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.slider-value {
    text-align: center;
    margin-top: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.slider-value span {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.4rem;
}

.dim-inputs {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.input-group {
    flex: 1;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input[type="number"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border 0.2s;
}

input[type="number"]:focus {
    border-color: var(--primary-color);
}

.link-icon {
    padding: 0.75rem;
    color: #94a3b8;
    background: #f1f5f9;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 2px;
}

.link-icon.active {
    color: var(--primary-color);
    background: #e0e7ff;
}

/* Advanced Options */
.advanced-toggle {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    width: fit-content;
}

.advanced-options {
    margin-top: 1rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.option-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.option-row:last-child {
    margin-bottom: 0;
}

.option-row label {
    width: 80px;
    font-size: 0.9rem;
    font-weight: 500;
}

select {
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

.hidden {
    display: none;
}

.action-area {
    margin-top: 2.5rem;
}

/* Result Box */
.result-box {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.result-thumb {
    width: 150px;
    height: 150px;
    background: #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.result-info {
    flex: 1;
}

.result-info h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.comparison {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.comp-item {
    display: flex;
    flex-direction: column;
}

.comp-item .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.arrow {
    color: var(--text-secondary);
}

.highlight {
    color: var(--success-color);
    font-weight: 700;
}

/* Responsiveness */
@media (max-width: 600px) {
    .result-box {
        flex-direction: column;
        text-align: center;
    }

    .mode-toggles {
        gap: 1rem;
        flex-direction: column;
    }
}

/* Progress Bar */
.progress-wrap {
    display: none;
    margin-top: 1.5rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.progress-container {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease-out;
}

/* SEO Content - Added to bottom of pages */
.seo-content {
    max-width: 700px;
    margin: 3rem auto 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.seo-content h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.seo-content h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin: 1.5rem 0 0.5rem;
}

.seo-content p {
    margin-bottom: 1rem;
}

.seo-content ul {
    list-style: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.seo-content strong {
    color: var(--primary-color);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.guide-item {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.guide-item h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.guide-item p {
    font-size: 0.9rem;
    margin: 0;
}

/* Footer */
footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
}