/**
 * dashboard.css
 * Styles for the SentinelAI dashboard
 */

/* Dashboard Layout */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

.dashboard-container {
    padding: 20px;
}

.sidebar {
    position: fixed;
    width: 280px;
    height: 100vh;
    background-color: #212529;
    color: #fff;
    overflow-y: auto;
    transition: width 0.3s;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 20px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.sidebar-menu {
    padding: 15px 0;
}

.sidebar-menu a {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-menu a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.sidebar-menu a span {
    opacity: 1;
    transition: opacity 0.3s;
}

.sidebar.collapsed .sidebar-menu a span {
    opacity: 0;
    display: none;
}

#main-content {
    margin-left: 280px;
    padding: 20px;
    transition: margin-left 0.3s;
}

#main-content.expanded {
    margin-left: 80px;
}

.card {
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card-header {
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

.dashboard-card {
    height: 100%;
}

.dashboard-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stats-card {
    text-align: center;
    padding: 15px;
}

.stats-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stats-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.stats-label {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Threat Cards */
.threat-card {
    transition: all 0.3s;
}

.threat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.threat-card .card-header {
    padding: 12px 15px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.threat-card .card-header.high {
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.threat-card .card-header.medium {
    background-color: rgba(255, 193, 7, 0.2);
    color: #fd7e14;
}

.threat-card .card-header.low {
    background-color: rgba(13, 202, 240, 0.2);
    color: #0dcaf0;
}

.threat-detail {
    font-size: 0.9rem;
    color: #6c757d;
}

.severity-badge {
    font-size: 0.75rem;
    padding: 5px 8px;
}

.fade-out {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.5s, transform 0.5s;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 20px 0;
    list-style: none;
    max-height: 500px;
    overflow-y: auto;
}

.timeline:before {
    content: " ";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50px;
    width: 2px;
    background-color: #e9ecef;
    z-index: 0;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}

.timeline-badge {
    position: absolute;
    top: 16px;
    left: 50px;
    width: 30px;
    height: 30px;
    margin-left: -15px;
    border-radius: 50%;
    text-align: center;
    color: #fff;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-badge i {
    font-size: 0.9rem;
}

.timeline-panel {
    position: relative;
    width: calc(100% - 90px);
    margin-left: 90px;
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.timeline-title {
    margin-top: 0;
    font-weight: 600;
}

.timeline-heading {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.timeline-body p {
    margin-bottom: 5px;
}

/* Map */
#threat-map, #map {
    height: 300px;
    width: 100%;
    border-radius: 8px;
    background-color: #e9ecef;
}

.map-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Limited height for scrollable sections */
.limited-height {
    max-height: 400px;
    overflow-y: auto;
}

/* Charts */
.chart-container {
    position: relative;
    height: 250px;
}

/* Notifications */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.alert {
    margin-bottom: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Search Box */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    padding-left: 40px;
    border-radius: 50px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 12px;
    color: #6c757d;
}

/* Filter Buttons */
.time-filter-buttons {
    margin-bottom: 20px;
}

/* Utility Classes */
.refresh-icon {
    cursor: pointer;
    transition: transform 0.3s;
}

.refresh-icon:hover {
    transform: rotate(90deg);
}

/* Azure AI Section */
.azure-module {
    margin-bottom: 30px;
}

.azure-module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.azure-module-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.module-tabs .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.azure-metric {
    text-align: center;
    border-right: 1px solid #e9ecef;
}

.azure-metric:last-child {
    border-right: none;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0078d4;
}

.metric-label {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Disabled service styling */
.disabled-service {
    opacity: 0.6;
    position: relative;
}

.disabled-service::before {
    content: "Service Disabled";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    z-index: 10;
    font-weight: bold;
    pointer-events: none;
}

.disabled-service .card {
    border-color: #dee2e6;
    box-shadow: none;
}

.disabled-service .chart-container {
    filter: grayscale(100%);
}

/* Azure service toggle styles */
.disabled-service .card-header {
    background-color: #6c757d !important;
    color: #fff;
}

.disabled-service .card-body {
    opacity: 0.7;
    position: relative;
}

.disabled-service .card-body::after {
    content: "Service Disabled";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(108, 117, 125, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.settings-title {
    font-weight: 600;
    margin-bottom: 15px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .sidebar {
        width: 80px;
    }
    
    .sidebar .sidebar-menu a span {
        opacity: 0;
        display: none;
    }
    
    #main-content {
        margin-left: 80px;
    }
    
    .timeline:before {
        left: 30px;
    }
    
    .timeline-badge {
        left: 30px;
    }
    
    .timeline-panel {
        width: calc(100% - 60px);
        margin-left: 60px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 0;
    }
    
    #main-content {
        margin-left: 0;
    }
    
    #main-content.expanded {
        margin-left: 0;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Agent rows - clickable */
.agent-row:hover {
    background-color: #e8f5e9 !important;
    transition: background-color 0.2s ease;
}

.agent-row td {
    vertical-align: middle;
}

/* Agent details modal */
#agentDetailsModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

#agentDetailsModal .progress {
    background-color: #e9ecef;
}

#agentDetailsModal .badge {
    font-size: 0.75rem;
}
