/**
 * Admin styles for Broken Link Auto Fixer
 *
 * @link    https://codesala.in
 * @since   1.0.0
 * @package Broken_Link_Auto_Fixer
 * @author  Bikas Kumar <bikas@codesala.in>
 */

/* ─── Layout ──────────────────────────────────────────────────────── */
.blaf-wrap {
    max-width: 1200px;
}

.blaf-page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 23px;
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 4px;
}

.blaf-page-title .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #d63638;
}

.blaf-version {
    font-size: 12px;
    background: #f0f0f1;
    color: #50575e;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 400;
}

.blaf-tagline {
    color: #646970;
    margin-bottom: 20px;
    font-size: 13px;
}

.blaf-tagline a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 600;
}

/* ─── Card ────────────────────────────────────────────────────────── */
.blaf-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

/* ─── Scan Controls ───────────────────────────────────────────────── */
.blaf-scan-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.blaf-scan-controls .button .dashicons {
    vertical-align: middle;
    margin-right: 4px;
    margin-top: -2px;
}

/* ─── Progress Bar ────────────────────────────────────────────────── */
.blaf-progress-wrap {
    margin-top: 16px;
}

.blaf-progress-bar-outer {
    width: 100%;
    background: #f0f0f1;
    border-radius: 4px;
    height: 12px;
    overflow: hidden;
}

.blaf-progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, #2271b1, #135e96);
    width: 0%;
    border-radius: 4px;
    transition: width 0.4s ease;
    animation: blaf-pulse 1.5s ease-in-out infinite;
}

@keyframes blaf-pulse {
    0%   { opacity: 1; }
    50%  { opacity: 0.7; }
    100% { opacity: 1; }
}

.blaf-scan-status {
    margin: 8px 0 0;
    color: #50575e;
    font-size: 13px;
}

/* ─── Notice ──────────────────────────────────────────────────────── */
.blaf-notice {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
}

.blaf-notice.blaf-notice-success {
    background: #edfaef;
    border-left: 4px solid #00a32a;
    color: #1a5b25;
}

.blaf-notice.blaf-notice-error {
    background: #fbeaea;
    border-left: 4px solid #d63638;
    color: #6b1414;
}

/* ─── Stats Bar ───────────────────────────────────────────────────── */
.blaf-stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.blaf-stat-box {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.blaf-stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #d63638;
    line-height: 1;
}

.blaf-stat-label {
    font-size: 12px;
    color: #646970;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Table ───────────────────────────────────────────────────────── */
.blaf-table {
    border-radius: 4px;
    overflow: hidden;
}

.blaf-table th {
    font-weight: 600;
    font-size: 13px;
    color: #1d2327;
}

.column-id     { width: 50px; }
.column-post   { width: 180px; }
.column-url    { width: auto; }
.column-anchor { width: 130px; }
.column-code   { width: 100px; text-align: center; }
.column-date   { width: 140px; }
.column-actions{ width: 220px; }

.blaf-broken-url {
    color: #d63638;
    word-break: break-all;
    font-size: 12px;
}

/* ─── HTTP Badge ──────────────────────────────────────────────────── */
.blaf-http-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.blaf-code-404 { background: #fbeaea; color: #d63638; }
.blaf-code-500 { background: #fef8ee; color: #996800; }
.blaf-code-403 { background: #f0f6fc; color: #2271b1; }
.blaf-code-410 { background: #fbeaea; color: #d63638; }
.blaf-code-0   { background: #f0f0f1; color: #50575e; }

/* ─── Action Buttons ──────────────────────────────────────────────── */
.column-actions .button {
    margin-right: 4px;
    margin-bottom: 4px;
    font-size: 12px;
    padding: 0 8px;
    height: 26px;
    line-height: 24px;
}

.column-actions .button .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 2px;
    margin-top: -1px;
}

.blaf-btn-replace .dashicons { color: #2271b1; }
.blaf-btn-remove  .dashicons { color: #d63638; }
.blaf-btn-ignore  .dashicons { color: #646970; }

/* ─── Empty State ─────────────────────────────────────────────────── */
.blaf-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #646970;
}

.blaf-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #00a32a;
    display: block;
    margin: 0 auto 12px;
}

.blaf-empty-state p {
    font-size: 15px;
    margin: 0;
}

/* ─── Pagination ──────────────────────────────────────────────────── */
.blaf-pagination {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

/* ─── Settings Page ───────────────────────────────────────────────── */
.blaf-settings-table th {
    width: 220px;
    padding: 16px 10px 16px 0;
}

.blaf-settings-table td {
    padding: 14px 10px;
}

.blaf-settings-table .description {
    color: #646970;
    font-size: 12px;
    margin-top: 4px;
}

/* Toggle Switch */
.blaf-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.blaf-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.blaf-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #c3c4c7;
    border-radius: 34px;
    transition: .3s;
}

.blaf-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
}

.blaf-toggle input:checked + .blaf-toggle-slider {
    background-color: #2271b1;
}

.blaf-toggle input:checked + .blaf-toggle-slider:before {
    transform: translateX(20px);
}

/* Info Card */
.blaf-info-card {
    background: #f8f9fa;
}

.blaf-info-card h2 {
    margin-top: 0;
    font-size: 15px;
}

/* Spinner overlay on buttons */
.blaf-spinning {
    opacity: 0.7;
    pointer-events: none;
}

/* Row fade-out on action */
.blaf-row-fading {
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* ─── Bulk Actions Bar (since 2.0.0) ──────────────────────────────── */
.blaf-bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 16px;
    border-bottom: 1px solid #dcdcde;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.blaf-bulk-actions select {
    min-width: 260px;
    height: 32px;
}

.blaf-bulk-count {
    color: #50575e;
    font-size: 13px;
    font-weight: 500;
    margin-left: 6px;
}

.column-check {
    width: 2.2em !important;
    padding: 8px 0 8px 6px !important;
    vertical-align: middle;
    text-align: center;
}

/* ─── Bulk Redirect Modal (since 2.0.0) ───────────────────────────── */
.blaf-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 20, 0.55);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.blaf-modal {
    background: #fff;
    border-radius: 6px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    animation: blaf-modal-in 0.18s ease-out;
}

@keyframes blaf-modal-in {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.blaf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #dcdcde;
}

.blaf-modal-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #1d2327;
}

.blaf-modal-close {
    background: transparent;
    border: 0;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #646970;
    padding: 4px 8px;
}

.blaf-modal-close:hover { color: #d63638; }

.blaf-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.blaf-modal-help {
    color: #50575e;
    margin: 0 0 12px;
    font-size: 13px;
}

.blaf-modal-table-wrap {
    max-height: 55vh;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.blaf-redirect-table th,
.blaf-redirect-table td {
    padding: 10px 12px;
    vertical-align: middle;
}

.blaf-redirect-table .blaf-old-url {
    color: #d63638;
    word-break: break-all;
    font-size: 12px;
    font-family: Consolas, Menlo, Monaco, monospace;
}

.blaf-new-url-input {
    width: 100%;
}

.blaf-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #dcdcde;
    background: #f6f7f7;
    border-radius: 0 0 6px 6px;
}

@media (max-width: 640px) {
    .blaf-modal {
        max-width: 100%;
    }
    .blaf-bulk-actions select {
        min-width: 100%;
    }
}
