/**
 * Activity Log Page Styles
 *
 * @package GuardDog
 * @since 1.8.0
 */

/* Form styling */
.guard-dog-custom-date-range {
    display: none;
}

.guard-dog-export-form {
    margin-top: 15px;
}

/* Activity Log Table */
.guard-dog-activity-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.guard-dog-activity-table th,
.guard-dog-activity-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.guard-dog-activity-table th {
    background: #f6f7f7;
    font-weight: 600;
}

.guard-dog-activity-table tr:hover {
    background: #f9f9f9;
}

/* Event Icons */
.guard-dog-event-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    text-align: center;
    border-radius: 3px;
    margin-right: 8px;
}

/* Login events */
.guard-dog-event-icon.login_successful,
.guard-dog-event-icon.login_failed,
.guard-dog-event-icon.login_blocked,
.guard-dog-event-icon.logout,
.guard-dog-event-icon.user_created,
.guard-dog-event-icon.user_deleted,
.guard-dog-event-icon.user_updated,
.guard-dog-event-icon.user_role_changed,
.guard-dog-event-icon.profile_updated,
.guard-dog-event-icon.password_reset {
    background: #2271b1;
    color: #fff;
}

/* Security events */
.guard-dog-event-icon.ip_blocked,
.guard-dog-event-icon.user_locked,
.guard-dog-event-icon.suspicious_activity,
.guard-dog-event-icon.temp_access_created,
.guard-dog-event-icon.temp_access_used {
    background: #d63638;
    color: #fff;
}

/* CAPTCHA events */
.guard-dog-event-icon.captcha_verified,
.guard-dog-event-icon.captcha_failed {
    background: #00a32a;
    color: #fff;
}

/* Two-factor events - using attribute selector to avoid CSS class name issues */
.guard-dog-event-icon[class*="2fa"] {
    background: #f56e28;
    color: #fff;
}

/* Content events */
.guard-dog-event-icon.post_created,
.guard-dog-event-icon.post_updated,
.guard-dog-event-icon.post_deleted,
.guard-dog-event-icon.post_status_changed,
.guard-dog-event-icon.post_trashed {
    background: #8c8f94;
    color: #fff;
}

.guard-dog-event-icon.comment_created,
.guard-dog-event-icon.comment_approved,
.guard-dog-event-icon.comment_spam,
.guard-dog-event-icon.comment_deleted {
    background: #8c8f94;
    color: #fff;
}

/* System events */
.guard-dog-event-icon.plugin_activated,
.guard-dog-event-icon.plugin_deactivated,
.guard-dog-event-icon.plugin_installed,
.guard-dog-event-icon.plugin_deleted {
    background: #8c8f94;
    color: #fff;
}

.guard-dog-event-icon.theme_switched,
.guard-dog-event-icon.theme_installed,
.guard-dog-event-icon.theme_deleted {
    background: #8c8f94;
    color: #fff;
}

.guard-dog-event-icon.core_updated,
.guard-dog-event-icon.settings_updated,
.guard-dog-event-icon.menu_created,
.guard-dog-event-icon.menu_updated,
.guard-dog-event-icon.menu_deleted,
.guard-dog-event-icon.widget_added,
.guard-dog-event-icon.widget_deleted {
    background: #8c8f94;
    color: #fff;
}

/* Event Severity */
.guard-dog-event-severity {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.guard-dog-event-severity.high {
    background: #d63638;
    color: #fff;
}

.guard-dog-event-severity.medium {
    background: #f56e28;
    color: #fff;
}

.guard-dog-event-severity.low {
    background: #00a32a;
    color: #fff;
}

/* Filters */
.guard-dog-activity-filters {
    background: #f6f7f7;
    padding: 15px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    margin-bottom: 20px;
}

.guard-dog-activity-filters form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.guard-dog-activity-filters select,
.guard-dog-activity-filters input {
    padding: 5px 10px;
    border: 1px solid #8c8f94;
    border-radius: 3px;
}

.guard-dog-activity-filters button {
    padding: 5px 15px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.guard-dog-activity-filters button:hover {
    background: #135e96;
}

.guard-dog-activity-filters .guard-dog-filters-row {
    display: flex;
    gap: 20px;
}

.guard-dog-activity-filters .guard-dog-filter-group label {
    margin-right: 6px;
}

/* Statistics */
.guard-dog-activity-stats {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

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

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

.guard-dog-stat-label {
    font-weight: 500;
    color: #50575e;
}

.guard-dog-stat-value {
    font-weight: 600;
    color: #2271b1;
}

/* Quick Actions */
.guard-dog-quick-actions {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 20px;
}

.guard-dog-quick-action-btn {
    display: block;
    width: calc(100% - 30px);
    padding: 10px 15px;
    margin-bottom: 10px;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    text-decoration: none;
    color: #50575e;
    text-align: center;
    transition: all 0.2s ease;
}

.guard-dog-quick-action-btn:hover {
    background: #fff;
    border-color: #2271b1;
    color: #2271b1;
}

.guard-dog-quick-action-btn.danger {
    background: #d63638;
    color: #fff;
    border-color: #d63638;
}

.guard-dog-quick-action-btn.danger:hover {
    background: #b32d2e;
    border-color: #b32d2e;
}

/* IP Address Cell with Reputation Check */
.guard-dog-ip-address-cell {
    position: relative;
}

.guard-dog-ip-address {
    display: inline-block;
    margin-right: 8px;
}

.guard-dog-check-ip-reputation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.guard-dog-check-ip-reputation:hover {
    background: #f0f0f1;
    border-color: #2271b1;
    color: #2271b1;
}

.guard-dog-check-ip-reputation:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.guard-dog-check-ip-reputation.loading {
    opacity: 0.6;
    cursor: wait;
}

.guard-dog-check-ip-reputation .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

/* IP Reputation Modal */
.guard-dog-ip-reputation-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.guard-dog-ip-reputation-modal-overlay.active {
    opacity: 1;
}

.guard-dog-ip-reputation-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.guard-dog-ip-reputation-modal-overlay.active .guard-dog-ip-reputation-modal {
    transform: scale(1);
}

.guard-dog-ip-reputation-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.guard-dog-ip-reputation-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.guard-dog-ip-reputation-modal-close {
    background: transparent;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #50575e;
    transition: color 0.2s ease;
}

.guard-dog-ip-reputation-modal-close:hover {
    color: #d63638;
}

.guard-dog-ip-reputation-modal-close .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.guard-dog-ip-reputation-modal-body {
    padding: 20px;
}

.guard-dog-ip-info {
    margin-bottom: 20px;
    font-size: 14px;
    color: #50575e;
}

.guard-dog-reputation-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 600;
}

.guard-dog-reputation-status.status-clean {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.guard-dog-reputation-status.status-low-risk {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.guard-dog-reputation-status.status-suspicious {
    background: #ffeaa7;
    color: #856404;
    border: 1px solid #fdcb6e;
}

.guard-dog-reputation-status.status-malicious {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.guard-dog-reputation-status .status-icon {
    font-size: 20px;
    font-weight: bold;
}

.guard-dog-reputation-details,
.guard-dog-location-details,
.guard-dog-network-details {
    margin-bottom: 20px;
}

.guard-dog-details-section-title {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e5e5;
}

.guard-dog-reputation-details .detail-row,
.guard-dog-location-details .detail-row,
.guard-dog-network-details .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f1;
}

.guard-dog-reputation-details .detail-row:last-child,
.guard-dog-location-details .detail-row:last-child,
.guard-dog-network-details .detail-row:last-child {
    border-bottom: none;
}

.guard-dog-reputation-details .detail-label,
.guard-dog-location-details .detail-label,
.guard-dog-network-details .detail-label {
    font-weight: 500;
    color: #50575e;
}

.guard-dog-reputation-details .detail-value,
.guard-dog-location-details .detail-value,
.guard-dog-network-details .detail-value {
    color: #2271b1;
    font-weight: 600;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.guard-dog-threat-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
}

.guard-dog-threat-section h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #50575e;
}

.guard-dog-threat-indicators {
    margin: 0;
    padding-left: 20px;
}

.guard-dog-threat-indicators li {
    margin-bottom: 5px;
    color: #721c24;
}

.guard-dog-no-threats {
    margin: 0;
    color: #155724;
    font-style: italic;
}

.guard-dog-blacklist-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
    margin-top: 20px;
}

.guard-dog-blacklist-section label {
    font-weight: 500;
    color: #50575e;
    white-space: nowrap;
}

.guard-dog-blacklist-expiration-input {
    width: 80px;
    padding: 5px 10px;
    border: 1px solid #8c8f94;
    border-radius: 3px;
}

.guard-dog-add-ip-to-blacklist-btn {
    margin-left: auto;
}

.guard-dog-add-ip-to-blacklist-btn.success {
    background: #00a32a;
    border-color: #00a32a;
}

/* Responsive Design */
@media (max-width: 782px) {
    .guard-dog-activity-filters form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .guard-dog-activity-table {
        font-size: 14px;
    }
    
    .guard-dog-activity-table th,
    .guard-dog-activity-table td {
        padding: 8px;
    }

    .guard-dog-ip-reputation-modal {
        max-width: 100%;
        margin: 10px;
    }

    .guard-dog-blacklist-section {
        flex-direction: column;
        align-items: stretch;
    }

    .guard-dog-blacklist-section label {
        margin-bottom: 5px;
    }

    .guard-dog-add-ip-to-blacklist-btn {
        margin-left: 0;
        width: 100%;
    }
} 
