/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: #f8f9fa;
    color: #333;
    font-size: 16px;
    line-height: 1.6;
}
a { color: #1a6ef5; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════ */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.logo {
    font-size: 22px;
    font-weight: 700;
    color: #1a6ef5;
    text-decoration: none;
}
.logo span { color: #34a853; }
.header-nav a {
    margin-left: 20px;
    color: #555;
    font-size: 14px;
}
.header-nav a:hover { color: #1a6ef5; text-decoration: none; }

/* ═══════════════════════════════════════════════
   HEADER — мобильная версия
═══════════════════════════════════════════════ */
@media (max-width: 600px) {
    .site-header {
        padding: 0 12px;
    }

    /* лого и меню — в столбик, по центру */
    .header-inner {
        flex-direction: column;
        justify-content: center;
        height: auto;
        padding: 10px 0;
        gap: 8px;
    }

    /* ссылки — в ряд, с переносом и центровкой */
    .header-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 16px;
    }

    /* убираем margin-left, т.к. теперь работает gap */
    .header-nav a {
        margin-left: 0;
    }
}

.bookmark-link {
    cursor: pointer;
}
.bookmark-link:hover {
    color: #34a853 !important;  /* зелёный при наведении, как акцент лого */
}

/* ═══════════════════════════════════════════════
   AD SLOT 1 — под хедером
═══════════════════════════════════════════════ */
.ad-slot {
    background: #f0f0f0;
    border: 1px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
    overflow: hidden;
}
.ad-top {
    width: 100%;
    height: 90px;
    max-width: 728px;
    margin: 10px auto;
}
@media (max-width: 768px) {
    .ad-top { height: 100px; max-width: 320px; }
}

/* ═══════════════════════════════════════════════
   LAYOUT: контент + сайдбар
═══════════════════════════════════════════════ */
.page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-areas:
        "breadcrumb breadcrumb"
        "main sidebar";
    gap: 24px;
}
@media (max-width: 768px) {
    .page-wrap {
        grid-template-columns: 1fr;
        grid-template-areas:
            "breadcrumb"
            "main"
            "sidebar";
    }
}

/* ═══════════════════════════════════════════════
   BREADCRUMB
═══════════════════════════════════════════════ */
.breadcrumb {
    grid-area: breadcrumb;
    font-size: 13px;
    color: #888;
    padding: 4px 0;
}
.breadcrumb a { color: #888; }
.breadcrumb span { margin: 0 6px; }

/* ═══════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════ */
.main-content { grid-area: main; min-width: 0; }

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
    line-height: 1.2;
}
.page-subtitle {
    font-size: 17px;
    color: #666;
    margin-bottom: 24px;
}
@media (max-width: 768px) {
    .page-title { font-size: 24px; }
    .page-subtitle { font-size: 15px; }
}

/* ═══════════════════════════════════════════════
   UPLOAD CARD
═══════════════════════════════════════════════ */
.upload-card {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    margin-bottom: 24px;
}

/* Drag & Drop зона */
.drop-zone {
    border: 2px dashed #1a6ef5;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: background .2s, border-color .2s;
    background: #f0f6ff;
    position: relative;
}
.drop-zone:hover, .drop-zone.dragover {
    background: #e0edff;
    border-color: #0d4fc4;
}
.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.drop-icon { font-size: 48px; margin-bottom: 12px; }
.drop-text { font-size: 17px; color: #333; font-weight: 600; margin-bottom: 6px; }
.drop-hint { font-size: 13px; color: #888; }
.file-selected {
    margin-top: 12px;
    font-size: 14px;
    color: #34a853;
    font-weight: 600;
    display: none;
}

/* Compress level */
.compress-options {
    margin: 16px 0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.compress-options label {
    flex: 1;
    min-width: 80px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    font-size: 14px;
}
.compress-options input[type="radio"] { display: none; }
.compress-options input[type="radio"]:checked + span { color: #1a6ef5; font-weight: 700; }
.compress-options label:has(input:checked) {
    border-color: #1a6ef5;
    background: #f0f6ff;
}

/* Submit button */
.btn-convert {
    display: block;
    width: 100%;
    margin-top: 18px;
    padding: 15px;
    background: linear-gradient(135deg, #1a6ef5, #0d4fc4);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
}
.btn-convert:hover { opacity: .92; transform: translateY(-1px); }
.btn-convert:active { transform: translateY(0); }

/* Merge: несколько файлов */
.multi-upload .drop-zone { padding: 30px 20px; }

/* ═══════════════════════════════════════════════
   RESULT / ERROR
═══════════════════════════════════════════════ */
.result-box {
    background: #e6f4ea;
    border: 1px solid #34a853;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 24px;
    text-align: center;
}
.result-box .result-icon { font-size: 40px; margin-bottom: 8px; }
.result-box h3 { color: #1e7e34; margin-bottom: 12px; font-size: 18px; }
.btn-download {
    display: inline-block;
    padding: 12px 32px;
    background: #34a853;
    color: #fff;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity .2s;
}
.btn-download:hover { opacity: .88; text-decoration: none; }

.error-box {
    background: #fff3f3;
    border: 1px solid #e53935;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
    color: #c62828;
    font-size: 15px;
}

/* ═══════════════════════════════════════════════
   STEPS
═══════════════════════════════════════════════ */
.steps-block { margin-bottom: 28px; }
.steps-block h2 { font-size: 20px; margin-bottom: 16px; color: #1a1a2e; }
.steps-list {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.step-item {
    flex: 1;
    min-width: 150px;
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 6px rgba(0,0,0,.07);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.step-num {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: #1a6ef5;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
}
.step-text { font-size: 14px; color: #444; padding-top: 5px; }

/* ═══════════════════════════════════════════════
   AD SLOT 4 — внутри контента (нативный)
═══════════════════════════════════════════════ */
.ad-native {
    width: 100%;
    min-height: 90px;
    margin: 20px 0;
}

/* ═══════════════════════════════════════════════
   ADVANTAGES
═══════════════════════════════════════════════ */
.advantages-block { margin-bottom: 28px; }
.advantages-block h2 { font-size: 20px; margin-bottom: 16px; color: #1a1a2e; }
.advantages-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (max-width: 480px) {
    .advantages-grid { grid-template-columns: 1fr; }
}
.adv-item {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 6px rgba(0,0,0,.07);
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.adv-icon { font-size: 28px; }
.adv-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; color: #1a1a2e; }
.adv-text { font-size: 13px; color: #666; }

/* ═══════════════════════════════════════════════
   AD SLOT 5 — после контента
═══════════════════════════════════════════════ */
.ad-after-content {
    width: 100%;
    max-width: 728px;
    height: 90px;
    margin: 20px auto;
}
@media (max-width: 768px) {
    .ad-after-content { max-width: 300px; height: 250px; }
}

/* ═══════════════════════════════════════════════
   FAQ
═══════════════════════════════════════════════ */
.faq-block { margin-bottom: 28px; }
.faq-block h2 { font-size: 20px; margin-bottom: 16px; color: #1a1a2e; }
.faq-item {
    background: #fff;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,.07);
    overflow: hidden;
}
.faq-question {
    padding: 16px 20px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.faq-question::after {
    content: '+';
    font-size: 22px;
    color: #1a6ef5;
    transition: transform .2s;
    flex-shrink: 0;
    margin-left: 10px;
}
.faq-item.open .faq-question::after { content: '−'; }
.faq-answer {
    display: none;
    padding: 0 20px 16px;
    font-size: 14px;
    color: #555;
    line-height: 1.7;
}
.faq-item.open .faq-answer { display: block; }

/* ═══════════════════════════════════════════════
   RELATED LINKS
═══════════════════════════════════════════════ */
.related-block { margin-bottom: 28px; }
.related-block h2 { font-size: 20px; margin-bottom: 14px; color: #1a1a2e; }
.related-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.related-link {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    color: #1a6ef5;
    transition: border-color .2s, background .2s;
    text-decoration: none;
}
.related-link:hover {
    border-color: #1a6ef5;
    background: #f0f6ff;
    text-decoration: none;
}

/* ═══════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════ */
.sidebar { grid-area: sidebar; }
.sidebar-sticky { position: sticky; top: 80px; }

.ad-sidebar-top {
    width: 300px;
    height: 250px;
    margin-bottom: 16px;
}
.ad-sidebar-bottom {
    width: 300px;
    height: 600px;
}
@media (max-width: 768px) {
    .ad-sidebar-bottom { display: none; }
    .ad-sidebar-top { width: 100%; }
}

/* ═══════════════════════════════════════════════
   STICKY BOTTOM AD (слот 6)
═══════════════════════════════════════════════ */
.ad-sticky-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    justify-content: center;
    pointer-events: none;
}
.ad-sticky-bottom > * { pointer-events: all; }
.ad-sticky-inner {
    width: 728px;
    height: 90px;
    background: #f0f0f0;
    border: 1px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}
@media (max-width: 768px) {
    .ad-sticky-inner { width: 320px; height: 50px; }
}
.ad-sticky-close {
    position: absolute;
    top: -24px;
    right: 0;
    background: #555;
    color: #fff;
    border: none;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    pointer-events: all;
}

/* ═══════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════ */
.site-footer {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 24px 16px 80px;
    text-align: center;
    font-size: 13px;
    color: #999;
    margin-top: 20px;
}
.site-footer a { color: #888; margin: 0 8px; }

/* ═══════════════════════════════════════════════
   PROGRESS OVERLAY
═══════════════════════════════════════════════ */
.progress-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.progress-overlay.active { display: flex; }
.progress-box {
    background: #fff;
    border-radius: 12px;
    padding: 32px 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.progress-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: #1a6ef5;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-text { font-size: 16px; color: #333; font-weight: 600; }
.progress-hint { font-size: 13px; color: #888; margin-top: 6px; }

.result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    margin-top: 12px;
}

.btn-delete {
    display: inline-block;
    padding: 12px 24px;
    background: #f5f5f5;
    color: #d32f2f;
    border: 1px solid #e0c0c0;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}

.btn-delete:hover {
    background: #ffebee;
    color: #b71c1c;
}