:root {
    --bg-color: #F8F9FE;
    --card-bg: #ffffff;
    --text-color: #111827;
    --text-muted: #6B7280;
    --primary-color: #5B63E2;
    --primary-hover: #4950B8;
    --border-color: #E5E7EB;
    --input-bg: #F3F4F6;
    --error-color: #EF4444;
    --success-color: #10B981;
    --border-radius: 20px;
    --transition: all 0.25s ease;
    --box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(#E5E7EB 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Navigation */
.main-nav {
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-nav .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1rem;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Page content wrapper for subpages */
.content-wrapper {
    width: 100%;
    max-width: 900px;
    padding: 3rem 1rem;
    flex: 1;
}

.page-content {
    margin-bottom: 3rem;
}

/* SEO Section with Sidebar */
.seo-section {
    width: 100%;
    max-width: 1100px;
    padding: 3rem;
    margin-bottom: 4rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.seo-content {
    min-width: 0;
}

.seo-sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
}

.sidebar-widget {
    background: #ffffff;
    border-radius: calc(var(--border-radius) / 1.5);
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.sidebar-widget h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.latest-articles {
    list-style: none;
}

.latest-articles li {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.latest-articles li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.latest-articles h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.latest-articles h4 a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.latest-articles h4 a:hover {
    color: var(--primary-color);
}

.latest-articles p {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.sidebar-read-more {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.sidebar-read-more:hover {
    text-decoration: underline;
}

.page-content p {
    margin-bottom: 1.25rem;
    line-height: 1.7;
    font-size: 1.05rem;
}

/* FAQ */
.faq-item {
    margin-bottom: 2rem;
}

.faq-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Form Styles */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.95rem;
}

.input-field {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    outline: none;
    color: var(--text-color);
    border-radius: calc(var(--border-radius) / 2);
}

textarea.input-field {
    resize: vertical;
}

/* Filters & Pagination */
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

.filter-label {
    font-weight: 600;
    margin-right: 0.5rem;
    font-size: 0.95rem;
}

.filter-btn {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.tag {
    background: #EEF0FD;
    color: var(--primary-color);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Blog / Guides */
.blog-post {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.blog-post:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.blog-post h2 a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.blog-post h2 a:hover {
    color: var(--primary-color);
}

.post-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    margin-top: 0.5rem;
}

.read-more:hover {
    text-decoration: underline;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.page-btn:hover,
.page-btn.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typography */
h1 {
    font-weight: 700;
    font-size: 3rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-weight: 700;
    font-size: 2.2rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

h3 {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.main-header {
    text-align: center;
    padding: 5rem 2rem 2rem;
    width: 100%;
}

.main-header p {
    color: var(--text-muted);
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}

.supported-formats {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    background: #EEF0FD;
    /* subtle primary derived */
    border: 1px solid rgba(91, 99, 226, 0.15);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
}

.supported-formats .dot {
    color: #9CA3AF;
    font-size: 0.8rem;
}

.section-break {
    width: 100%;
    margin: 2rem 0;
}

.ad-placeholder-visual {
    width: 80%;
    max-width: 900px;
    height: 90px;
    border: 2px dashed #D1D5DB;
    background: #F9FAFB;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 12px;
}

/* Tool Section */
.tool-section {
    width: 100%;
    max-width: 900px;
    padding: 0 1rem;
    margin-bottom: 3rem;
}

/* Card Utilities */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.card-inset {
    background: var(--input-bg);
    border-radius: calc(var(--border-radius) / 1.5);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card-inset:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(91, 99, 226, 0.15);
}

.converter-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.drop-zone {
    width: 100%;
    min-height: 240px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 2px dashed var(--border-color);
    background: transparent;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(91, 99, 226, 0.02);
}

.drop-content {
    text-align: center;
    pointer-events: none;
    padding: 2rem;
}

.drop-content h3 {
    margin-bottom: 0.25rem;
}

.drop-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.upload-icon {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem;
}

.control-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

#quality-val {
    color: var(--primary-color);
    font-weight: 700;
}

select,
input[type="range"] {
    width: 100%;
    outline: none;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
}

select {
    padding: 0.85rem 1rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    padding: 0;
    margin: 1.25rem 0;
    background: var(--border-color);
    border: none;
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.actions {
    width: 100%;
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn {
    flex: 1;
    padding: 0.9rem 1.5rem;
    border: none;
    outline: none;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn.primary {
    background-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(91, 99, 226, 0.25);
}

.btn.primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(91, 99, 226, 0.35);
}

.btn.primary:active:not(:disabled) {
    transform: translateY(1px);
}

.btn.secondary {
    background-color: #ffffff;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn.secondary:hover:not(:disabled) {
    background-color: var(--input-bg);
    border-color: #D1D5DB;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-radius: calc(var(--border-radius) / 1.5);
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-preview {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.file-status {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.status-done {
    color: var(--success-color);
}

/* SEO Section */
.seo-section {
    width: 100%;
    max-width: 900px;
    padding: 4rem;
    margin-bottom: 4rem;
}

.seo-content p {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    line-height: 1.7;
    font-size: 1.05rem;
}

.seo-content h2 {
    text-align: center;
}

.seo-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.main-footer {
    width: 100%;
    text-align: center;
    padding: 2.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-links .dot {
    color: #9CA3AF;
    font-size: 0.8rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: var(--transition);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.modal {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-close:hover {
    color: var(--error-color);
}

.modal-body {
    overflow-y: auto;
    margin-top: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    padding-right: 0.5rem;
}

.modal-body h3 {
    margin-top: 1.5rem;
    font-size: 1.1rem;
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    max-width: 400px;
    z-index: 999;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: var(--transition);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.cookie-banner.hidden {
    opacity: 0;
    transform: translateY(2rem);
    pointer-events: none;
}

.cookie-content p {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 0;
}

.cookie-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.cookie-content a:hover {
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 0.5rem;
}

.small-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .seo-section {
        grid-template-columns: 1fr;
        padding: 2.5rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .seo-section {
        padding: 2.5rem 1.5rem;
    }

    .card {
        padding: 1.5rem;
    }

    .actions {
        flex-direction: column;
    }
}