/* ═══════════════════════════════════════════════
   compress.css — Стили для приложения сжатия
═══════════════════════════════════════════════ */

/* ── Hero ─────────────────────────────────────── */
.compress-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 5% 80px;
}

/* ── Breadcrumb навигация ─────────────────────── */
.minidocs-breadcrumb {
    padding-top: 28px;
}

.breadcrumb-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #aaa;
    text-decoration: none;
    transition: color 0.2s, gap 0.2s;
}

.breadcrumb-back svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.breadcrumb-back:hover {
    color: var(--accent-gold);
    gap: 10px;
}

.breadcrumb-back:hover svg {
    transform: translateX(-3px);
}

.compress-hero {
    text-align: center;
    padding: 52px 0 36px;
}

.compress-hero h1 {
    font-family: var(--header-font);
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 600;
    letter-spacing: -1.5px;
    line-height: 1.1;
}

.compress-sub {
    margin-top: 12px;
    font-family: var(--header-font);
    font-style: italic;
    font-size: clamp(16px, 2vw, 22px);
    color: var(--accent-gold);
}

/* ── Alert ────────────────────────────────────── */
.compress-alert {
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.compress-alert.error {
    background: #fff0f0;
    border: 1px solid #ffcdd2;
    color: #c62828;
}

/* ── Layout ───────────────────────────────────── */
.compress-layout {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ── Card ─────────────────────────────────────── */
.compress-card {
    background: #fff;
    border-radius: 28px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.04);
    padding: 36px 40px;
}

/* ── Drop Area ────────────────────────────────── */
.drop-area {
    border: 2px dashed rgba(197, 163, 103, 0.5);
    border-radius: 20px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s;
    position: relative;
    padding: 32px 20px;
    gap: 12px;
    margin-bottom: 32px;
}

.drop-area:hover,
.drop-area.active {
    background: rgba(197, 163, 103, 0.06);
    border-color: var(--accent-gold);
}

.drop-area input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    top: 0;
    left: 0;
}

.drop-icon {
    width: 52px;
    height: 52px;
    color: var(--accent-gold);
    opacity: 0.85;
}

.drop-icon svg {
    width: 100%;
    height: 100%;
}

.drop-label {
    font-size: 15px;
    color: #6b6b6b;
    text-align: center;
    line-height: 1.5;
    pointer-events: none;
}

.drop-label span {
    color: var(--accent-gold);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.drop-preview {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    pointer-events: none;
}

.drop-counter {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-gold);
    letter-spacing: 0.5px;
}

.drop-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.drop-thumb {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background: #e8e5de center/cover no-repeat;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
}

.drop-thumb span {
    width: 100%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 9px;
    padding: 3px 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drop-thumb-more {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    font-size: 20px;
    color: #aaa;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Settings Grid ────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 28px;
}

.settings-section:last-child {
    grid-column: 1 / -1;
}

.settings-section {
    background: var(--bg-color);
    border-radius: 16px;
    padding: 22px 24px;
    border: 1px solid var(--border-color);
}

.settings-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 16px;
}

/* ── Quality Slider ───────────────────────────── */
.quality-row label {
    display: block;
    font-size: 14px;
    color: #444;
    margin-bottom: 10px;
}

.quality-row label strong {
    color: var(--accent-gold);
    font-size: 16px;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, var(--accent-gold) 0%, var(--accent-gold) 85%, #e0ddd7 85%);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: background 0.1s;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-gold);
    box-shadow: 0 2px 8px rgba(197, 163, 103, 0.5);
    cursor: pointer;
    transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.quality-hints {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #bbb;
    margin-top: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* ── Size Inputs ──────────────────────────────── */
.size-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
}

.size-input-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.size-input-wrap label {
    font-size: 11px;
    color: #999;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.size-input-wrap input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-family: var(--main-font);
    font-size: 15px;
    background: #fff;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
    appearance: textfield;
}

.size-input-wrap input[type="number"]::-webkit-inner-spin-button,
.size-input-wrap input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.size-input-wrap input[type="number"]:focus {
    border-color: var(--accent-gold);
}

.size-link-icon {
    font-size: 20px;
    line-height: 1;
    user-select: none;
    padding-bottom: 10px;
    cursor: help;
    color: var(--accent-gold);
    transition: transform 0.2s;
}

.size-link-icon:hover {
    transform: rotate(15deg);
}

/* ── Toggle / Checkbox ────────────────────────── */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13.5px;
    color: #555;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-custom {
    width: 38px;
    height: 22px;
    background: #ddd;
    border-radius: 11px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.25s;
}

.toggle-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    transition: left 0.25s;
}

.toggle-label input:checked+.toggle-custom {
    background: var(--accent-gold);
}

.toggle-label input:checked+.toggle-custom::after {
    left: 19px;
}

/* ── Format Buttons ───────────────────────────── */
.format-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.format-row label {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.format-btns {
    display: flex;
    gap: 8px;
}

.fmt-btn input {
    display: none;
}

.fmt-btn span {
    display: block;
    padding: 6px 18px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #888;
    cursor: pointer;
    transition: 0.2s;
}

.fmt-btn input:checked+span {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #fff;
}

.fmt-btn span:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.fmt-btn input:checked+span:hover {
    color: #fff;
}

/* ── Submit Button ────────────────────────────── */
.btn-compress {
    width: 100%;
    padding: 18px;
    background: var(--accent-gold);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: var(--main-font);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-compress:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-compress:active {
    transform: translateY(0);
}

/* ── Result Card ──────────────────────────────── */
.result-card {
    animation: slide-up 0.4s ease both;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.result-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #999;
}

.result-count {
    color: var(--accent-gold);
    font-size: 14px;
    letter-spacing: 0;
    text-transform: none;
    font-weight: 700;
}

.btn-download-all {
    padding: 10px 22px;
    background: var(--accent-gold);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: var(--main-font);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.btn-download-all:hover {
    opacity: 0.85;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: var(--bg-color);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 16px;
    animation: slide-up 0.35s ease both;
}

.result-item .result-preview {
    width: 140px;
    height: 100px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eceae4;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0;
}

.result-item .result-preview img {
    max-width: 140px;
    max-height: 100px;
    border-radius: 10px;
    object-fit: contain;
}

.result-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-filename {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stat {
    background: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    min-width: 0;
}

.stat-label {
    display: block;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #bbb;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

.stat.positive .stat-value {
    color: #2e7d32;
    font-weight: 700;
}

.stat.negative .stat-value {
    color: #c62828;
}

.exif-ok {
    color: #2e7d32;
    font-weight: 700;
}

.btn-download {
    align-self: flex-start;
    padding: 10px 20px;
    background: transparent;
    border: 1.5px solid var(--accent-gold);
    border-radius: 10px;
    font-family: var(--main-font);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-gold);
    cursor: pointer;
    transition: 0.2s;
    margin-top: auto;
}

.btn-download:hover {
    background: var(--accent-gold);
    color: #fff;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
    .compress-card {
        padding: 24px 20px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-section:last-child {
        grid-column: auto;
    }

    .format-row {
        flex-wrap: wrap;
    }

    .result-item {
        flex-direction: column;
    }

    .result-item .result-preview {
        width: 100%;
        height: 160px;
    }

    .result-item .result-preview img {
        max-width: 100%;
        max-height: 160px;
    }

    .btn-download {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .size-row {
        flex-direction: column;
    }

    .size-link-icon {
        transform: rotate(90deg);
        padding: 4px 0;
    }

    .drop-thumb {
        width: 64px;
        height: 64px;
    }
}

/* ── Tab Bar ──────────────────────────────────── */
.tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #f5f3ef;
    border-radius: 18px;
    padding: 6px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
}

.tab-bar::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    background: transparent;
    border-radius: 13px;
    font-family: var(--main-font);
    font-size: 13px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: background 0.22s, color 0.22s, box-shadow 0.22s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: color 0.22s;
}

.tab-btn:hover {
    background: #fff;
    color: #444;
}

.tab-btn.active {
    background: #fff;
    color: var(--accent-gold);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.tab-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(197, 163, 103, 0.12);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-gold);
    letter-spacing: 0.3px;
    transition: background 0.2s;
}

.tab-btn.active .tab-badge {
    background: rgba(197, 163, 103, 0.2);
}

/* ── PDF Drop Zone ────────────────────────────── */
.pdf-drop .drop-icon svg {
    color: #e8382a;
    opacity: 0.75;
}

.pdf-drop:hover,
.pdf-drop.active {
    background: rgba(232, 56, 42, 0.04);
    border-color: #e8382a;
}

.large-drop-icon {
    width: 60px;
    height: 60px;
}

.pdf-large-drop {
    min-height: 220px;
    border-style: dashed;
    border-color: rgba(232, 56, 42, 0.4);
}

/* ── PDF File List Preview ────────────────────── */
.pdf-file-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 480px;
}

.pdf-file-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    gap: 12px;
}

.pdf-row-name {
    font-size: 12px;
    color: #444;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.pdf-row-size {
    font-size: 11px;
    font-weight: 600;
    color: #e8382a;
    flex-shrink: 0;
}

.pdf-file-row-more {
    font-size: 12px;
    color: #aaa;
    text-align: center;
    justify-content: center;
    font-style: italic;
}

/* ── Single PDF Preview ───────────────────────── */
.single-pdf-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 14px;
    border: 1px solid var(--border-color);
}

.single-pdf-svg {
    width: 40px;
    height: 48px;
    flex-shrink: 0;
}

.single-pdf-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.single-pdf-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    word-break: break-word;
}

.single-pdf-size {
    font-size: 12px;
    color: #e8382a;
    font-weight: 600;
}

/* ── PDF Info Box ─────────────────────────────── */
.pdf-info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(197, 163, 103, 0.07);
    border: 1px solid rgba(197, 163, 103, 0.2);
    border-radius: 12px;
    font-size: 13px;
    color: #666;
    line-height: 1.55;
    margin-bottom: 24px;
}

.pdf-info-box svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--accent-gold);
    margin-top: 1px;
}

.pdf-info-large {
    background: rgba(232, 56, 42, 0.04);
    border-color: rgba(232, 56, 42, 0.15);
}

.pdf-info-large svg {
    color: #e8382a;
}

/* ── PDF Result Item ──────────────────────────── */
.pdf-result-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background: var(--bg-color);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 16px;
    animation: slide-up 0.35s ease both;
}

.pdf-file-icon {
    width: 52px;
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-file-icon svg {
    width: 44px;
    height: 52px;
}

/* ── Responsive: Tabs ─────────────────────────── */
@media (max-width: 600px) {
    .tab-btn {
        padding: 10px 14px;
        font-size: 12px;
        gap: 6px;
    }

    .tab-badge {
        display: none;
    }

    .pdf-result-item {
        flex-direction: column;
    }
}

/* ── EXIF Help Button ─────────────────────────── */
.exif-help-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid rgba(197, 163, 103, 0.5);
    background: transparent;
    color: var(--accent-gold);
    font-size: 11px;
    font-weight: 700;
    font-family: var(--main-font);
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.exif-help-btn:hover {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
    color: #fff;
}

/* ── EXIF Popover ─────────────────────────────── */
.exif-popover {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    z-index: 200;
    width: 300px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    padding: 20px 20px 16px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity 0.2s, transform 0.2s;
}

.exif-popover.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.exif-popover-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #bbb;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
    transition: color 0.15s;
}

.exif-popover-close:hover {
    color: #555;
}

.exif-popover-title {
    font-size: 13px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    letter-spacing: 0.2px;
}

.exif-popover p {
    font-size: 12.5px;
    color: #555;
    line-height: 1.55;
    margin: 0 0 8px;
}

.exif-popover ul {
    margin: 0 0 10px 0;
    padding-left: 4px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.exif-popover ul li {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}

.exif-tip {
    font-size: 12px !important;
    color: #888 !important;
    background: rgba(197, 163, 103, 0.08);
    border-radius: 8px;
    padding: 8px 10px;
    margin: 0 !important;
    border-left: 2px solid var(--accent-gold);
}

@media (max-width: 480px) {
    .exif-popover {
        width: 260px;
        left: auto;
        right: 0;
    }
}

/* ── Превью PDF в зоне загрузки ───────────────────────────────── */
.pdf-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 480px;
    margin-top: 8px;
}

.pdf-file-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
}

.pdf-row-name {
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.pdf-row-size {
    color: #999;
    font-size: 12px;
    flex-shrink: 0;
}

.pdf-file-row-more {
    color: var(--accent-gold);
    font-weight: 600;
    justify-content: center;
    background: transparent;
}

/* ── Превью одного большого PDF ───────────────────────────────── */
.single-pdf-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 14px;
    margin-top: 8px;
    max-width: 420px;
    width: 100%;
}

.single-pdf-svg {
    width: 40px;
    height: 48px;
    flex-shrink: 0;
}

.single-pdf-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.single-pdf-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.single-pdf-size {
    font-size: 12px;
    color: #999;
}