/**
 * BotFend Anti-Bot Firewall - Unblock Requests Page Styles
 */

/* ============================================
   Container & Layout
   ============================================ */
.botfend-unblock-wrap {
    margin: 20px 20px 0 2px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Page Header */
.botfend-unblock-header {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 25px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.botfend-page-title {
    font-size: 1.8em;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Badges */
.botfend-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: #f0f0f1;
    color: #3c434a;
}

.botfend-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.botfend-badge-info {
    background: #e5f0fa;
    color: #2271b1;
}

/* ============================================
   Cards
   ============================================ */
.botfend-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    margin-bottom: 25px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.botfend-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.botfend-card-title {
    margin: 0;
    padding: 18px 22px;
    font-size: 1.15em;
    font-weight: 600;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.botfend-card-title .dashicons {
    color: #2271b1;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* ============================================
   Stats Grid
   ============================================ */
.botfend-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 22px;
}

.botfend-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.botfend-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: transparent;
}

.botfend-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--stat-bg, #f0f0f1);
}

.botfend-stat-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: var(--stat-color, #666);
}

.botfend-stat-content {
    flex: 1;
}

.botfend-stat-title {
    margin: 0 0 5px 0;
    font-size: 13px;
    font-weight: 500;
    color: #6c757d;
}

.botfend-stat-value {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.2;
}

/* Compact Stats for Quick Stats section */
.botfend-stats-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    padding: 15px 22px;
    background: #f8f9fa;
}

.botfend-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e5e5e5;
}

.botfend-stat-item:last-child {
    border-bottom: none;
}

.botfend-stat-item-label {
    font-size: 13px;
    color: #6c757d;
}

.botfend-stat-item-value {
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
}

/* ============================================
   Filter Form
   ============================================ */
.botfend-filter-form {
    padding: 22px;
}

.botfend-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.botfend-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.botfend-filter-label {
    font-size: 13px;
    font-weight: 500;
    color: #1d2327;
    display: flex;
    align-items: center;
    gap: 6px;
}

.botfend-filter-label .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #6c757d;
}

.botfend-filter-select,
.botfend-filter-input {
    padding: 10px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #fff;
}

.botfend-filter-select:focus,
.botfend-filter-input:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
    outline: none;
}

.botfend-date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.botfend-date-range .botfend-filter-input {
    flex: 1;
    min-width: 120px;
}

.botfend-date-separator {
    font-size: 12px;
    color: #6c757d;
}

.botfend-filter-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 10px;
}

.botfend-filter-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.botfend-filter-button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ============================================
   Bulk Action Bar
   ============================================ */
.botfend-bulk-bar {
    position: sticky;
    top: 32px;
    z-index: 100;
    background: #2271b1;
    color: #fff;
    border-radius: 12px;
    margin: 0 0 20px 0;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.botfend-bulk-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.botfend-bulk-count {
    font-size: 14px;
    font-weight: 500;
}

.botfend-bulk-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    background: #fff;
    color: #1d2327;
}

.botfend-bulk-button {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

/* ============================================
   Table Styles
   ============================================ */
.botfend-table-responsive {
    overflow-x: auto;
    margin: 0;
}

.botfend-unblock-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.botfend-unblock-table thead th {
    padding: 15px 12px;
    background: #f8f9fa;
    border-bottom: 2px solid #e5e5e5;
    font-weight: 600;
    color: #1d2327;
}

.botfend-unblock-table tbody td {
    padding: 16px 12px;
    border-bottom: 1px solid #e5e5e5;
    vertical-align: middle;
}

.botfend-unblock-table tbody tr:hover {
    background: #f8f9fa;
}

/* Column Widths */
.botfend-col-check { width: 40px; text-align: center; }
.botfend-col-id { width: 70px; }
.botfend-col-ip { width: 180px; }
.botfend-col-email { width: 200px; }
.botfend-col-reason { width: 250px; }
.botfend-col-status { width: 110px; }
.botfend-col-date { width: 120px; }
.botfend-col-whitelist { width: 130px; }
.botfend-col-actions { width: 180px; }

/* IP Cell */
.botfend-ip-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.botfend-ip-address {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
}

.botfend-ip-actions {
    display: flex;
    gap: 10px;
}

.botfend-action-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #2271b1;
    text-decoration: none;
}

.botfend-action-link:hover {
    color: #0a4b78;
    text-decoration: underline;
}

.botfend-action-link .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Email Link */
.botfend-email-link {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

.botfend-email-link:hover {
    text-decoration: underline;
}

/* Reason Cell */
.botfend-reason-cell {
    max-width: 250px;
}

.botfend-reason-text {
    font-size: 12px;
    line-height: 1.4;
    color: #3c434a;
}

.botfend-no-reason {
    color: #a7aaad;
    font-style: italic;
}

/* Status Badge */
.botfend-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.botfend-status-pending {
    background: #fff3cd;
    color: #856404;
}

.botfend-status-approved {
    background: #d4edda;
    color: #155724;
}

.botfend-status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.botfend-admin-action {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #6c757d;
    margin-top: 5px;
}

.botfend-admin-action .dashicons {
    font-size: 12px;
    width: 12px;
    height: 12px;
}

/* Date Cell */
.botfend-date-cell {
    font-size: 12px;
}

.botfend-time {
    font-size: 10px;
    color: #6c757d;
    margin-top: 2px;
}

/* Actions Cell */
.botfend-actions-cell {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.botfend-action-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.botfend-action-approve {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.botfend-action-approve:hover {
    background: #c3e6cb;
    border-color: #b1dfbb;
    color: #0b2e13;
}

.botfend-action-reject {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.botfend-action-reject:hover {
    background: #f5c6cb;
    border-color: #f1b0b7;
    color: #491217;
}

.botfend-action-delete {
    background: #f0f0f1;
    border-color: #c3c4c7;
    color: #dc3232;
}

.botfend-action-delete:hover {
    background: #dc3232;
    border-color: #c32c2c;
    color: #fff;
}

.botfend-action-button .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.botfend-action-text {
    display: inline-block;
}

/* Request ID */
.botfend-request-id {
    font-family: monospace;
    font-size: 12px;
    background: #f0f0f1;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ============================================
   Export Actions
   ============================================ */
.botfend-export-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    padding: 20px 22px;
}

.botfend-export-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 8px;
}

.botfend-export-actions .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ============================================
   Notice Styles
   ============================================ */
.botfend-notice {
    margin: 20px 0;
    border-radius: 8px;
    border-left-width: 4px;
}

/* ============================================
   Responsive Design (Mobile First)
   ============================================ */
@media (max-width: 782px) {
    .botfend-unblock-table thead {
        display: none;
    }

    .botfend-unblock-table tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #e5e5e5;
        border-radius: 12px;
        background: #fff;
        padding: 15px;
    }

    .botfend-unblock-table tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        padding: 10px 0;
        border-bottom: 1px solid #e5e5e5;
    }

    .botfend-unblock-table tbody td:last-child {
        border-bottom: none;
    }

    .botfend-unblock-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        width: 40%;
        color: #1d2327;
    }

    .botfend-col-check::before,
    .botfend-col-actions::before {
        display: none !important;
    }

    .botfend-col-check {
        justify-content: flex-start !important;
    }

    .botfend-actions-cell {
        justify-content: flex-end;
        width: 100%;
    }

    .botfend-bulk-bar {
        top: 46px;
        padding: 10px 15px;
    }

    .botfend-bulk-content {
        width: 100%;
        justify-content: space-between;
    }

    .botfend-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .botfend-filter-grid {
        grid-template-columns: 1fr;
    }

    .botfend-date-range {
        flex-direction: column;
        align-items: stretch;
    }

    .botfend-date-separator {
        text-align: center;
    }
}

/* Small screens */
@media (max-width: 600px) {
    .botfend-page-title {
        font-size: 1.4em;
    }

    .botfend-card-title {
        font-size: 1em;
        padding: 15px;
    }

    .botfend-stats-grid,
    .botfend-filter-form {
        padding: 15px;
    }

    .botfend-stat-value {
        font-size: 24px;
    }

    .botfend-action-text {
        display: none;
    }

    .botfend-action-button {
        padding: 6px 8px;
    }

    .botfend-action-button .dashicons {
        margin: 0;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .botfend-bulk-bar,
    .botfend-filter-actions,
    .botfend-export-actions,
    .botfend-col-actions,
    .botfend-col-check {
        display: none;
    }

    .botfend-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ============================================
   Animations & Utilities
   ============================================ */
.botfend-mb-20 {
    margin-bottom: 20px;
}

.botfend-mt-20 {
    margin-top: 20px;
}

/* Status row highlighting */
.botfend-status-pending-row {
    background: #fffef5;
}

.botfend-request-row {
    transition: background 0.2s ease;
}

/* Loading state */
.botfend-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.botfend-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}