/**
 * VMPFence Firewall Styles
 *
 * @package VMPFence
 * @since 2.0.0
 */

/* Firewall Page Container */
.vmpfence-firewall-wrapper {
    /* background: #f5f7fa; */
    padding: 20px 0 20px 0;
    max-width: 1300px;
}

.vmpfence-firewall-header-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-width: 1300px;
}

.vmpfence-firewall-header {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    padding: 30px;
    border: #e2e2e2 1px solid;
    /* border-radius: 8px; */
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); */
    /* margin-bottom: 30px; */
    /* border-left: 4px solid #191970; */
}

.vmpfence-firewall-header h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #23282d;
}

.vmpfence-firewall-header p {
    margin: 0 0 20px 0;
    color: #555;
    font-size: 15px;
    line-height: 1.6;
}

.vmpfence-firewall-status-text {
    color: #46b450;
    font-weight: 600;
}

/* Firewall Enabled State */
.vmpfence-firewall-enabled {
    text-align: center;
    padding: 40px 20px;
}

.vmpfence-firewall-enabled svg {
    margin-bottom: 20px;
}

.vmpfence-firewall-enabled h2 {
    margin: 0;
    font-size: 18px;
    color: #191970;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Firewall Disabled State */
.vmpfence-firewall-disabled h2 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #23282d;
    margin-bottom: 30px;
}

.vmpfence-firewall-disabled p {
    margin: 0 0 20px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.vmpfence-firewall-disabled p:last-child {
    margin: 0;
}

#vmpfence-enable-firewall-btn {
    padding: 5px 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* Status Boxes Grid */
.vmpfence-firewall-status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 3 columns for now. When IP blocklist is enabled, change to 4 columns */
    gap: 0;
    margin-bottom: 30px;
    max-width: 1300px;
}

.vmpfence-firewall-status-box {
    background: #ffffff;
    padding: 25px;
    /* border-radius: 8px; */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: #e2e2e2 1px solid;
}

/* .vmpfence-firewall-status-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.12);
} */

.vmpfence-firewall-status-box .circle-container {
    margin: 0 auto 15px;
    width: 80px;
    height: 80px;
}

.vmpfence-firewall-status-box h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #23282d;
    font-weight: 600;
}

.vmpfence-firewall-status-box p {
    margin: 0 0 12px 0;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.vmpfence-firewall-status-box .manage-link {
    color: #191970;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.vmpfence-firewall-status-box .manage-link:hover {
    text-decoration: underline;
}

/* Feature Boxes */
.vmpfence-firewall-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 0;
    margin-bottom: 30px;
    max-width: 1300px;
}

.vmpfence-firewall-feature-box {
    background: #ffffff;
    padding: 25px;
    /* border-radius: 8px; */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: #e2e2e2 1px solid;
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 20px;
    align-items: start;
}

.vmpfence-firewall-feature-box .icon {
    font-size: 36px;
    display: block;
}

.vmpfence-firewall-feature-box-content {
    display: flex;
    flex-direction: column;
}

.vmpfence-firewall-feature-box h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #23282d;
}

.vmpfence-firewall-feature-box p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

/* Analytics Grid */
.vmpfence-analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, auto);
    gap: 20px;
    margin-bottom: 30px;
    max-width: 1300px;
}

.vmpfence-analytics-card {
    background: #ffffff;
    padding: 25px;
    border: 1px solid #e2e2e2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    max-height: fit-content;
}

.vmpfence-analytics-card h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding-bottom: 10px;
    border-bottom: #e2e2e2 1px solid;
}

.vmpfence-filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.vmpfence-filter-tab {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.vmpfence-filter-tab.active {
    background: #191970;
    color: #fff;
    border-color: #191970;
}

.vmpfence-filter-tab:hover {
    border-color: #191970;
}

/* Chart Controls */
.vmpfence-chart-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.vmpfence-chart-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.vmpfence-chart-btn.vmpfence-active {
    background: #191970;
    color: #fff;
    border-color: #191970;
}

.vmpfence-chart-btn:hover {
    border-color: #191970;
}

.vmpfence-chart-container {
    position: relative;
    height: 300px;
    margin-top: 20px;
}

/* Table Section */
.vmpfence-firewall-table-section {
    background: #ffffff;
    padding: 30px;
    /* border-radius: 8px; */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    max-width: 1300px;
}

.vmpfence-firewall-table-section h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #23282d;
}

.vmpfence-firewall-table-section table {
    margin: 0;
}

/* Attack Filter Controls */
.attack-filter-controls {
    display: flex;
    gap: 10px;
}

.attack-filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.attack-filter-btn.active {
    background: #191970;
    color: #fff;
    border-color: #191970;
}

.attack-filter-btn:hover {
    border-color: #191970;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-xss { background: #ffebee; color: #c62828; }
.badge-sqli, .badge-sql_injection { background: #fff3e0; color: #e65100; }
.badge-rfi { background: #fce4ec; color: #880e4f; }
.badge-lfi { background: #f3e5f5; color: #6a1b9a; }
.badge-rce { background: #ffcdd2; color: #b71c1c; }
.badge-command_injection { background: #ffe0b2; color: #e65100; }
.badge-file_upload { background: #e1bee7; color: #7b1fa2; }
.badge-scanner { background: #d7ccc8; color: #4e342e; }
.badge-wordpress { background: #b2dfdb; color: #00695c; }
.badge-malware { background: #ef9a9a; color: #c62828; }

.vmpfence-status-blocked {
    background-color: #dc3232;
    color: white;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1200px) {
    .vmpfence-firewall-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vmpfence-firewall-table-section {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .vmpfence-firewall-status-grid {
        grid-template-columns: 1fr;
    }
    
    .vmpfence-firewall-features {
        grid-template-columns: 1fr;
    }
    
    .vmpfence-firewall-table-section {
        padding: 15px;
        overflow-x: auto;
    }
    
    .vmpfence-firewall-table-section table {
        min-width: 600px;
    }
    
    .attack-filter-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .attack-filter-btn {
        flex: 1 1 auto;
        min-width: 80px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .vmpfence-firewall-table-section {
        padding: 10px;
    }
    
    .attack-filter-controls {
        flex-direction: column;
    }
    
    .attack-filter-btn {
        width: 100%;
    }
}

/* Top IPs Blocked Chart */
.vmpfence-top-ips-card {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.vmpfence-top-ips-card h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 600; /* Inter SemiBold */
    font-size: 20px;
    color: #23282d;
    margin: 0 0 20px 0;
}

.vmpfence-top-ips-card .filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.vmpfence-top-ips-card .filter-tab {
    font-family: 'Inter', sans-serif;
    font-weight: 400; /* Inter Regular */
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 12px; /* Design guideline: 12px corner radius */
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    color: #191970; /* Midnight Blue */
}

.vmpfence-top-ips-card .filter-tab.active {
    background: #191970; /* Midnight Blue */
    color: #fff;
    border-color: #191970;
    font-weight: 600; /* Inter SemiBold for active state */
}

.vmpfence-top-ips-card .filter-tab:hover:not(.active) {
    border-color: #191970;
    color: #191970;
}

.vmpfence-top-ips-card .top-ips-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
}

.vmpfence-top-ips-card .top-ips-table thead th {
    font-family: 'Inter', sans-serif;
    font-weight: 600; /* Inter SemiBold */
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
    color: #333; /* Matching Attacks Blocked table */
    font-size: 13px; /* Matching Attacks Blocked table */
}

.vmpfence-top-ips-card .top-ips-table tbody td {
    font-family: 'Inter', sans-serif;
    font-weight: 400; /* Inter Regular */
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    font-size: 14px;
}

.vmpfence-top-ips-card .top-ips-table tbody tr {
    transition: background-color 0.2s ease;
}

.vmpfence-top-ips-card .top-ips-table tbody tr:hover {
    background-color: #f8f9fa;
}

.vmpfence-top-ips-card .top-ips-table tbody td.ip-address {
    font-family: 'Inter', sans-serif;
    font-weight: 500; /* Inter Medium */
    color: #191970; /* Midnight Blue */
    font-size: 14px;
}

.vmpfence-top-ips-card .top-ips-table tbody td.block-count {
    color: #D32F2F; /* Red for blocks count */
    font-weight: 600; /* Inter SemiBold */
}

.vmpfence-top-ips-card .empty-state {
    font-family: 'Inter', sans-serif;
    font-weight: 400; /* Inter Regular */
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
    font-style: italic;
}
