/* ================================================================
   CleanPDF Bulk PDF Compressor — UI Styles
   Version: 1.2.0  (full-area click + drag)
   ================================================================ */

/* ---------- Drop Zone ---------- */
.drop-zone {
    position: relative;
    border: 3px dashed #cbd5e0;
    border-radius: 16px;
    text-align: center;
    background: #fafbfc;
    margin: 20px 0;
    transition: all 0.25s ease;
    cursor: pointer;
    outline: none;
}

.drop-zone:hover,
.drop-zone:focus {
    border-color: #e53e3e;
    background: #fff5f5;
}

.drop-zone.dragover {
    border-color: #e53e3e;
    border-style: solid;
    background: #fff5f5;
    transform: scale(1.01);
    box-shadow: 0 10px 30px rgba(229, 62, 62, 0.15);
}

/* Hidden native input */
.drop-zone input[type="file"] {
    display: none !important;
}

/* The label carries the padding — this makes the WHOLE visible
   area clickable (not just the inner text) */
.drop-zone-label {
    display: block;
    width: 100%;
    padding: 50px 20px;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Preview panel is also clickable via its own label */
.preview-content {
    text-align: center;
    padding: 50px 20px;
    display: block;
    width: 100%;
}

.drop-zone .file-icon {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}
.drop-zone .file-icon strong {
    font-size: 1.05rem;
    color: #2d3748;
}

.drop-zone p {
    margin: 0.35rem 0;
    color: #4a5568;
}
.drop-zone p strong {
    color: #2d3748;
}

.change-files-btn {
    margin-top: 15px;
    color: #4299e1;
    font-size: 0.85rem;
    border: 1px solid #4299e1;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    transition: all 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.change-files-btn:hover {
    background: #4299e1;
    color: #fff;
}

/* ---------- Control Group ---------- */
.control-group {
    background: #f9fafb;
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}
.control-group > label {
    font-weight: 600;
    color: #2d3748;
    display: block;
    margin-bottom: 0.5rem;
}
.custom-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    color: #2d3748;
    cursor: pointer;
    transition: border-color 0.2s;
}
.custom-select:focus {
    outline: none;
    border-color: #4f46e5;
}

/* ---------- Global Target ---------- */
.global-target-block {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
}
.global-target-label {
    font-weight: 600;
    color: #2d3748;
    display: block;
    margin-bottom: 0.5rem;
}
.global-target-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}
.global-target-value {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}
.global-target-value:focus {
    outline: none;
    border-color: #4f46e5;
}
.global-target-unit {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    min-width: 90px;
    cursor: pointer;
}
.global-target-unit:focus {
    outline: none;
    border-color: #4f46e5;
}
.apply-target-btn {
    padding: 10px 20px;
    min-width: auto;
    font-size: 0.95rem;
    border-radius: 8px;
    background: #4f46e5;
    color: #fff;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.apply-target-btn:hover {
    background: #4338ca;
    transform: translateY(-1px);
}
.apply-target-btn:active {
    transform: translateY(0);
}
.global-target-hint {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* ---------- Metadata checkbox ---------- */
.metadata-row {
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
    cursor: pointer;
}
.metadata-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ---------- File List ---------- */
.file-list {
    margin-top: 2rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #fff;
}
.file-list-header {
    display: grid;
    grid-template-columns: 2fr 0.9fr 1.4fr 0.9fr 0.8fr 0.9fr 1fr;
    gap: 0.5rem;
    padding: 0.85rem 0.75rem;
    background: #edf2f7;
    font-weight: 600;
    font-size: 0.85rem;
    color: #2d3748;
    border-bottom: 1px solid #e2e8f0;
}
.file-row {
    display: grid;
    grid-template-columns: 2fr 0.9fr 1.4fr 0.9fr 0.8fr 0.9fr 1fr;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
    transition: background 0.15s;
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: #f7fafc; }
.file-row .fname {
    word-break: break-all;
    font-weight: 500;
    color: #1a202c;
}
.file-row .target-cell {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}
.file-row .target-cell input {
    width: 70px;
    padding: 5px 8px;
    border: 1.5px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
    transition: border-color 0.15s;
}
.file-row .target-cell input:focus {
    outline: none;
    border-color: #4f46e5;
}
.file-row .target-cell select {
    padding: 5px 6px;
    border: 1.5px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.8rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s;
}
.file-row .target-cell select:focus {
    outline: none;
    border-color: #4f46e5;
}

/* ---------- Status Badges ---------- */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.status-pending { background: #e2e8f0; color: #4a5568; }
.status-working { background: #fef3c7; color: #92400e; }
.status-done    { background: #d1fae5; color: #065f46; }
.status-error   { background: #fee2e2; color: #991b1b; }
.status-exact   { background: #d1fae5; color: #065f46; }

/* ---------- Row Download Button ---------- */
.row-download-btn {
    padding: 5px 10px;
    font-size: 0.8rem;
    border-radius: 6px;
    background: #059669;
    color: #fff;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    transition: background 0.15s;
}
.row-download-btn:hover { background: #047857; }
.row-download-btn.disabled {
    background: #cbd5e0;
    color: #718096;
    cursor: not-allowed;
    pointer-events: none;
}

/* ---------- Progress Bar ---------- */
.progress-wrap {
    display: none;
    max-width: 520px;
    margin: 1.5rem auto;
}
.progress-wrap.active { display: block; }
.progress-bar-outer {
    width: 100%;
    height: 22px;
    background: #e2e8f0;
    border-radius: 11px;
    overflow: hidden;
}
.progress-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    transition: width 0.3s ease;
}
.progress-label {
    text-align: center;
    margin-top: 8px;
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 600;
}

/* ---------- Download-All Section ---------- */
.download-all-area {
    display: none;
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 12px;
    text-align: center;
}
.download-all-area.active { display: block; }
.download-all-area h2 {
    color: #2f855a;
    margin-bottom: 1rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .file-list-header { display: none !important; }
    .file-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 1rem;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }
    .file-row > span::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #4a5568;
        margin-right: 0.35rem;
    }
    .global-target-row { flex-direction: column; align-items: stretch; }
    .global-target-value,
    .global-target-unit,
    .apply-target-btn { width: 100%; }
    .drop-zone-label,
    .preview-content { padding: 30px 15px; }
}