.btn-primary{
    color: #fff !important;
}

.btn-outline-primary{
&:hover, &:focus-visible, &:active {
    color: #fff !important;
}
}
.study-name{
    padding-right: 20px;
    margin-right: 10px;
}

@media (min-width: 1200px) { 
    .study-name{
        border-right: 1px solid rgba(0, 0, 0, 0.5);
    }
}

.navbar{
    background-color: #fff;
}

.table-fixed > table:nth-of-type(1) > thead{
    position: sticky;
    top: 73px;
}

.table-sm {
    font-size: 0.875rem;
}

/* Circle Loading Spinner */
.circle-loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.circle-loading-large {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #007bff;
}

.circle-loading-small {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
}

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

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.loading-container .loading-text {
    margin-top: 15px;
    color: #6c757d;
    font-size: 14px;
}

/* Overlay loading for table updates */
.table-loading-overlay {
    position: relative;
}

.table-loading-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 10;
    pointer-events: none;
}

.table-loading-overlay .loading-spinner-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    pointer-events: none;
}

/* Overlay Loading Spinner - matching template format */
.table-overlay-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
}

.table-container-wrapper {
    position: relative;
}

.overlay-spinner {
    text-align: center;
}

.overlay-spinner .spinner-border {
    color: #26E3CA !important;
}

.overlay-spinner .mt-2 {
    margin-top: 0.5rem;
}

/* No data overlay styles */
.chart-no-data-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 243, 205, 0.95) !important; /* Light yellow background */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001; /* Higher than loading overlay */
  border-radius: 4px;
  border: 2px solid #ffecb5; /* Yellow border */
}

.no-data-content {
  text-align: center;
  color: #664d03 !important; /* Dark yellow/brown text for readability */
  font-weight: 600;
}

.no-data-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #664d03 !important; /* Dark yellow/brown icon */
}

.no-data-text {
  font-size: 0.9rem;
  color: #664d03 !important; /* Dark yellow/brown text */
  text-shadow: none; /* Remove text shadow since background is light */
}

/* Device timeline styling */
.device-timeline-container {
  margin-bottom: 12px; /* Gap between charts */
}

.device-timeline-container:last-child {
  margin-bottom: 0; /* No gap after last chart */
}

.device-timeline-container .chart-container {
  height: 110px !important; /* Shorter chart height */
}

.device-timeline-container canvas {
  height: 110px !important; /* Shorter canvas height */
}

/* Alarm badge styling */
.alarm-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: opacity 0.2s ease;
  }

/* Alarm badge styling */
.alarm-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: opacity 0.2s ease;
  }
  
  .alarm-badge:hover {
    opacity: 0.8;
  }
  
  /* High severity (red) */
  .alarm-badge-high {
    background-color: #DB4456;
  }
  
  /* Medium severity (orange) */
  .alarm-badge-medium {
    background-color: #EE8449;
  }
  
  /* Low severity (yellow) */
  .alarm-badge-low {
    background-color: #F3AC20;
  }
  
  /* Make SVG icons white inside badges */
  .alarm-badge .alarm-icon {
    filter: brightness(0) invert(1); /* Makes any color white */
  }
  
  /* Force timeline chart legends to stack vertically */
  .chart-legend ul {
      display: flex !important;
      flex-direction: column !important;
      align-items: flex-start !important;
  }
  
  .chart-legend li {
      display: block !important;
      margin-bottom: 4px !important;
      width: 100% !important;
  }
  
  /* Prevent legend text overflow */
  .chart-legend .legend-text {
      white-space: nowrap !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      max-width: 90px !important;
  }
  
  /* Force Chart.js timeline legends to stack vertically */
  canvas + .chartjs-legend,
  .chartjs-legend {
      display: flex !important;
      flex-direction: column !important;
      align-items: flex-start !important;
  }
  
  .chartjs-legend ul {
      display: flex !important;
      flex-direction: column !important;
      align-items: flex-start !important;
      list-style: none !important;
      margin: 0 !important;
      padding: 0 !important;
  }
  
  .chartjs-legend li {
      display: flex !important;
      align-items: center !important;
      margin-bottom: 2px !important;
      width: 100% !important;
  }
  
  /* Target the specific timeline chart legend containers */
  #participantWearChart-* + .legend,
  #participantChargingChart-* + .legend,
  [id*="participantWearChart"] ~ .legend,
  [id*="participantChargingChart"] ~ .legend {
      display: flex !important;
      flex-direction: column !important;
  }
  
  /* Disable modal animation to prevent janky resizing */
  .modal.fade {
      transition: none !important;
  }
  
  .modal.fade .modal-dialog {
      transition: none !important;
      transform: none !important;
  }
  
  .modal-dialog {
      margin: 1.75rem auto !important;
  }
  
  /* Chart loading overlay styles */
  .chart-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(248, 249, 250, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 4px;
    border: 1px solid #dee2e6;
  }
  
  .loading-content {
    text-align: center;
    color: #00AE99;
  }
  
  .loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #00AE99;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px;
  }
  
  .loading-text {
    font-size: 12px;
    font-weight: 500;
    color: #00AE99;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  /* Hide the old loading spinner */
  #loadingSpinner-* {
    display: none !important;
  }
  
  /* Allow chart tooltips to overflow container */
  .chart-container {
    position: relative;
    overflow: visible !important;
  }
  
  /* Make sure chart canvas containers allow overflow */
  canvas {
    position: relative;
    z-index: 1;
  }
  
  /* Chart.js tooltip positioning */
  .chartjs-tooltip {
    position: absolute !important;
    z-index: 1000 !important;
    pointer-events: none !important;
  }
  
  /* Enhanced modal scrolling styles */
  .modal-content {
    max-height: 95vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  
  .modal-body {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }
  
  /* Chart container improvements for scrolling */
  .chart-container {
    position: relative;
    margin-bottom: 1rem;
    min-height: 85px; /* Ensure minimum height */
  }
  
  /* Ensure charts don't interfere with scrolling */
  .chart-container canvas {
    max-width: 100%;
    height: auto;
  }
  
  /* Timeline chart containers */
  .device-timeline-container {
    position: relative;
    margin-bottom: 1rem;
    min-height: 60px;
  }
  
  /* Improve scrollbar appearance */
  .modal-body::-webkit-scrollbar {
    width: 8px;
  }
  
  .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
  }
  
  .modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
  }
  
  .modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
  }
  
  /* Fix for chart tooltips in scrollable container */
  .chartjs-tooltip {
    position: fixed !important;
    z-index: 1060 !important;
    pointer-events: none !important;
  }
  
  /* Prevent modal from jumping when scrolling */
  .modal.fade .modal-dialog {
    transform: none !important;
    transition: none !important;
  }
  
  /* Ensure proper spacing between charts */
  .chart-container,
  .device-timeline-container {
    margin-bottom: 1rem;
  }
  
  /* Last chart shouldn't have bottom margin */
  .chart-container:last-child,
  .device-timeline-container:last-child {
    margin-bottom: 0;
  }
  
  /* Loading overlay adjustments for scrollable content */
  .chart-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(248, 249, 250, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 4px;
    border: 1px solid #dee2e6;
  }
  
  /* Update chart no data overlay to use yellow warning colors */
  .chart-no-data-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
  }
  
  .no-data-content {
    background: #fff3cd;  /* Changed from red to warning yellow */
    border: 2px solid #ffc107;  /* Changed from red to warning amber */
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
  }
  
  .no-data-icon {
    font-size: 24px;
    color: #856404;  /* Changed from red to warning brown */
    margin-bottom: 10px;
  }
  
  .no-data-text {
    font-size: 14px;
    color: #856404;  /* Changed from red to warning brown */
    font-weight: 500;
  }
  
  /* Override the global button margin for btn-group */
  .btn-group .btn {
    margin-right: 0 !important;
  }
  .btn-group > .btn:not(:first-child) {
    margin-left: -1px;
  }
  /* First button - only right side flat */
  .btn-group > .btn:first-child {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }
  /* Middle button(s) - completely flat */
  .btn-group > .btn:not(:first-child):not(:last-child) {
    border-radius: 0 !important;
  }
  /* Last button - only left side flat */
  .btn-group > .btn:last-child {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
  }
  /* Black text on hover */
  .btn-group > .btn:hover {
    color: #000 !important;
  }

  /* Override the global button margin for btn-group */
  .btn-group .btn {
    margin-right: 0 !important;
  }
  .btn-group > .btn:not(:first-child) {
    margin-left: -1px;
  }
  /* First button - only right side flat */
  .btn-group > .btn:first-child {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }
  /* Middle button(s) - completely flat */
  .btn-group > .btn:not(:first-child):not(:last-child) {
    border-radius: 0 !important;
  }
  /* Last button - only left side flat */
  .btn-group > .btn:last-child {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
  }
  /* Black text on hover */
  .btn-group > .btn:hover {
    color: #000 !important;
  }