/**
 * VMPFence Audit Log Styles
 *
 * @package VMPFence
 * @since 2.1.0
 * @since 2.2.5 Added enhanced Audit Log
 */

/* Container */
.vmpfence-audit-log {
    max-width: 1300px;
    padding: 24px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Header Section */
.audit-log-header-section {
    margin-bottom: 24px;
}

.audit-log-header-section h1 {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 23px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: #191970;
}

.audit-log-learn-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #191970; /* Midnight Blue */
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    margin-left: auto;
    transition: color 0.2s ease;
}

.audit-log-learn-more:hover {
    color: #007AFF; /* Bright Blue */
}

.audit-log-learn-more .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Description */
.audit-log-description {
    background: #FFFFFF;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.audit-log-description p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #2c3338;
    font-family: 'Inter', sans-serif;
}

/* Options Panel */
.audit-log-options-panel {
    background: #FFFFFF;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.audit-log-options-header {
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    transition: background 0.2s ease;
}

.audit-log-options-header:hover {
    background: #f8f9fa;
}

.audit-log-options-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: #191970; /* Midnight Blue */
}

.audit-log-toggle-icon {
    font-size: 12px;
    color: #191970; /* Midnight Blue */
    transition: transform 0.3s ease;
}

.audit-log-options-panel.expanded .audit-log-toggle-icon {
    transform: rotate(90deg);
}

.audit-log-options-content {
    padding: 20px;
}

/* Options Description */
.audit-log-options-description {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dcdcde;
}

.audit-log-options-description p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #2c3338;
}

/* Options Buttons */
.audit-log-options-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end; /* Right-align  */
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dcdcde;
}

.audit-log-options-buttons .button {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    height: auto;
    line-height: 1.4;
}

.audit-log-options-buttons .button-secondary-outline {
    background: #fff;
    border: 1px solid #191970; /* Midnight Blue */
    color: #191970;
}

.audit-log-options-buttons .button-secondary-outline:hover:not(:disabled) {
    background: #f0f4ff;
    border-color: #191970; /* Midnight Blue */
    color: #191970; /* Midnight Blue */
}

.audit-log-options-buttons .button-primary {
    background: #191970; /* Midnight Blue */
    border-color: #191970;
    color: #fff;
}

.audit-log-options-buttons .button-primary:hover:not(:disabled) {
    background: #101042; /* Midnight Blue */
    border-color: #101042; /* Midnight Blue */
}

/* Option Rows */
.audit-log-option-row {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between; /* Space between label and controls */
    align-items: center;
}

.audit-log-option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

.audit-log-help-icon {
    color: #646970;
    font-size: 18px;
    width: 18px;
    height: 18px;
    cursor: help;
}

.audit-log-help-icon:hover {
    color: #191970; /* Midnight Blue */
}

/* Toggle Button Group */
.audit-log-toggle-group {
    display: inline-flex; /* Changed from flex to inline-flex */
    gap: 0;
    border: 1px solid #8c8f94;
    border-radius: 3px;
    overflow: hidden;
}

.audit-log-toggle-btn {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: #2c3338;
    background: #fff;
    border: none;
    border-right: 1px solid rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.audit-log-toggle-btn:last-child {
    border-right: none;
}

.audit-log-toggle-btn:hover:not(:disabled) {
    background: #f4f4ff;
    color: #191970;
}

.audit-log-toggle-btn.active {
    background: #191970; /* Midnight Blue */
    color: #fff;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.audit-log-toggle-btn.active:hover:not(:disabled) {
    background: #101042; /* Midnight Blue */
    color: #fff;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.audit-log-toggle-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

/* Checkbox Label */
.audit-log-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #2c3338;
    cursor: pointer;
}

/* Styled Checkbox Container */
.audit-log-styled-checkbox {
    position: relative;
    display: inline-block;
}

.audit-log-styled-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.audit-log-styled-checkbox .checkmark {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: #191970; /* Midnight Blue */
    border-radius: 3px;
    position: relative;
}

.audit-log-styled-checkbox .checkmark:after {
    content: "";
    position: absolute;
    display: block;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.audit-log-styled-checkbox input[type="checkbox"]:not(:checked) + .checkmark {
    background-color: #fff;
    border: 2px solid #8c8f94;
}

.audit-log-styled-checkbox input[type="checkbox"]:not(:checked) + .checkmark:after {
    display: none;
}

.audit-log-styled-checkbox input[type="checkbox"]:disabled + .checkmark {
    opacity: 0.6;
    cursor: not-allowed;
}

.audit-log-options-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f0f4ff;
    border-left: 4px solid #191970; /* Midnight Blue */
    border-radius: 4px;
    margin-top: 20px;
}

.audit-log-options-notice .dashicons {
    color: #191970; /* Midnight Blue */
    font-size: 20px;
}

/* Premium Notice */
.audit-log-premium-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 12px 20px;
    margin-bottom: 20px;
}

.audit-log-premium-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.audit-log-premium-badge {
    background: #F5A623; /* Gold */
    color: #fff;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

/* Off-Site Section */
.audit-log-offsite-section {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    padding: 25px;
    margin-bottom: 30px;
}

.audit-log-offsite-section h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

.audit-log-offsite-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.audit-log-offsite-text p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #50575e;
}

.audit-log-placeholder-image {
    background: #f0f0f1;
    border: 2px dashed #c3c4c7;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 200px;
}

.audit-log-placeholder-image .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #8c8f94;
    margin-bottom: 10px;
}

.audit-log-placeholder-image p {
    margin: 0;
    font-size: 13px;
    color: #646970;
    text-align: center;
}

.audit-log-offsite-actions {
    text-align: center;
}

/* Action Buttons */
.audit-log-action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* Summary Header */
.audit-log-summary-header {
    margin-bottom: 25px;
}

.audit-log-summary-header h2 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
}

.audit-log-summary-subtitle {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #646970;
}

.audit-log-summary-description {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #50575e;
}

/* Event Type Indicators */
.event-type-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.event-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.event-color-authentication {
    background-color: #fbbf24; /* Yellow */
}

.event-color-user {
    background-color: #a78bfa; /* Purple */
}

.event-color-plugin {
    background-color: #60a5fa; /* Blue */
}

.event-color-firewall {
    background-color: #f87171; /* Red */
}

.event-color-settings {
    background-color: #34d399; /* Green */
}

.event-color-multisite {
    background-color: #f472b6; /* Pink */
}

.event-color-content {
    background-color: #9ca3af; /* Gray */
}

.event-color-system {
    background-color: #e67e22; /* Orange */
}

.event-color-default {
    background-color: #cbd5e1; /* Light Gray */
}

/* Event Legend */
.audit-log-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 16px 20px;
    background: #FFFFFF;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    margin: 16px 0 24px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.audit-log-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: #2c3338;
}

.vmpfence-audit-log h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.vmpfence-audit-log h1 .button {
    margin-left: auto;
}

/* Actions for embedded context (in Tools page) */
.audit-log-actions {
    text-align: right;
    margin-bottom: 15px;
}

/* Tab Navigation */
.nav-tab-wrapper.audit-log-tabs {
    margin-bottom: 24px;
    border-bottom: 2px solid rgba(0,0,0,0.1);
}

.nav-tab-wrapper.audit-log-tabs .nav-tab {
    border: none;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: rgba(25, 25, 112, 0.6);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 20px;
    margin: 0 8px 0 0;
    transition: all 0.2s ease;
}

.nav-tab-wrapper.audit-log-tabs .nav-tab:hover {
    color: #191970;
    background: rgba(25, 25, 112, 0.05);
    border-bottom-color: rgba(25, 25, 112, 0.3);
}

.nav-tab-wrapper.audit-log-tabs .nav-tab-active {
    color: #191970;
    border-bottom-color: #007AFF !important;
    background: transparent;
    font-weight: 700;
}

/* Statistics Grid */
.audit-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #FFFFFF;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(25, 25, 112, 0.15);
    border-color: rgba(25, 25, 112, 0.2);
}

.stat-icon {
    font-size: 32px;
    line-height: 1;
    color: #191970;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: #191970;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: #646970;
    margin-top: 4px;
}

/* Filters */
.audit-filters {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.filter-form .filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

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

.filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
}

.filter-group select,
.filter-group input[type="date"],
.filter-group input[type="text"] {
    padding: 6px 12px;
    border: 1px solid #8c8f94;
    border-radius: 12px;
    font-size: 13px;
    min-width: 180px;
    height: 48px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* Audit Log Table */
.audit-log-container {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 12px;
    margin-bottom: 30px;
    overflow-x: auto;
}

.audit-log-table {
    border: none !important;
    margin: 0 !important;
    table-layout: auto;
    width: 100%;
}

.audit-log-table thead th {
    background: #f6f7f7;
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 2px solid #c3c4c7;
    padding: 12px;
}

.audit-log-table tbody tr {
    border-bottom: 1px solid #f0f0f1;
}

.audit-log-table tbody tr:hover {
    background: #f6f7f7;
}

.audit-log-table td {
    padding: 12px;
    font-size: 0.875rem;
    vertical-align: middle;
    word-break: break-word;
    overflow-wrap: break-word;
}

.column-time {
    width: 120px;
    min-width: 100px;
}

.column-event {
    width: 200px;
    min-width: 160px;
}

.column-user {
    width: 175px;
    min-width: 120px;
}

.column-action {
    width: 120px;
    min-width: 100px;
}

.column-object {
    width: 100px;
    min-width: 80px;
}

.column-ip {
    width: 120px;
    min-width: 100px;
}

.column-message {
    min-width: 250px;
    max-width: none;
    width: auto;
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
}

.column-details {
    width: 90px;
    min-width: 80px;
    text-align: center;
}

.timestamp {
    font-size: 12px;
    color: #646970;
}

.event-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f0f0f1;
    color: #1d2327;
}

.event-badge.event-login-success,
.event-badge.event-scan-completed {
    background: #d4edda;
    color: #155724;
}

.event-badge.event-login-failure,
.event-badge.event-threat-detected {
    background: #f8d7da;
    color: #721c24;
}

.event-badge.event-config-changed,
.event-badge.event-plugin-activated {
    background: #d1ecf1;
    color: #0c5460;
}

.event-badge.event-login-blocked,
.event-badge.event-ip-blocked,
.event-badge.event-waf-blocked {
    background: #fff3cd;
    color: #856404;
}

.user-role {
    color: #646970;
    font-style: italic;
}

.object-type {
    display: inline-block;
    padding: 2px 6px;
    background: #f0f0f1;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    color: #646970;
    text-transform: uppercase;
}

.button-small {
    padding: 4px 8px;
    font-size: 12px;
    height: auto;
    line-height: 1.4;
}

/* No Entries */
.no-entries {
    padding: 60px 20px;
    text-align: center;
    color: #646970;
}

.no-entries .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #c3c4c7;
    margin-bottom: 10px;
}

.no-entries p {
    font-size: 16px;
    margin: 0;
}

/* Statistics Sections */
.audit-section {
    background: #FFFFFF;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.audit-section h2 {
    margin: 0 0 20px;
    padding: 0;
    font-size: 18px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: #191970;
}

.event-stats,
.user-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-row .stat-label {
    min-width: 200px;
    font-size: 14px;
    color: #1d2327;
}

.stat-row .stat-label small {
    color: #646970;
    font-weight: normal;
}

.stat-bar-container {
    flex: 1;
    height: 24px;
    background: #f0f0f1;
    border-radius: 12px;
    overflow: hidden;
}

.stat-bar {
    height: 100%;
    background: linear-gradient(90deg, #191970, #0f0f4d);
    border-radius: 12px;
    transition: width 0.3s ease;
}

.stat-bar-user {
    background: linear-gradient(90deg, #00a32a, #008a20);
}

.stat-row .stat-count {
    min-width: 60px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

/* Modal */
.audit-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.audit-modal-content {
    background-color: #fff;
    margin: 50px auto;
    border: 1px solid #c3c4c7;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

.audit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #c3c4c7;
}

.audit-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    color: #191970;
}

.audit-modal-close {
    background: none;
    border: none;
    font-size: 32px;
    font-weight: 300;
    color: #646970;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
}

.audit-modal-close:hover {
    color: #d63638;
}

.audit-modal-body {
    padding: 25px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Entry Details */
.entry-details {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.detail-section h3 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #1d2327;
    border-bottom: 2px solid #191970;
    padding-bottom: 8px;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table tr {
    border-bottom: 1px solid #f0f0f1;
}

.detail-table th {
    text-align: left;
    padding: 10px 15px 10px 0;
    font-weight: 600;
    color: #1d2327;
    width: 200px;
    vertical-align: top;
}

.detail-table td {
    padding: 10px 0;
    color: #646970;
}

.detail-table td.wrap-text {
    word-break: break-all;
}

.detail-table pre {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 12px;
    padding: 12px;
    margin: 0;
    font-size: 12px;
    overflow-x: auto;
    max-width: 100%;
}

/* Audit Details Table (for modal view) */
.audit-entry-details {
    font-family: 'Inter', sans-serif;
}

.audit-details-table {
    width: 100%;
    border-collapse: collapse;
}

.audit-details-table tr {
    border-bottom: 1px solid #f0f0f1;
}

.audit-details-table th {
    text-align: left;
    padding: 12px 15px 12px 0;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: #191970;
    width: 150px;
    vertical-align: top;
}

.audit-details-table td {
    padding: 12px 0;
    color: #2c3338;
    font-family: 'Inter', sans-serif;
}

.audit-details-table pre {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 12px;
    padding: 12px;
    margin: 0;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
    max-width: 100%;
    max-height: 200px;
    overflow-y: auto;
}

.json-data {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 12px;
    padding: 15px;
    margin: 0;
    font-size: 12px;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #646970;
}

.loading .spinner {
    float: none;
    margin: 0 auto 15px;
}

/* Error Message */
.error-message {
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 12px;
    text-align: center;
}

/* Responsive */
@media (max-width: 1200px) {
    .filter-form .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-actions {
        margin-left: 0;
    }
}

@media (max-width: 782px) {
    .audit-stats-grid {
        grid-template-columns: 1fr;
    }

    .audit-log-table {
        font-size: 12px;
    }

    .audit-modal-content {
        width: 95%;
        margin: 20px auto;
    }

    .stat-row {
        flex-direction: column;
        align-items: stretch;
    }

    .stat-row .stat-label {
        min-width: auto;
    }

    .stat-row .stat-count {
        text-align: left;
    }
}

/* Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* ==================================
   Security Events Tab Styles
   ================================== */

.vmpfence-security-events-tab {
    max-width: 100%;
}

/* Security Stats Grid (reuse audit stats grid with variations) */
.vmpfence-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-box {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-box.critical {
    border-left: 4px solid #dc3232;
}

.stat-box.warning {
    border-left: 4px solid #f0ad4e;
}

.stat-box.success {
    border-left: 4px solid #46b450;
}

/* vmpfence-section for security tab */
.vmpfence-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    width: 100%;
    box-sizing: border-box;
}

.vmpfence-section h2 {
    margin-top: 0;
    border-bottom: 2px solid #191970;
    padding-bottom: 10px;
}

.vmpfence-section h3 {
    margin-top: 15px;
    font-size: 16px;
}

/* Severity bars */
.severity-bars {
    margin: 20px 0;
}

.severity-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
}

.severity-label {
    min-width: 80px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
}

.severity-label.critical {
    color: #dc3232;
}

.severity-label.high {
    color: #d63638;
}

.severity-label.medium,
.severity-label.warning {
    color: #f0ad4e;
}

.severity-label.low {
    color: #46b450;
}

.severity-label.error {
    color: #d63638;
}

.severity-label.info {
    color: #191970;
}

.severity-bar-container {
    flex: 1;
    background: #f0f0f1;
    height: 24px;
    border-radius: 12px;
    overflow: hidden;
}

.severity-bar {
    height: 100%;
    transition: width 0.3s ease;
}

.severity-bar.critical {
    background: #dc3232;
}

.severity-bar.high {
    background: #d63638;
}

.severity-bar.medium,
.severity-bar.warning {
    background: #f0ad4e;
}

.severity-bar.low {
    background: #46b450;
}

.severity-bar.error {
    background: #d63638;
}

.severity-bar.info {
    background: #191970;
}

.severity-count {
    min-width: 60px;
    text-align: right;
    font-weight: 600;
}

/* Event filters */
.event-filters {
    margin: 15px 0;
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-row label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-weight: 600;
}

/* Severity badges */
.severity-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #fff !important;
    display: inline-block;
}

.severity-badge.critical {
    background: #dc3232 !important;
}

.severity-badge.error {
    background: #d63638 !important;
}

.severity-badge.warning {
    background: #f0ad4e !important;
    color: #333 !important;
}

.severity-badge.info {
    background: #191970 !important;
}

/* Timeline chart */
.timeline-chart {
    margin: 20px 0;
    height: 350px;
    position: relative;
    width: 100%;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
}

.timeline-chart canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}
}

/* Security Event Details Modal */
.vmpfence-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.vmpfence-modal.show {
    display: flex !important;
}

.vmpfence-modal .modal-content {
    background-color: #fff;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 12px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.vmpfence-modal .close-security-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.vmpfence-modal .close-security-modal:hover,
.vmpfence-modal .close-security-modal:focus {
    color: #000;
}

#security-event-details-content {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 12px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
}

/* Embedded Audit Log in Tools - ensure visibility */
.vmpfence-audit-log-embedded {
    padding: 0 !important;
    margin: 0 !important;
}

.vmpfence-audit-log-embedded .audit-log-header-section {
    display: block !important;
    visibility: visible !important;
    margin-bottom: 20px;
}

.vmpfence-audit-log-embedded .audit-log-description {
    display: block !important;
    visibility: visible !important;
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.vmpfence-audit-log-embedded .audit-log-learn-more {
    display: inline-flex !important;
    visibility: visible !important;
}

.vmpfence-audit-log-embedded .nav-tab-wrapper {
    display: flex !important;
    visibility: visible !important;
}
