/**
 * BotFend Anti-Bot Firewall - Dashboard Styles
 * Modern Design (CSS A) Applied — All Functionality Preserved
 * @version 5.0.0
 */

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

/* Header */
.botfend-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 24px;
    padding: 15px 0;
}

.botfend-header-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.botfend-page-title {
    font-size: 1.8em;
    font-weight: 600;
    margin: 0;
    color: #1d2327;
}

.botfend-version-badge {
    background: linear-gradient(135deg, #3b82f6 0%, #2271b1 100%);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

/* Centralized Firewall Banner */
.botfend-central-firewall-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px 30px;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.botfend-central-firewall-banner:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.botfend-cfb-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.botfend-cfb-content .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
}

.botfend-cfb-text h2 {
    margin: 0 0 5px 0;
    font-size: 1.4em;
    font-weight: 600;
    color: #1d2327;
}

.botfend-cfb-text p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.botfend-fw-btn {
    color: #ffffff !important;
    text-shadow: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    padding: 8px 24px !important;
    font-weight: 500 !important;
    border-radius: 10px !important;
    transition: all 0.2s ease !important;
}

.botfend-fw-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
}

/* Protection Card */
.botfend-protection-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.botfend-protection-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.botfend-protection-header .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: #10b981;
}

.botfend-protection-header h2 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 500;
    color: #ffffff;
    flex: 1;
}

.botfend-protection-body {
    padding: 25px;
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    align-items: center;
    justify-content: space-between;
}

/* Score Circle */
.botfend-score-container {
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.botfend-score-circle {
    position: relative;
    width: 140px;
    height: 140px;
}

.botfend-score-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.botfend-score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.botfend-score-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.botfend-score-level {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-top: 5px;
}

.botfend-score-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.botfend-stat-item {
    background: rgba(255, 255, 255, 0.08);
    padding: 10px 16px;
    border-radius: 10px;
    min-width: 150px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s ease;
}

.botfend-stat-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.botfend-stat-label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}

.botfend-stat-number {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
}

/* Quick Stats */
.botfend-quick-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.05);
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.botfend-quick-stat {
    display: flex;
    align-items: center;
    gap: 12px;
}

.botfend-quick-stat .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #10b981;
}

.botfend-quick-stat-value {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.botfend-quick-stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* Threat Intelligence Cards */
.botfend-threat-intel-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.botfend-threat-intel-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

.botfend-card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    display: flex;
    align-items: center;
    gap: 10px;
}

.botfend-card-header .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #3b82f6;
}

.botfend-threat-intel-card .botfend-card-header .dashicons-hidden,
.botfend-threat-intel-card .botfend-card-header .dashicons-privacy {
    color: #7b4397 !important;
}

.botfend-card-header h3 {
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

.botfend-threat-intel-body {
    padding: 20px;
}

.botfend-threat-summary-banner {
    margin: 0 0 20px 0 !important;
    padding: 15px 20px !important;
    border-left-width: 4px !important;
    border-radius: 8px;
}

.botfend-threat-summary-banner p {
    margin: 0;
    font-size: 14px;
}

.botfend-top-offenders-table {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.botfend-flag-icon {
    vertical-align: middle;
    margin-right: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.botfend-badge-blocked {
    background: #ef4444;
    color: #ffffff;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* TOR Node Count */
.botfend-tor-node-count {
    font-size: 28px;
    font-weight: 600;
    color: #7b4397;
    margin: 12px 0 8px;
    line-height: 1;
}

.botfend-tor-node-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.botfend-tor-last-updated {
    font-size: 13px;
    color: #64748b;
}

/* TOR Status Badges */
.botfend-tor-status-active {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.botfend-tor-status-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.botfend-tor-status-disabled {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* TOR Action Colors */
.botfend-tor-action-block { color: #ef4444; }
.botfend-tor-action-challenge { color: #3b82f6; }
.botfend-tor-action-score { color: #f59e0b; }
.botfend-tor-action-log { color: #64748b; }

/* Actions Row */
.botfend-actions-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.botfend-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.botfend-action-btn:hover {
    background: #ffffff;
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.botfend-action-btn .dashicons {
    color: #3b82f6;
}

/* Recommendations Card */
.botfend-recommendations-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

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

.botfend-recommendations-card .botfend-card-header .dashicons {
    color: #f59e0b;
}

.botfend-recommendations-list {
    display: flex;
    flex-direction: column;
}

.botfend-recommendation-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: #1e293b;
    transition: background 0.2s ease;
}

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

.botfend-recommendation-item:hover {
    background: #f8fafc;
}

.botfend-rec-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.botfend-rec-left .dashicons {
    color: #f59e0b;
}

.botfend-rec-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.botfend-recommendation-weight {
    font-size: 12px;
    font-weight: 500;
    color: #059669;
    background: #d1fae5;
    padding: 4px 12px;
    border-radius: 20px;
}

.botfend-rec-arrow {
    color: #94a3b8;
    transition: all 0.2s ease;
}

.botfend-recommendation-item:hover .botfend-rec-arrow {
    color: #3b82f6;
    transform: translateX(3px);
}

/* Tools Card */
.botfend-tools-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

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

.botfend-tools-card .botfend-card-header .dashicons {
    color: #64748b;
}

.botfend-tools-list {
    display: flex;
    flex-direction: column;
}

.botfend-tool-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    text-decoration: none;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

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

.botfend-tool-item:hover {
    background: #f8fafc;
}

.botfend-tool-item .dashicons {
    color: #94a3b8;
}

/* Section Toggle */
.botfend-section-toggle {
    margin-left: auto;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

/* Toast Notifications */
.botfend-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    border-radius: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

.botfend-toast.show {
    transform: translateX(0);
}

.botfend-toast.success { background: #10b981; }
.botfend-toast.error { background: #ef4444; }
.botfend-toast.warning { background: #f59e0b; }

.botfend-toast .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Tooltip */
.botfend-tooltip-box {
    position: absolute;
    background: #1e293b;
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.botfend-tooltip-box.visible {
    opacity: 1;
}

.botfend-tooltip-box:after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

/* Animations */
@keyframes dashicons-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dashicons-update-spin {
    animation: dashicons-spin 1s infinite linear;
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .botfend-protection-body {
        flex-direction: column;
        align-items: stretch;
    }
    .botfend-score-container {
        justify-content: center;
    }
    .botfend-quick-stats {
        justify-content: center;
    }
    .botfend-actions-row {
        justify-content: center;
    }
    .botfend-central-firewall-banner {
        flex-direction: column;
        align-items: flex-start;
    }
}