/* ===== HIPAA AUDIT SYSTEM STYLES ===== */
/* Comprehensive audit logging and compliance monitoring interface */

/* Audit Dashboard Container */
.audit-dashboard {
    background: var(--bg-secondary);
    border: 1px solid var(--gray-300);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.audit-dashboard h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audit-dashboard h3::before {
    content: "🔍";
    font-size: 1.25rem;
}

/* Audit Metrics Grid */
.audit-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.audit-metric-card {
    background: var(--bg-card);
    border: 1px solid var(--gray-300);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.audit-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #10b981);
}

.audit-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.1);
}

.audit-metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 0.5rem;
    display: block;
}

.audit-metric-label {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.audit-metric-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.audit-metric-change.positive {
    color: #059669;
    background: rgba(5, 150, 105, 0.1);
}

.audit-metric-change.negative {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

/* Compliance Score Display */
.compliance-score {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.compliance-score::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

.compliance-score-value {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.compliance-score-label {
    font-size: 1.25rem;
    font-weight: 600;
    opacity: 0.9;
}

.compliance-score-description {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

/* Audit Log Table */
.audit-log-container {
    background: var(--bg-card);
    border: 1px solid var(--gray-300);
    border-radius: 12px;
    overflow: hidden;
    margin: 2rem 0;
}

.audit-log-header {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: #ffffff;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.audit-log-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.audit-log-controls {
    display: flex;
    gap: 1rem;
}

.audit-control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.audit-control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

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

.audit-log-table th,
.audit-log-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-300);
    font-size: 0.875rem;
}

.audit-log-table th {
    background: rgba(59, 130, 246, 0.05);
    font-weight: 600;
    color: var(--text-color);
    position: sticky;
    top: 0;
    z-index: 1;
}

.audit-log-table tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.audit-event-type {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.audit-event-type.security {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.audit-event-type.access {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.audit-event-type.system {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.audit-event-type.compliance {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.audit-timestamp {
    font-family: 'Courier New', monospace;
    color: var(--text-light);
    font-size: 0.8rem;
}

.audit-details {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audit-details:hover {
    white-space: normal;
    word-break: break-word;
}

.audit-risk-level {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.audit-risk-level.high {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.audit-risk-level.medium {
    background: rgba(245, 158, 11, 0.2);
    color: #d97706;
}

.audit-risk-level.low {
    background: rgba(34, 197, 94, 0.2);
    color: #059669;
}

/* Security Alert System */
.security-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10004;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 12px 40px rgba(220, 38, 38, 0.4);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    min-width: 350px;
    max-width: 400px;
    animation: pulse-alert 2s infinite;
}

.security-alert.active {
    transform: translateX(0);
}

.security-alert-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
}

.security-alert-header i {
    font-size: 1.25rem;
    animation: spin 1s linear infinite;
}

.security-alert-content {
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.security-alert-actions {
    display: flex;
    gap: 0.75rem;
}

.security-alert-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.security-alert-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

@keyframes pulse-alert {
    0%, 100% { box-shadow: 0 12px 40px rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 12px 40px rgba(220, 38, 38, 0.7); }
}

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

/* Audit Search and Filters */
.audit-search-container {
    background: var(--bg-card);
    border: 1px solid var(--gray-300);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.audit-search-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.audit-search-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.audit-search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.audit-search-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.audit-search-field label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
}

.audit-search-field input,
.audit-search-field select {
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-color);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.audit-search-field input:focus,
.audit-search-field select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.audit-search-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.audit-search-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.audit-search-btn.primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
}

.audit-search-btn.primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
}

.audit-search-btn.secondary {
    background: transparent;
    color: var(--text-light);
    border-color: var(--gray-300);
}

.audit-search-btn.secondary:hover {
    background: var(--bg-card);
    border-color: var(--gray-400);
}

/* Compliance Report Display */
.compliance-report {
    background: var(--bg-card);
    border: 1px solid var(--gray-300);
    border-radius: 12px;
    overflow: hidden;
    margin: 2rem 0;
}

.compliance-report-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compliance-report-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.compliance-report-period {
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 500;
}

.compliance-report-body {
    padding: 1.5rem;
}

.compliance-report-section {
    margin-bottom: 2rem;
}

.compliance-report-section h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--gray-300);
    padding-bottom: 0.5rem;
}

.compliance-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.compliance-stat {
    text-align: center;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.compliance-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #059669;
    margin-bottom: 0.25rem;
}

.compliance-stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compliance-recommendations {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    padding: 1.25rem;
}

.compliance-recommendation {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.compliance-recommendation:last-child {
    margin-bottom: 0;
}

.recommendation-priority {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    flex-shrink: 0;
}

.recommendation-priority.high {
    background: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.recommendation-priority.medium {
    background: rgba(245, 158, 11, 0.2);
    color: #d97706;
}

.recommendation-priority.low {
    background: rgba(34, 197, 94, 0.2);
    color: #059669;
}

.recommendation-content {
    flex: 1;
}

.recommendation-category {
    font-size: 0.75rem;
    color: #3b82f6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.recommendation-message {
    font-size: 0.875rem;
    color: var(--text-color);
    line-height: 1.5;
}

/* Audit Export Controls */
.audit-export-panel {
    background: var(--bg-card);
    border: 1px solid var(--gray-300);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.audit-export-panel h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.audit-export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.audit-export-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.audit-export-option:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.audit-export-option.selected {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.audit-export-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

.audit-export-option label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    flex: 1;
}

.audit-export-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.audit-export-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.audit-export-btn.primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
}

.audit-export-btn.primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
}

.audit-export-btn i {
    font-size: 1rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .audit-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .audit-log-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .audit-log-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .audit-log-table {
        font-size: 0.8rem;
    }
    
    .audit-log-table th,
    .audit-log-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .audit-search-form {
        grid-template-columns: 1fr;
    }
    
    .audit-search-actions {
        justify-content: stretch;
    }
    
    .audit-search-btn {
        flex: 1;
    }
    
    .compliance-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .audit-export-options {
        grid-template-columns: 1fr;
    }
    
    .security-alert {
        left: 10px;
        right: 10px;
        min-width: auto;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .security-alert.active {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    .audit-metrics {
        grid-template-columns: 1fr;
    }
    
    .compliance-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .audit-dashboard {
        padding: 1rem;
    }
    
    .audit-log-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .compliance-score-value {
        font-size: 3rem;
    }
    
    .audit-export-actions {
        flex-direction: column;
    }
}