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;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  white-space: nowrap;
  line-height: 60px;
}

/* Custom styles for the application */
.navbar-brand {
  font-weight: 600;
}

.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border-radius: 0.5rem;
}

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  border-radius: 0.5rem 0.5rem 0 0 !important;
}

.btn {
  border-radius: 0.375rem;
  font-weight: 500;
}

.btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

.form-control {
  border-radius: 0.375rem;
  border: 1px solid #ced4da;
}

.form-control:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Responsive text */
.lead {
  font-size: 1.1rem;
  font-weight: 300;
}

/* Animation classes */
.fade-in {
  animation: fadeIn 0.5s ease-in;
}

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

/* Loading spinner */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* Toast notifications */
.toast {
  min-width: 300px;
}

/* Feature cards */
.feature-card {
  transition: transform 0.2s ease-in-out;
}

.feature-card:hover {
  transform: translateY(-5px);
}

/* Status indicators */
.status-online {
  color: #28a745;
}

.status-offline {
  color: #dc3545;
}

.status-warning {
  color: #ffc107;
}

/* Utility classes */
.text-monospace {
  font-family: 'Courier New', monospace;
}

.border-radius-lg {
  border-radius: 0.5rem !important;
}

.shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow-md {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Custom panels */

.collapse-panel {
  margin-top: 22px;
  transition: all 0.35s ease;
}

.collapse-card-body {
  min-height: 128px;
}

/* Information panel improvements */
#infoQuick .card-body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#infoQuick .row {
  width: 100%;
  margin: 0;
  align-items: center;
  height: 100%;
}

#infoQuick .col-3 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem 0.5rem;
  position: relative;
  height: 100%;
  min-height: 80px;
}

#infoQuick .border-end {
  position: relative;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
}

#infoQuick .border-end::after {
  content: '';
  position: absolute;
  right: 0;
  top: 10%;
  bottom: 10%;
  width: 1px;
}

#infoQuick .col-3:last-child .border-end::after {
  display: none;
}

#infoQuick .fw-bold {
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
  line-height: 1.2;
}

#infoQuick small {
  font-size: 0.75rem;
  opacity: 0.8;
}

#infoQuick .status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-bottom: 0.25rem;
}

#infoQuick .status-indicator.connected {
  background-color: #28a745;
  box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
}

#infoQuick .status-indicator.disconnected {
  background-color: #dc3545;
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

#infoQuick .status-indicator.warning {
  background-color: #ffc107;
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.25);
}

/* Responsive adjustments for information panel */
@media (max-width: 576px) {
  #infoQuick .col-3 {
    min-height: 70px;
    padding: 0.75rem 0.25rem;
  }
  
  #infoQuick .fw-bold {
    font-size: 1rem;
  }
  
  #infoQuick small {
    font-size: 0.7rem;
  }
}

@media (max-width: 480px) {
  #infoQuick .row {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  #infoQuick .col-3 {
    flex: 0 0 50%;
    max-width: 50%;
    min-height: 60px;
  }
  
  #infoQuick .col-3:nth-child(1),
  #infoQuick .col-3:nth-child(2) {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
  }
  
  #infoQuick .col-3:nth-child(2) .border-end::after,
  #infoQuick .col-3:nth-child(4) .border-end::after {
    display: none;
  }
  
  #infoQuick .col-3:nth-child(1) .border-end::after,
  #infoQuick .col-3:nth-child(3) .border-end::after {
    display: block;
  }
}

/* Dynamic panel sizing for advanced tools and info panels */
.panel-full-width {
  flex: 0 0 100% !important;
  max-width: 100% !important;
}

.panel-half-width {
  flex: 0 0 50% !important;
  max-width: 50% !important;
}

.panel-container {
  display: flex;
  gap: 1rem;
}

@media (max-width: 768px) {
  .panel-half-width,
  .panel-full-width {
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* Elevation Chart Styles */
.chart-container {
  position: relative;
  width: 100%;
  height: 400px;
}

#elevationChart {
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
}

/* Ensure chart section card has minimal padding for maximum chart width */
#chartSection .card-body {
  padding: 0.5rem !important;
}

#chartSection .chart-container {
  margin: 0;
  padding: 0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .card {
    background-color: #212529;
    color: #ffffff;
  }
  
  .card-header {
    background-color: #343a40;
    border-bottom-color: #495057;
  }
  
  .text-muted {
    color: #6c757d !important;
  }
}
