/**
 * Dashboard Stylesheet
 * Custom styling for the Traffic Emulator dashboard
 * 
 * Copyright (c) 2023-2024 Lackadaisical Security
 * https://Lackadaisical-Security.com
 * support@lackadaisical-security.com
 */

/* General styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 0.875rem;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background-color: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #555;
}

/* Dashboard header */
.navbar-brand {
  font-weight: 600;
}

/* Sidebar styles */
.sidebar {
  background-color: #fff;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar .nav-link {
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
  background-color: rgba(13, 110, 253, 0.1);
}

.sidebar .nav-link.active {
  background-color: rgba(13, 110, 253, 0.1);
  color: #0d6efd;
}

.sidebar .nav-link i {
  margin-right: 0.5rem;
  width: 1.25rem;
  text-align: center;
}

.sidebar-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Card styles */
.card {
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  padding: 0.75rem 1rem;
}

.card-header .card-title {
  font-weight: 600;
  margin-bottom: 0;
}

/* Stats cards */
.stat-card {
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.stat-card .card-body {
  padding: 1.5rem;
}

.stat-card .card-title {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  opacity: 0.8;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

/* Progress bars */
.progress {
  height: 0.5rem;
  border-radius: 1rem;
  margin-top: 0.5rem;
  background-color: rgba(255, 255, 255, 0.2);
}

.progress-bar {
  border-radius: 1rem;
}

/* Tables */
.table {
  font-size: 0.875rem;
}

.table thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-top: none;
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 123, 255, 0.05);
}

/* Form controls */
.form-control, .form-select {
  font-size: 0.875rem;
}

.form-label {
  font-weight: 500;
  font-size: 0.875rem;
}

.form-range {
  height: 1.5rem;
}

.form-check-label {
  font-size: 0.875rem;
}

/* Buttons */
.btn {
  font-weight: 500;
  border-radius: 0.25rem;
}

.btn-group > .btn {
  border-radius: 0.25rem;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* Modals */
.modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  background-color: #f8f9fa;
}

.modal-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background-color: #f8f9fa;
}

/* Charts */
.chart-container {
  position: relative;
  margin: auto;
  height: 300px;
}

/* Heatmap */
.heatmap-container {
  width: 100%;
  height: 500px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  overflow: hidden;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
  }

  .sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
  }
}

/* Notifications */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.notification {
  margin-bottom: 10px;
  padding: 15px 20px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  min-width: 300px;
  max-width: 400px;
  animation: fadeIn 0.3s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-success {
  background-color: #4CAF50;
  color: white;
}

.notification-error {
  background-color: #F44336;
  color: white;
}

.notification-warning {
  background-color: #FFC107;
  color: black;
}

.notification-info {
  background-color: #2196F3;
  color: white;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(50px);
  }
}

/* Animation classes */
.animate-fadeIn {
  animation: fadeIn 0.3s;
}

.animate-fadeOut {
  animation: fadeOut 0.3s;
}

/* Loading indicators */
.loading-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 0.2rem solid rgba(0, 0, 0, 0.1);
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Tab transitions */
.fade {
  transition: opacity 0.15s linear;
}

.tab-content > .tab-pane {
  display: none;
}

.tab-content > .active {
  display: block;
}

/* Button animations */
.btn {
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Custom switch styling */
.form-switch .form-check-input {
  width: 2.5em;
  height: 1.25em;
}

.form-switch .form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

/* Air-Gap Mode Styles */
.airgap-status-indicator {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.airgap-status-indicator.off {
  background-color: #ff3b58;
  box-shadow: 0 0 10px rgba(255, 59, 88, 0.5);
}

.airgap-status-indicator.on {
  background-color: #3bff80;
  box-shadow: 0 0 10px rgba(59, 255, 128, 0.5);
}

.airgap-status-box {
  border: 1px solid rgba(59, 255, 128, 0.3);
  border-radius: 4px;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.4);
}

.cyber-metric-circle {
  width: 100px;
  height: 100px;
  margin: 0 auto;
  position: relative;
}

.cyber-metric-circle-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    #3bff80 0% var(--percentage),
    rgba(59, 255, 128, 0.1) var(--percentage) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: circle(50%);
}

.cyber-metric-circle-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  color: #3bff80;
  text-shadow: 0 0 5px rgba(59, 255, 128, 0.7);
}

/* Vision System Styles */
#screenshot-container {
  position: relative;
  border: 1px solid rgba(59, 255, 128, 0.3);
  border-radius: 4px;
  overflow: hidden;
}

#screenshot-image {
  width: 100%;
  height: auto;
  display: block;
}

#screenshot-placeholder {
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #888;
}

#screenshot-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.element-highlight {
  position: absolute;
  background-color: rgba(59, 255, 128, 0.2);
  border: 2px solid rgba(59, 255, 128, 0.5);
  border-radius: 2px;
  pointer-events: none;
  transition: all 0.2s ease;
}

.element-highlight.interactive {
  border-color: #ff3bac;
  background-color: rgba(255, 59, 172, 0.2);
}

.analysis-tabs .nav-link {
  padding: 8px 15px;
  color: #aaa;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.8rem;
  border: none;
  background: transparent;
}

.analysis-tabs .nav-link.active {
  background: rgba(59, 255, 128, 0.1);
  color: #3bff80;
  border-bottom: 2px solid #3bff80;
}

.element-badge {
  display: inline-block;
  padding: 3px 6px;
  font-size: 0.7rem;
  font-family: 'Orbitron', sans-serif;
  text-transform: uppercase;
  border-radius: 2px;
}

.confidence-indicator {
  height: 8px;
  background-color: rgba(59, 255, 128, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.confidence-value {
  height: 100%;
  background-color: #3bff80;
  transition: width 0.3s ease;
}
