html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
  outline: 2px solid transparent; /* Ensure outline is visible in Windows High Contrast mode */
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  font-family: 'Lora', serif;
}

/* Font styling */
.oswald-font {
  font-family: 'Oswald', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Oswald', sans-serif;
}

/* Custom colors and styling */
.bg-epic-blue {
  background-color: #0c2b5a !important; /* Dark blue color for header */
}

.hero-section {
  padding: 3rem 0;
  margin-bottom: 2rem;
}

.feature-icon {
  font-size: 3rem;
  color: #0c2b5a;
  margin-bottom: 1rem;
}

.feature-card {
  border: none;
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: transform 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* Form control focus state */
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Navigation styling improvements */
.navbar-nav .nav-item .nav-link {
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.navbar-nav .nav-item .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.navbar-text {
  font-weight: 500;
  display: flex;
  align-items: center;
  margin-bottom: 0;
}

/* Professional button styling for logout */
.btn-link.nav-link {
  text-decoration: none !important;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.btn-link.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Enhanced hero section */
.hero-section {
  background: linear-gradient(135deg, #0c2b5a 0%, #1a4480 100%);
  color: white;
  padding: 4rem 0;
  margin-bottom: 0;
  margin-left: -15px;
  margin-right: -15px;
}

.hero-section .lead {
  font-size: 1.3rem;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto 2rem;
}

/* CTA section styling */
.cta-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 10px;
  border: 1px solid #dee2e6;
  color: #212529; /* Ensure sufficient contrast on light background */
}

/* Enhanced feature cards */
.feature-card {
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  border-color: #0c2b5a;
}

/* Professional typography */
.display-3 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lead {
  font-weight: 400;
  color: rgba(255, 255, 255, 0.95); /* Improved from 0.9 for better contrast */
}

/* Button enhancements */
.btn-primary {
  background: linear-gradient(135deg, #0c2b5a 0%, #1a4480 100%);
  border: none;
  padding: 0.75rem 2rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(12, 43, 90, 0.4);
}

.btn-outline-primary {
  border-color: #0c2b5a;
  color: #0c2b5a;
  padding: 0.75rem 2rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background-color: #0c2b5a;
  border-color: #0c2b5a;
  transform: translateY(-2px);
}

.btn-outline-secondary {
  padding: 0.75rem 2rem;
  font-weight: 500;
  border-color: #495057; /* Improved contrast */
  color: #495057; /* Improved contrast */
}

.btn-outline-secondary:hover {
  background-color: #495057;
  border-color: #495057;
  color: white;
}

/* Enhanced feature icons */
.feature-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

/* Footer contrast improvements */
.footer {
  color: #495057; /* Better contrast than default text-muted */
}

.footer a {
  color: #0056b3; /* Consistent with improved link color */
}

/* Accessibility improvements for alerts and forms */
.alert {
  border-width: 2px; /* Make borders more visible */
}

.form-control:focus {
  border-color: #0056b3; /* Consistent with link color */
  box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25);
}

/* Improved contrast for Bootstrap info elements */
.bg-info {
  background-color: #006699 !important; /* Improved contrast from Bootstrap default #0dcaf0 */
}

.badge.bg-info {
  background-color: #006699 !important; /* Ensures 6.25:1 contrast ratio with white text */
}

.card-header.bg-info {
  background-color: #006699 !important; /* Consistent info color with proper contrast */
}

.text-info {
  color: #006699 !important; /* Improved contrast for info text on light backgrounds */
}

.alert-info {
  background-color: rgba(0, 102, 153, 0.125); /* Light version of improved info color */
  border-color: #006699;
  color: #003d5c; /* Dark blue text for better contrast on light background */
}

/* Analytics Dashboard Enhancements */
.nav-pills .nav-link {
  padding: 0.75rem 1.5rem;
  margin-right: 0.5rem;
  border-radius: 25px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.nav-pills .nav-link:not(.active) {
  color: #0c2b5a;
  background-color: transparent;
}

.nav-pills .nav-link:not(.active):hover {
  background-color: rgba(12, 43, 90, 0.1);
  transform: translateY(-1px);
}

.nav-pills .nav-link.active {
  background: linear-gradient(135deg, #0c2b5a 0%, #1a4480 100%);
  border-color: #0c2b5a;
  box-shadow: 0 4px 12px rgba(12, 43, 90, 0.3);
}

/* Enhanced Card Styling */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card-header {
  border-bottom: none;
  padding: 1.25rem 1.5rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* Metric Cards */
.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-info,
.card-header.bg-warning {
  color: white !important;
  font-weight: 600;
}

/* Chart Container Styling */
.chart-container {
  position: relative;
  background: white;
  border-radius: 8px;
  padding: 1rem;
}

/* Table Enhancements */
.table {
  margin-bottom: 0;
}

.table th {
  font-weight: 600;
  color: #495057;
  border-top: none;
  border-bottom: 2px solid #dee2e6;
  padding: 1rem 0.75rem;
}

.table td {
  padding: 0.875rem 0.75rem;
  vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Badge Enhancements */
.badge {
  font-weight: 500;
  padding: 0.5em 0.75em;
  border-radius: 6px;
}

/* Loading States */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* Form Enhancements */
.form-select {
  border-radius: 8px;
  border: 1px solid #ced4da;
  transition: all 0.3s ease;
}

.form-select:focus {
  border-color: #0c2b5a;
  box-shadow: 0 0 0 0.2rem rgba(12, 43, 90, 0.25);
}

/* Container Improvements */
.container-fluid {
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Responsive Improvements */
@media (max-width: 768px) {
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .nav-pills .nav-link {
    margin-bottom: 0.5rem;
    margin-right: 0;
  }
}

/* Dashboard Specific Styling */
.display-6 {
  font-weight: 700;
  color: #2c3e50;
}

.text-muted {
  color: #6c757d !important;
}

/* Chart.js tooltip styling */
.chartjs-tooltip {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Performance Timeline Styling */
.performance-timeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  margin: 1rem 0;
  position: relative;
  overflow-x: auto;
}

.performance-timeline::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #007bff 0%, #28a745 50%, #ffc107 100%);
  z-index: 1;
  border-radius: 2px;
}

.timeline-event {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  background: white;
  padding: 0.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-width: 120px;
  text-align: center;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
}

.timeline-event:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: #007bff;
}

.timeline-event-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  font-size: 1.0rem;
  color: white;
  font-weight: bold;
}

.timeline-event-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.timeline-event-value {
  font-size: 1rem;
  font-weight: 700;
  color: #0c2b5a;
  margin-bottom: 0.25rem;
}

.timeline-event-status {
  font-size: 0.7rem;
}

.timeline-event-target {
  font-size: 0.65rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

/* Timeline event colors */
.timeline-event[data-metric="dns_lookup"] .timeline-event-icon {
  background: linear-gradient(135deg, #6f42c1, #5a32a3);
}

.timeline-event[data-metric="tcp_connect"] .timeline-event-icon {
  background: linear-gradient(135deg, #6c757d, #545b62);
}

.timeline-event[data-metric="server_response"] .timeline-event-icon {
  background: linear-gradient(135deg, #dc3545, #b02a37);
}

.timeline-event[data-metric="first_contentful_paint"] .timeline-event-icon {
  background: linear-gradient(135deg, #fd7e14, #e8590c);
}

.timeline-event[data-metric="dom_interactive"] .timeline-event-icon {
  background: linear-gradient(135deg, #20c997, #1a9f7a);
}

.timeline-event[data-metric="dom_content_loaded"] .timeline-event-icon {
  background: linear-gradient(135deg, #17a2b8, #138496);
}

.timeline-event[data-metric="page_load"] .timeline-event-icon {
  background: linear-gradient(135deg, #007bff, #0056b3);
}

/* Responsive timeline */
@media (max-width: 1200px) {
  .performance-timeline {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .timeline-event {
    min-width: 100px;
  }
}

@media (max-width: 768px) {
  .performance-timeline {
    flex-direction: column;
    gap: 1rem;
  }
  
  .performance-timeline::before {
    width: 3px;
    height: 100%;
    top: 0;
    left: 50%;
    right: auto;
    background: linear-gradient(180deg, #007bff 0%, #28a745 50%, #ffc107 100%);
  }
  
  .timeline-event {
    min-width: 200px;
    width: 100%;
    max-width: 300px;
  }
}