/* ============================================================
   Compress PDF Tool — compress-pdf.css
   Prefix: cp-
   Accent: #8B5CF6  (website violet)
   Accent RGB: 139, 92, 246
   ============================================================ */

/* ── Accent override for tool-base shared classes ─────────── */
.cp-section {
    --tool-accent: #8B5CF6;
    --tool-accent-rgb: 139, 92, 246;
    padding: 40px 0 80px;
}

/* ── Section badge ─────────────────────────────────────────── */
.cp-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 18px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.22);
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #8B5CF6;
    margin-bottom: 12px;
}

.cp-badge i {
    font-size: 0.875rem;
}

/* ── Upload Zone ───────────────────────────────────────────── */
.cp-upload-zone {
    border: 2px dashed rgba(139, 92, 246, 0.32);
    border-radius: 16px;
    background: rgba(139, 92, 246, 0.03);
    padding: 56px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    outline: none;
}

.cp-upload-zone:hover,
.cp-upload-zone:focus-visible {
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(139, 92, 246, 0.07);
}

.cp-upload-zone.cp-drag-over {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.1);
}

.cp-upload-icon {
    font-size: 3rem;
    color: #8B5CF6;
    opacity: 0.65;
    margin-bottom: 14px;
    display: block;
}

.cp-upload-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.cp-upload-sub {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 10px;
}

.cp-upload-formats {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
    letter-spacing: 0.01em;
}

/* ── Workspace ─────────────────────────────────────────────── */
.cp-workspace {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── File Info Bar ─────────────────────────────────────────── */
.cp-file-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #F8FAFC;
    border: 1px solid rgba(100, 116, 139, 0.14);
    border-radius: 12px;
}

.cp-file-info-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 10px;
    color: #8B5CF6;
    font-size: 1.25rem;
}

.cp-file-info-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cp-file-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cp-file-meta {
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* ── Section Label ─────────────────────────────────────────── */
.cp-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin: 0 0 10px;
}

/* ── Compression Level Cards ───────────────────────────────── */
.cp-level-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.cp-level-card {
    position: relative;
    cursor: pointer;
}

.cp-level-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cp-level-card-inner {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 16px;
    background: #fff;
    border: 2px solid rgba(100, 116, 139, 0.18);
    border-radius: 12px;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
    height: 100%;
    box-sizing: border-box;
}

.cp-level-card:hover .cp-level-card-inner {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.02);
}

.cp-level-card input[type="radio"]:checked~.cp-level-card-inner {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.05);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.cp-level-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.cp-level-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.18s;
}

.cp-level-card input[type="radio"]:checked~.cp-level-card-inner .cp-level-name {
    color: #8B5CF6;
}

.cp-level-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 50px;
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
    border: 1px solid rgba(139, 92, 246, 0.2);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.cp-level-reduction {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #16A34A;
}

.cp-level-desc {
    font-size: 0.8rem;
    color: var(--text-light);
    line-height: 1.45;
}

/* ── Options (toggles) ─────────────────────────────────────── */
.cp-options-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px;
    background: #F8FAFC;
    border: 1px solid rgba(100, 116, 139, 0.14);
    border-radius: 12px;
}

.cp-option-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

/* Hide native checkbox */
.cp-option-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Toggle track */
.cp-option-track {
    flex-shrink: 0;
    position: relative;
    width: 40px;
    height: 22px;
    background: rgba(100, 116, 139, 0.25);
    border-radius: 50px;
    transition: background 0.2s;
    margin-top: 2px;
}

.cp-option-item input[type="checkbox"]:checked~.cp-option-track {
    background: #8B5CF6;
}

/* Toggle thumb */
.cp-option-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

.cp-option-item input[type="checkbox"]:checked~.cp-option-track .cp-option-thumb {
    transform: translateX(18px);
}

/* Option text block */
.cp-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cp-option-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cp-option-desc {
    font-size: 0.8125rem;
    color: var(--text-light);
    line-height: 1.45;
}

/* ── Action Panel ──────────────────────────────────────────── */
.cp-action-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Output Row ────────────────────────────────────────────── */
.cp-output-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cp-output-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.cp-output-input-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid rgba(100, 116, 139, 0.22);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
    flex: 1;
    min-width: 180px;
    max-width: 360px;
}

.cp-output-input-wrap:focus-within {
    border-color: #8B5CF6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.cp-output-input {
    flex: 1;
    padding: 9px 12px;
    border: none;
    outline: none;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: transparent;
    font-family: inherit;
    min-width: 0;
}

.cp-output-ext {
    padding: 9px 12px;
    background: rgba(100, 116, 139, 0.07);
    font-size: 0.875rem;
    color: var(--text-light);
    border-left: 1px solid rgba(100, 116, 139, 0.15);
    white-space: nowrap;
}

/* ── Action Row (buttons) ──────────────────────────────────── */
.cp-action-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── Progress ──────────────────────────────────────────────── */
.cp-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cp-progress-bar {
    height: 8px;
    background: rgba(100, 116, 139, 0.12);
    border-radius: 50px;
    overflow: hidden;
}

.cp-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8B5CF6, #a78bfa);
    border-radius: 50px;
    transition: width 0.3s ease;
}

.cp-progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
    text-align: center;
}

/* ── Result Panel ──────────────────────────────────────────── */
.cp-result {
    padding: 22px 20px;
    background: rgba(22, 163, 74, 0.04);
    border: 1px solid rgba(22, 163, 74, 0.22);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cp-result-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cp-result-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.cp-result-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cp-result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.cp-result-value--compressed {
    color: #16A34A;
}

.cp-result-arrow {
    color: #94a3b8;
    font-size: 1.375rem;
    flex-shrink: 0;
}

.cp-result-savings {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 20px;
    background: rgba(22, 163, 74, 0.1);
    border: 1px solid rgba(22, 163, 74, 0.25);
    border-radius: 10px;
    min-width: 90px;
}

.cp-result-savings--warn {
    background: rgba(234, 179, 8, 0.08);
    border-color: rgba(234, 179, 8, 0.28);
}

.cp-savings-pct {
    font-size: 1.5rem;
    font-weight: 700;
    color: #16A34A;
}

.cp-result-savings--warn .cp-savings-pct {
    color: #854d0e;
}

.cp-savings-label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #16A34A;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cp-result-savings--warn .cp-savings-label {
    color: #854d0e;
}

.cp-result-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 680px) {
    .cp-level-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .cp-output-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .cp-output-input-wrap {
        max-width: 100%;
        width: 100%;
    }

    .cp-result-comparison {
        gap: 14px;
    }
}

@media (max-width: 400px) {
    .cp-file-info {
        flex-wrap: wrap;
    }

    .cp-result-value {
        font-size: 1.25rem;
    }

    .cp-savings-pct {
        font-size: 1.25rem;
    }
}