/* ===================================================================
   LINK FASTADS — BULK UPLOAD MODULE STYLES (v1.0)
   ใช้ prefix .bulk-* เพื่อไม่ชนกับ class เดิม
   =================================================================== */

/* ── Modal shell ──────────────────────────────────────────────── */
.bulk-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 25, 40, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 30px 20px;
    overflow-y: auto;
}
.bulk-modal-content {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 880px;
    max-height: calc(100vh - 60px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: bulkSlideIn 0.25s ease-out;
}
@keyframes bulkSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.bulk-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    background: linear-gradient(135deg, #1e3a5f, #2980b9);
    color: #fff;
    border-bottom: 1px solid #e4e9f0;
}
.bulk-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.bulk-close-btn {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s;
}
.bulk-close-btn:hover { background: rgba(255,255,255,0.3); }

.bulk-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
}

.bulk-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px;
    border-top: 1px solid #e4e9f0;
    background: #f9fbfc;
}

/* ── Steps ────────────────────────────────────────────────────── */
.bulk-step {
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px dashed #e4e9f0;
}
.bulk-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.bulk-step-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a2332;
    margin-bottom: 12px;
}
.bulk-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #2980b9;
    color: #fff;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
}

/* ── Target form (Group + Version) ────────────────────────────── */
.bulk-target-grid {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 14px;
}
.bulk-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.bulk-field label {
    font-size: 0.82rem;
    font-weight: 500;
    color: #555;
}
.bulk-field select,
.bulk-field input[type="text"] {
    height: 38px;
    padding: 0 12px;
    border: 1px solid #d5dbe4;
    border-radius: 7px;
    font-size: 0.88rem;
    background: #f9fbfd;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.bulk-field select:focus,
.bulk-field input[type="text"]:focus {
    border-color: #2980b9;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(41,128,185,0.12);
}
.bulk-hint {
    font-size: 0.72rem;
    color: #95a5a6;
}

/* ── Drop zone ────────────────────────────────────────────────── */
.bulk-drop-zone {
    border: 2px dashed #c0cad6;
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    background: #f9fbfd;
    cursor: pointer;
    transition: all 0.18s ease;
}
.bulk-drop-zone:hover,
.bulk-drop-zone.drag-over {
    border-color: #2980b9;
    background: #ebf5fb;
    transform: translateY(-1px);
}
.bulk-drop-icon {
    font-size: 2.2rem;
    color: #2980b9;
    margin-bottom: 10px;
}
.bulk-drop-text {
    font-size: 0.95rem;
    color: #2c3e50;
    margin-bottom: 6px;
}
.bulk-drop-text b { color: #2980b9; }
.bulk-drop-hint {
    font-size: 0.78rem;
    color: #7f8c9b;
}
.bulk-drop-hint code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.78rem;
    color: #c0392b;
}

/* ── Summary area ─────────────────────────────────────────────── */
.bulk-summary-empty {
    text-align: center;
    padding: 30px 20px;
    color: #95a5a6;
    font-style: italic;
    background: #f9fbfd;
    border: 1px dashed #d5dbe4;
    border-radius: 8px;
    font-size: 0.88rem;
}

.bulk-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.bulk-stat {
    background: #fff;
    border: 1px solid #e4e9f0;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}
.bulk-stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}
.bulk-stat-lbl {
    font-size: 0.72rem;
    color: #7f8c9b;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.bulk-stat-total .bulk-stat-num { color: #2c3e50; }
.bulk-stat-ok    .bulk-stat-num { color: #27ae60; }
.bulk-stat-skip  .bulk-stat-num { color: #95a5a6; }
.bulk-stat-miss  .bulk-stat-num { color: #e67e22; }

.bulk-info, .bulk-warn, .bulk-warn-soft {
    padding: 10px 14px;
    border-radius: 7px;
    font-size: 0.85rem;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}
.bulk-info {
    background: #eaf4fb;
    border: 1px solid #aed6f1;
    color: #1a5276;
}
.bulk-warn {
    background: #fdebd0;
    border: 1px solid #f5cba7;
    color: #9c5a13;
}
.bulk-warn-soft {
    background: #fff8e1;
    border: 1px solid #ffe082;
    color: #856404;
}
.bulk-warn-soft code,
.bulk-info code {
    background: rgba(0,0,0,0.06);
    padding: 1px 6px;
    border-radius: 4px;
    margin: 0 2px;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
}

/* ── Files table ──────────────────────────────────────────────── */
.bulk-table-wrap {
    border: 1px solid #e4e9f0;
    border-radius: 8px;
    overflow: hidden;
    overflow-x: auto;
}
.bulk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.bulk-table thead {
    background: #f4f7fb;
}
.bulk-table th {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #5d6d7e;
    border-bottom: 1px solid #dde3ed;
    white-space: nowrap;
}
.bulk-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f3f7;
    vertical-align: middle;
    color: #2c3e50;
}
.bulk-table tbody tr:last-child td { border-bottom: none; }
.bulk-table tbody tr:hover { background: #f9fbfd; }
.bulk-table code {
    background: #f4f7fb;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.78rem;
    color: #1a6fa8;
}
.bulk-table .bulk-row-skip { background: #fafbfc; opacity: 0.85; }
.bulk-table .bulk-row-skip code { background: #eee; color: #95a5a6; }

.bulk-muted { color: #aab2bd; font-style: italic; }

/* ── Badges ───────────────────────────────────────────────────── */
.bulk-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
}
.bulk-badge-ok    { background: #e8f5e9; color: #1e7e34; border: 1px solid #a5d6a7; }
.bulk-badge-warn  { background: #fdebd0; color: #9c5a13; border: 1px solid #f5cba7; }
.bulk-badge-skip  { background: #ecf0f1; color: #707b7c; border: 1px solid #d5dbdb; }
.bulk-badge-err   { background: #fdecea; color: #a93226; border: 1px solid #f5b7b1; }

/* ── Buttons ──────────────────────────────────────────────────── */
.bulk-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.bulk-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.bulk-btn:active:not(:disabled) { transform: scale(0.97); }

.bulk-btn-primary {
    background: #2980b9;
    color: #fff;
    border-color: #2471a3;
}
.bulk-btn-primary:hover:not(:disabled) {
    background: #2471a3;
    box-shadow: 0 3px 10px rgba(41,128,185,0.3);
}
.bulk-btn-ghost {
    background: #fff;
    color: #5d6d7e;
    border-color: #d5dbe4;
}
.bulk-btn-ghost:hover:not(:disabled) {
    background: #ecf0f1;
    color: #2c3e50;
}

/* ── Progress ─────────────────────────────────────────────────── */
.bulk-status-area {
    margin-top: 16px;
    padding: 14px;
    background: #f9fbfd;
    border: 1px solid #e4e9f0;
    border-radius: 8px;
}
.bulk-progress-head {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a2332;
    margin-bottom: 10px;
}
.bulk-progress-bar {
    height: 8px;
    background: #e4e9f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}
.bulk-progress-bar > div {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    transition: width 0.25s ease;
    border-radius: 4px;
}
.bulk-progress-log {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.78rem;
    background: #fff;
    border: 1px solid #e4e9f0;
    border-radius: 6px;
    padding: 8px 10px;
    font-family: 'Courier New', monospace;
}
.bulk-progress-log > div {
    padding: 3px 0;
    border-bottom: 1px solid #f5f5f5;
}
.bulk-progress-log > div:last-child { border-bottom: none; }
.bulk-log-ok  { color: #27ae60; font-weight: 600; margin-left: 6px; }
.bulk-log-err { color: #c0392b; font-weight: 600; margin-left: 6px; }

/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .bulk-modal { padding: 12px; }
    .bulk-modal-content { max-height: calc(100vh - 24px); }
    .bulk-modal-body { padding: 16px; }
    .bulk-target-grid { grid-template-columns: 1fr; }
    .bulk-stats-row { grid-template-columns: repeat(2, 1fr); }
    .bulk-table { font-size: 0.76rem; }
    .bulk-table th, .bulk-table td { padding: 8px 9px; }
    .bulk-modal-footer { flex-direction: column-reverse; }
    .bulk-modal-footer .bulk-btn { width: 100%; justify-content: center; }
}