/* Dashboard specific styles */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --border-color: #dee2e6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* Navbar customizations */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

/* Dashboard cards - Smaller size */
.metric-card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, z-index 0s;
    position: relative;
    z-index: 1;
}

.metric-card .card-body {
    padding: 1rem;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    z-index: 1001;
}

/* Tooltip styles for metric cards */

.metric-card .card-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(33, 37, 41, 0.95);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    min-width: 280px;
    max-width: 400px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    margin-top: 10px;
    pointer-events: none;
}

.metric-card .card-tooltip::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid rgba(33, 37, 41, 0.95);
}

.metric-card:hover .card-tooltip {
    opacity: 1;
    visibility: visible;
}

.card-tooltip h6 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
}

.card-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.8125rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-tooltip .tooltip-row:last-child {
    border-bottom: none;
}

.card-tooltip .tooltip-label {
    color: rgba(255, 255, 255, 0.8);
}

.card-tooltip .tooltip-value {
    font-weight: 600;
    color: #fff;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.metric-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0;
}

.metric-icon {
    opacity: 0.8;
}

/* Chart containers */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Status indicators */
.status-badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.status-critical {
    background-color: #dc3545;
    color: white;
}

.status-high {
    background-color: #fd7e14;
    color: white;
}

.status-medium {
    background-color: #ffc107;
    color: #212529;
}

.status-low {
    background-color: #20c997;
    color: white;
}

.status-info {
    background-color: #0dcaf0;
    color: #212529;
}

/* Activity feed */
.activity-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.activity-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

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

.activity-time {
    font-size: 0.875rem;
    color: #6c757d;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-refresh {
    background: linear-gradient(135deg, var(--primary-color), #0b5ed7);
    border: none;
    color: white;
}

.btn-refresh:hover {
    background: linear-gradient(135deg, #0b5ed7, var(--primary-color));
    color: white;
}

/* Loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.spinner-custom {
    width: 2rem;
    height: 2rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Table customizations */
.table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.table thead th {
    background-color: var(--dark-color);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .metric-value {
        font-size: 1.5rem;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Animation for metrics */
.metric-value {
    animation: countUp 0.8s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast notifications positioning */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
}

/* Progress bars */
.progress-custom {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-bar-custom {
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Card hover effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Icon animations */
.icon-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Security-specific color scheme */
.security-critical {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.security-high {
    color: #fd7e14;
    background-color: rgba(253, 126, 20, 0.1);
}

.security-medium {
    color: #ffc107;
    background-color: rgba(255, 193, 7, 0.1);
}

.security-low {
    color: #20c997;
    background-color: rgba(32, 201, 151, 0.1);
}

.security-info {
    color: #0dcaf0;
    background-color: rgba(13, 202, 240, 0.1);
}

/* Dashboard grid layout */
.dashboard-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

@media (max-width: 576px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}
