/* Global rule to prevent zoom on mobile inputs - applies to ALL screen sizes */
input[type="text"],
input[type="email"], 
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea,
.form-control,
.form-control-sm,
.form-control-lg,
.form-select {
    font-size: 16px !important; /* Prevents zoom on iOS and Android */
}

/* Additional mobile zoom prevention - catch any missed cases */
@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* Specifically target Bootstrap form controls */
    .form-control, 
    .form-control-sm, 
    .form-control-lg,
    .form-select {
        font-size: 16px !important;
    }
    
    /* Override for filter dropdowns to make text smaller on mobile - EXCLUDE search input */
    .filter-select-wrapper select,
    .compact-filters select {
        font-size: 0.75rem !important;
    }
    
    /* Keep search input at 16px to prevent zoom */
    #nameSearch,
    input[type="search"],
    .input-group .form-control {
        font-size: 16px !important;
    }
}

/* ============================================
   ANIMATED HAMBURGER MENU STYLES
   ============================================ */

/* Disable Bootstrap's default collapse animations globally */
.collapse,
.collapsing {
    transition: none !important;
    -webkit-transition: none !important;
}

/* Custom animated hamburger menu */
.navbar-toggler {
    position: relative;
    width: 44px;
    height: 44px;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3) !important;
    outline: none !important;
}

.navbar-toggler:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: scale(1.05);
}

.navbar-toggler:active {
    transform: scale(0.95);
}

/* Hide the default Bootstrap icon */
.navbar-toggler-icon {
    display: none;
}

/* Custom hamburger lines */
.navbar-toggler::before,
.navbar-toggler::after {
    content: '';
    position: absolute;
    left: 50%;
    width: 24px;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: all 0.25s ease-out;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.navbar-toggler .hamburger-line {
    display: block !important;
    position: absolute !important;
    left: 50% !important;
    width: 24px !important;
    height: 3px !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-radius: 2px !important;
    transform: translateX(-50%) translateY(-50%) !important;
    transition: all 0.25s ease-out !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    top: 50% !important;
    z-index: 1 !important;
}

/* Alternative approach using pseudo-element for middle line */
.navbar-toggler .hamburger-line::before {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-radius: 2px !important;
}

.navbar-toggler::before {
    top: 12px;
}

.navbar-toggler::after {
    bottom: 12px;
}

/* Animation when menu is open */
.navbar-toggler[aria-expanded="true"]::before {
    top: 50%;
    transform: translateX(-50%) translateY(-50%) rotate(45deg);
    background-color: #343a40;
}

.navbar-toggler[aria-expanded="true"]::after {
    bottom: 50%;
    transform: translateX(-50%) translateY(50%) rotate(-45deg);
    background-color: #343a40;
}

.navbar-toggler[aria-expanded="true"] .hamburger-line,
.navbar-toggler[aria-expanded="true"] .hamburger-line::before {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(-50%) scale(0) !important;
}

/* Enhanced menu collapse animation - Disable Bootstrap defaults */
.navbar-collapse {
    transform-origin: top !important;
    overflow: hidden !important;
    transition: none !important;
}

.navbar-collapse.collapsing {
    transform-origin: top !important;
    transition: none !important;
    height: auto !important;
    overflow: visible !important;
}

/* Menu slide-down animation */
@media (max-width: 767.98px) {
    .navbar-collapse {
        background: rgba(248, 249, 250, 0.95) !important;
        border-radius: 8px !important;
        margin-top: 8px !important;
        padding: 12px !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
        backdrop-filter: blur(8px) !important;
        border: 1px solid rgba(0, 0, 0, 0.05) !important;
        transition: none !important;
    }
    
    .navbar-collapse.show {
        animation: slideDown 0.25s ease-out !important;
    }
    
    /* Disable Bootstrap's default collapse animation */
    .navbar-collapse.collapsing {
        transition: none !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    /* Force Bootstrap dark navbar text to be dark on mobile with tenant-specific icons */
    .navbar-dark .navbar-collapse .navbar-nav .nav-link {
        color: #333 !important;
    }
    
    .navbar-dark .navbar-collapse .navbar-nav .nav-link:hover,
    .navbar-dark .navbar-collapse .navbar-nav .nav-link:focus {
        color: #000 !important;
    }
    
    .navbar-dark .navbar-collapse .navbar-nav .nav-link i {
        color: var(--tenant-primary) !important;
    }
    
    .navbar-dark .navbar-collapse .navbar-nav .nav-link:hover i {
        color: var(--tenant-primary) !important;
    }
    
    /* Animate nav items */
    .navbar-nav .nav-item {
        opacity: 0;
        transform: translateY(-5px);
        animation: fadeInUp 0.2s ease forwards;
    }
    
    .navbar-collapse.show .nav-item:nth-child(1) {
        animation-delay: 0.05s;
    }
    
    .navbar-collapse.show .nav-item:nth-child(2) {
        animation-delay: 0.08s;
    }
    
    .navbar-collapse.show .nav-item:nth-child(3) {
        animation-delay: 0.11s;
    }
    
    .navbar-collapse.show .nav-item:nth-child(4) {
        animation-delay: 0.14s;
    }
    
    .navbar-collapse.show .nav-item:nth-child(5) {
        animation-delay: 0.17s;
    }
    
    .navbar-collapse.show .nav-item:nth-child(6) {
        animation-delay: 0.2s;
    }
    
    /* Enhanced nav link styles - Override Bootstrap */
    .navbar-dark .navbar-nav .nav-link,
    .navbar-nav .nav-link {
        padding: 10px 12px !important;
        margin: 2px 0 !important;
        border-radius: 6px !important;
        transition: all 0.2s ease !important;
        color: #333 !important;
        font-weight: 500 !important;
        display: flex !important;
        align-items: center !important;
        text-decoration: none !important;
    }
    
    .navbar-dark .navbar-nav .nav-link:hover,
    .navbar-dark .navbar-nav .nav-link:focus,
    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:focus {
        background: rgba(0, 0, 0, 0.05) !important;
        color: #000 !important;
        transform: translateX(3px) !important;
    }
    
    .navbar-dark .navbar-nav .nav-link:active,
    .navbar-nav .nav-link:active {
        transform: translateX(3px) scale(0.98) !important;
        color: #000 !important;
    }
    
    .navbar-dark .navbar-nav .nav-link i,
    .navbar-nav .nav-link i {
        margin-right: 10px !important;
        font-size: 1em !important;
        width: 18px !important;
        text-align: center !important;
        transition: transform 0.2s ease !important;
        color: var(--tenant-primary) !important;
    }
    
    .navbar-dark .navbar-nav .nav-link:hover i,
    .navbar-nav .nav-link:hover i {
        transform: scale(1.05) !important;
        color: var(--tenant-primary) !important;
    }
    
    /* Ensure text spans are also blue */
    .navbar-dark .navbar-nav .nav-link span,
    .navbar-nav .nav-link span {
        color: inherit !important;
    }
}

/* Keyframe animations */
@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translateY(-8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}



/* Smooth focus transitions */
.navbar-toggler:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4) !important;
    animation: focusPulse 0.3s ease;
}

@keyframes focusPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
    }
}

/* Enhanced touch feedback */
@media (hover: none) and (pointer: coarse) {
    .navbar-toggler:active {
        transform: scale(0.9);
        transition: transform 0.1s ease;
    }
    
    .navbar-nav .nav-link:active {
        transform: translateX(3px) scale(0.96);
        transition: transform 0.1s ease;
        color: #000 !important;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .navbar-toggler,
    .navbar-toggler::before,
    .navbar-toggler::after,
    .navbar-toggler .hamburger-line,
    .navbar-collapse,
    .navbar-nav .nav-link {
        transition: none !important;
        animation: none !important;
    }
    
    .navbar-nav .nav-item {
        animation: none !important;
    }
}

/* ============================================
   END ANIMATED HAMBURGER MENU STYLES
   ============================================ */

/* Styles moved from dashboard.html */
.breadcrumb {
  background-color: #fff5f5;
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
}
.card-header {
  font-weight: bold;
  background-color: #356c9a !important;
  color: white !important;
  border-bottom: 1px solid #2a5a82 !important;
}
.table {
  font-size: 0.85rem;
}
.table th,
.table td {
  padding: 0.5rem;
}

/* Professional Color Overrides */
.btn-primary {
  background-color: var(--tenant-primary) !important;
  border-color: var(--tenant-primary) !important;
  color: white !important;
}

.btn-primary:hover {
  background-color: var(--tenant-primary-dark) !important;
  border-color: var(--tenant-primary-dark) !important;
}

/* Dark button styles for neutral/no-tenant mode */
.btn-dark {
  background-color: #343a40 !important;
  border-color: #343a40 !important;
  color: #ffffff !important;
  transition: all 0.2s ease;
}

.btn-dark:hover {
  background-color: #23272b !important;
  border-color: #1d2124 !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-dark:focus,
.btn-dark:active {
  background-color: #1d2124 !important;
  border-color: #171a1d !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 0.2rem rgba(82, 88, 93, 0.5);
}

.btn-primary.focus, .btn-primary:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--tenant-primary-rgb), 0.5) !important;
}

.btn-secondary {
  background-color: #464d50 !important;
  border-color: #464d50 !important;
  color: white !important;
}

.btn-secondary:hover {
  background-color: #3a4043 !important;
  border-color: #3a4043 !important;
}

.btn-outline-primary {
  color: var(--tenant-primary) !important;
  border-color: var(--tenant-primary) !important;
}

.btn-outline-primary:hover {
  background-color: var(--tenant-primary) !important;
  border-color: var(--tenant-primary) !important;
  color: white !important;
}

.btn-outline-secondary {
  color: #464d50 !important;
  border-color: #464d50 !important;
}

.btn-outline-secondary:hover {
  background-color: #464d50 !important;
  border-color: #464d50 !important;
  color: white !important;
}

/* Navbar Professional Colors */
.navbar-dark {
  background-color: #464d50 !important;
}

.navbar-dark .navbar-brand, .navbar-dark .navbar-nav .nav-link {
  color: #fff5f5 !important;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: #ffffff !important;
}

/* Professional Badge Colors */
.badge-primary {
  background-color: var(--tenant-primary) !important;
  color: white !important;
}

.badge-secondary {
  background-color: #464d50 !important;
  color: white !important;
}

.badge-success {
  background-color: #28a745 !important; /* Bootstrap green */
  color: white !important;
}

.badge-danger {
  background-color: #dc3545 !important; /* Bootstrap red */
  color: white !important;
}

.badge-warning {
  background-color: var(--tenant-primary) !important;
  color: white !important;
}

.badge-info {
  background-color: #464d50 !important;
  color: white !important;
}

/* Professional Card Colors */
.card-header.bg-success {
  background-color: var(--tenant-primary) !important;
  color: white !important;
}

.card-header.bg-danger {
  background-color: #464d50 !important;
  color: white !important;
}

/* Modal and Form Text Colors */
.modal-header {
  background-color: var(--tenant-primary) !important;
  color: white !important;
}

.modal-header .modal-title {
  color: white !important;
}

.modal-header .close {
  color: white !important;
  opacity: 0.8;
}

.modal-header .close:hover {
  color: white !important;
  opacity: 1;
}

/* Form Labels */
.form-label {
  color: #464d50 !important;
  font-weight: 600;
}

/* Card Header Text */
.card-header h1, 
.card-header h2, 
.card-header h3, 
.card-header h4, 
.card-header h5, 
.card-header h6,
.card-header {
  color: white !important;
}

.card-header .text-muted {
  color: rgba(255, 255, 255, 0.7) !important;
}

/* Button text colors */
.btn-info {
  background-color: var(--tenant-primary) !important;
  border-color: var(--tenant-primary) !important;
  color: white !important;
}

.btn-info:hover {
  background-color: var(--tenant-primary-dark) !important;
  border-color: var(--tenant-primary-dark) !important;
  color: white !important;
}

.btn-success {
  background-color: var(--tenant-primary) !important;
  border-color: var(--tenant-primary) !important;
  color: white !important;
}

.btn-success:hover {
  background-color: var(--tenant-primary-dark) !important;
  border-color: var(--tenant-primary-dark) !important;
  color: white !important;
}

/* Action button spacing */
.btn-sm.mr-1 {
  margin-right: 0.5rem !important;
}

/* Ensure all button text is properly visible */
.btn {
  font-weight: 500;
}

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

/* Sort link styling */
.table thead th a {
  color: white !important;
  text-decoration: none;
}

.table thead th a:hover {
  color: rgba(255, 255, 255, 0.8) !important;
  text-decoration: none;
}

/* Professional Table Colors */
.thead-dark th {
  background-color: #464d50 !important;
  border-color: #464d50 !important;
  color: white !important;
}

/* Professional Alert Colors */
.alert-primary {
  background-color: rgba(var(--tenant-primary-rgb), 0.1) !important;
  border-color: var(--tenant-primary) !important;
  color: var(--tenant-primary) !important;
}

.alert-secondary {
  background-color: rgba(70, 77, 80, 0.1) !important;
  border-color: #464d50 !important;
  color: #464d50 !important;
}

/* Professional Tab Colors */
.nav-tabs .nav-link.active {
  background-color: var(--tenant-primary) !important;
  border-color: var(--tenant-primary) !important;
  color: white !important;
}

.nav-tabs .nav-link {
  color: var(--tenant-primary) !important;
}

.nav-tabs .nav-link:hover {
  border-color: var(--tenant-primary) !important;
}

/* General responsive styles */
body {
    background-color: #fff5f5;
    padding-bottom: 1rem;
}

main.container {
    padding-bottom: 2rem;
}

/* Default display states for responsive components */
.mobile-athlete-cards {
    display: none; /* Hidden by default, shown only on mobile */
}

.desktop-athlete-table {
    display: block; /* Shown by default, hidden only on mobile */
}

.mobile-leaderboard-cards {
    display: none; /* Hidden by default, shown only on mobile */
}

.desktop-leaderboard-table {
    display: block; /* Shown by default, hidden only on mobile */
}

/* Enhanced Video Library Styles */
.card-title .badge {
  font-size: 0.65rem;
  font-weight: 500;
  margin-left: 0.25rem;
}

.card-title {
  line-height: 1.3;
}

.card-title .badge-pill {
  padding: 0.25em 0.6em;
}

.favorite-btn {
  background: none !important;
  border: none !important;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #ffc107 !important;
  font-size: inherit;
  outline: none !important;
  box-shadow: none !important;
}

.favorite-btn:hover {
  background: none !important;
  color: #ffc107 !important;
  transform: scale(1.1);
}

.favorite-btn:focus,
.favorite-btn:active {
  background: none !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: #ffc107 !important;
}

.exercise-card-content {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.exercise-card-content:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.exercise-meta .badge {
  font-size: 0.7rem;
}

.exercise-list-item {
  transition: background-color 0.2s ease;
  padding: 1rem !important;
  border-bottom: 1px solid #f1f3f4;
}

.exercise-list-item:last-child {
  border-bottom: none;
}

.exercise-list-item:hover {
  background-color: #fff5f5;
}

.exercise-list-item .row {
  margin: 0;
}

.exercise-list-item .col-md-6,
.exercise-list-item .col-md-3 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.exercise-list-item .btn-group .btn {
  margin-right: 0.25rem;
}

.exercise-list-item .btn-group .btn:last-child {
  margin-right: 0;
}

.exercise-list-item p {
  margin-bottom: 0.25rem;
}

.exercise-list-item .btn-primary.mb-1 {
  margin-bottom: 0.5rem !important;
}

.exercise-list-item .favorite-btn {
  position: static;
  background: transparent;
  width: auto;
  height: auto;
  margin-right: 0.75rem;
  padding: 0.25rem;
}

/* Filter section styling */
.form-label.small {
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #464d50 !important;
}

/* Enhanced filter section layout */
.filter-section .btn-toolbar {
  gap: 0.5rem;
}

.filter-section .btn-group {
  flex-wrap: nowrap;
}

.filter-section .form-control-sm {
  border-radius: 0.375rem;
  font-size: 0.75rem;
}

.filter-section .btn-sm {
  white-space: nowrap;
}

/* Filter button states - High specificity to override JavaScript class changes */
.filter-section .btn[data-active="true"] {
  transition: all 0.2s ease !important;
}

/* =============================================
   MOBILE-RESPONSIVE TOGGLE BUTTON STYLES
   ============================================= */

/* Filter buttons container responsive layout */
.compact-filters .filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: flex-start;
}

@media (min-width: 768px) {
  .compact-filters .filter-buttons {
    justify-content: flex-end;
    gap: 0.5rem;
  }
}

/* Base filter button styling */
.compact-filters .filter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  border-radius: 0.25rem;
  transition: all 0.15s ease-in-out;
}

/* Mobile touch targets */
@media (max-width: 767px) {
  .compact-filters .filter-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 1.1rem;
  }
}

/* Video filter button - uses primary branding when active */
.compact-filters #videoFilter[data-active="true"],
.compact-filters #videoFilter.btn-primary {
  background-color: #000000 !important;
  border-color: #000000 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Metrics filter button - uses neutral gray when active */
.compact-filters #metricFilter[data-active="true"],
.compact-filters #metricFilter.btn-info {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
  color: #ffffff !important;
  box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

/* Favorites filter button - uses warning yellow when active */
.compact-filters #favoritesFilter[data-active="true"],
.compact-filters #favoritesFilter.btn-warning {
  background-color: #ffc107 !important;
  border-color: #ffc107 !important;
  color: #212529 !important;
  box-shadow: 0 2px 4px rgba(255, 193, 7, 0.4);
}

/* Enhanced mobile focus states for better accessibility */
@media (max-width: 767px) {
  .compact-filters .filter-btn:focus {
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
  }
  
  .compact-filters #videoFilter[data-active="true"],
  .compact-filters #metricFilter[data-active="true"],
  .compact-filters #favoritesFilter[data-active="true"] {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }
}

/* View toggle buttons */
.btn-group .btn.active {
  background-color: var(--tenant-primary) !important;
  border-color: var(--tenant-primary) !important;
  color: white;
}

/* Professional Badge color schemes for exercises */
.badge-dynamic { background-color: var(--tenant-primary) !important; color: white !important; }
.badge-sprint { background-color: var(--tenant-primary) !important; color: white !important; }
.badge-total-body { background-color: #464d50 !important; color: white !important; }
.badge-lower-body { background-color: var(--tenant-primary) !important; color: white !important; }
.badge-upper-body { background-color: #464d50 !important; color: white !important; }
.badge-plyometric { background-color: var(--tenant-primary) !important; color: white !important; }

.badge-beginner { background-color: var(--tenant-primary) !important; color: white !important; }
.badge-intermediate { background-color: #464d50 !important; color: white !important; }
.badge-advanced { background-color: var(--tenant-primary) !important; color: white !important; }

/* Accessibility improvements */
.favorite-btn:focus {
  outline: none !important;
  box-shadow: none !important;
  background: none !important;
  border: none !important;
  color: #ffc107 !important;
}

.btn:focus {
  outline: 2px solid var(--tenant-primary);
  outline-offset: 2px;
}

/* Loading states */
.exercise-card-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Search highlight */
.search-highlight {
  background-color: rgba(53, 108, 154, 0.1);
  padding: 1px 2px;
  border-radius: 2px;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    /* Filter section mobile styles */
    .filter-section .btn-toolbar {
        justify-content: center !important;
        gap: 0.25rem;
    }
    
    .filter-section .btn-group {
        margin-bottom: 0.5rem;
    }
    
    .filter-section .btn-sm {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    .filter-section .form-control-sm {
        font-size: 0.75rem;
    }
    
    .filter-section .form-label.small {
        font-size: 0.75rem;
        font-weight: 700;
    }
    
    .card-title .badge {
        font-size: 0.6rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .favorite-btn {
        background: none !important;
        border: none !important;
        padding: 0;
        color: #ffc107 !important;
        font-size: inherit;
    }
    
    .btn-group.w-100 .btn {
        font-size: 0.8rem;
    }
    
    #exerciseCards .col-lg-4 {
        min-height: auto;
    }
    
    /* Mobile table improvements */
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }
    
    /* Mobile athlete cards - replace table on small screens */
    .mobile-athlete-cards {
        display: none;
    }
    
    .desktop-athlete-table {
        display: block;
    }
    
    /* Mobile navigation improvements */
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        text-align: center;
        color: #333 !important;
    }
    
    .navbar-nav .nav-link i {
        color: var(--tenant-primary) !important;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    /* Mobile form improvements */
    .modal-lg {
        max-width: 95% !important;
        margin: 0.5rem;
    }
    
    .modal-xl {
        max-width: 98% !important;
        margin: 0.25rem;
    }
    
    .form-row > .col,
    .form-row > [class*="col-"] {
        padding-right: 7.5px;
        padding-left: 7.5px;
    }
    
    /* Mobile breadcrumb */
    .breadcrumb {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Mobile button improvements */
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
    }
    
    .btn-group .btn {
        font-size: 0.8rem;
    }
    
    /* Mobile card improvements */
    .card-header h4 {
        font-size: 1.1rem;
    }
    
    /* Mobile spacing improvements */
    .mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    .mt-4 {
        margin-top: 1.5rem !important;
    }
    
    /* Mobile profile improvements */
    .athlete-profile-mobile {
        padding: 1rem;
    }
    
    .athlete-profile-mobile .card-body {
        padding: 1rem;
    }
    
    .athlete-profile-mobile .btn {
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    /* Mobile session list improvements */
    .session-list-mobile .list-group-item {
        padding: 1rem;
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    
    .session-list-mobile .list-group-item:first-child {
        border-top-left-radius: 0.25rem;
        border-top-right-radius: 0.25rem;
    }
    
    .session-list-mobile .list-group-item:last-child {
        border-bottom-left-radius: 0.25rem;
        border-bottom-right-radius: 0.25rem;
    }
    
    /* Enhanced mobile modal improvements */
    .modal {
        padding: 0 !important;
    }
    
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
        width: calc(100vw - 1rem);
    }
    
    .modal-dialog.modal-lg {
        max-width: calc(100vw - 1rem);
        width: calc(100vw - 1rem);
    }
    
    .modal-dialog.modal-xl {
        max-width: calc(100vw - 0.5rem);
        width: calc(100vw - 0.5rem);
        margin: 0.25rem;
        height: calc(100vh - 0.5rem);
    }
    
    .modal-xl .modal-content {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .modal-xl .modal-body {
        flex: 1;
        overflow-y: auto;
        padding: 1rem;
    }
    
    /* Mobile modal headers */
    .modal-header {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #dee2e6;
        background: linear-gradient(135deg, var(--tenant-primary) 0%, var(--tenant-primary-dark) 100%);
        color: white;
        border-radius: 0.375rem 0.375rem 0 0;
    }
    
    .modal-header .modal-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: white;
    }
    
    .modal-header .close {
        padding: 0.5rem;
        margin: -0.5rem -1rem -0.5rem auto;
        color: white;
        opacity: 0.8;
        font-size: 1.5rem;
        font-weight: 300;
        text-shadow: none;
    }
    
    .modal-header .close:hover {
        color: white;
        opacity: 1;
    }
    
    .modal-header .close:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
    }
    
    /* Mobile modal body improvements */
    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile modal footers */
    .modal-footer {
        padding: 1rem;
        border-top: 1px solid #dee2e6;
        background-color: #f8f9fa;
        border-radius: 0 0 0.375rem 0.375rem;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .modal-footer .btn {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 576px) {
    /* Extra small screens */
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    main.container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Mobile athlete cards instead of table */
    .mobile-athlete-cards {
        display: block;
    }
    
    .desktop-athlete-table {
        display: none;
    }
    
    .mobile-athlete-card {
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        margin-bottom: 1rem;
        padding: 1rem;
        background: white;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
    
    .mobile-athlete-card:hover {
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
        transform: translateY(-1px);
        transition: all 0.2s ease;
    }
    
    .mobile-athlete-header {
        display: flex;
        align-items: center;
        margin-bottom: 0.75rem;
    }
    
    .mobile-athlete-avatar {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        margin-right: 1rem;
        object-fit: cover;
    }
    
    .mobile-athlete-avatar-placeholder {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        margin-right: 1rem;
        background-color: #6c757d;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
    }
    
    .mobile-athlete-name {
        font-size: 1.125rem;
        font-weight: 600;
        margin: 0;
        color: var(--tenant-primary);
    }
    
    .mobile-athlete-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .mobile-athlete-detail {
        font-size: 0.875rem;
    }
    
    .mobile-athlete-detail-label {
        color: #6c757d;
        font-weight: 600;
    }
    
    .mobile-athlete-actions {
        display: flex;
        gap: 0.5rem;
    }
    
    .mobile-athlete-actions .btn {
        flex: 1;
        font-size: 0.875rem;
    }
    
    /* Mobile filter improvements */
    .filter-section .row.align-items-end {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-section .row.align-items-end > div {
        width: 100%;
        margin-bottom: 0;
    }
    
    .filter-section .btn-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .filter-section .btn-group {
        flex-wrap: wrap;
    }
    
    .filter-section .btn-group .btn {
        flex: 1;
        min-width: 0;
    }
    
    .filter-section .btn-sm span {
        display: none;
    }
    
    .filter-section .d-none.d-lg-inline {
        display: none !important;
    }
    
    /* Mobile leaderboard improvements */
    .mobile-leaderboard-cards {
        display: block;
    }
    
    .desktop-leaderboard-table {
        display: none;
    }
    
    /* System Metrics Configuration mobile improvements */
    #metrics .table th:first-child,
    #metrics .table td:first-child {
        width: 10% !important;
        max-width: 10% !important;
    }
    
    #metrics .table th:nth-child(2),
    #metrics .table td:nth-child(2) {
        width: 5% !important;
        max-width: 5% !important;
        padding: 0.25rem 0.125rem !important;
        text-align: center !important;
    }
    
    #metrics .table th:last-child,
    #metrics .table td:last-child {
        width: 10% !important;
        max-width: 10% !important;
    }
    
    #metrics .table-responsive {
        border-radius: 0.375rem;
        margin: 0 -0.5rem;
        padding: 0 0.5rem;
    }
    
    #metrics .card-footer {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    #metrics .card-footer .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .mobile-leaderboard-card {
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        margin-bottom: 0.75rem;
        padding: 1rem;
        background: white;
        position: relative;
    }
    
    .mobile-leaderboard-rank {
        position: absolute;
        top: -8px;
        left: -8px;
        background: var(--tenant-primary);
        color: white;
        border-radius: 50%;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 0.875rem;
    }
    
    /* Mobile medal styling for top 3 positions */
    .mobile-leaderboard-card:nth-child(1) .mobile-leaderboard-rank {
        background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
        color: #856404;
        width: 36px;
        height: 36px;
        font-size: 1rem;
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    }
    
    .mobile-leaderboard-card:nth-child(2) .mobile-leaderboard-rank {
        background: linear-gradient(135deg, #c0c0c0 0%, #e5e5e5 100%);
        color: #495057;
        width: 36px;
        height: 36px;
        font-size: 1rem;
        box-shadow: 0 2px 8px rgba(192, 192, 192, 0.3);
    }
    
    .mobile-leaderboard-card:nth-child(3) .mobile-leaderboard-rank {
        background: linear-gradient(135deg, #cd7f32 0%, #daa520 100%);
        color: #8b4513;
        width: 36px;
        height: 36px;
        font-size: 1rem;
        box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3);
    }
    
    .mobile-leaderboard-header {
        display: flex;
        align-items: center;
        margin-bottom: 0.5rem;
        padding-left: 1rem;
    }
    
    .mobile-leaderboard-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        margin-right: 0.75rem;
        object-fit: cover;
    }
    
    .mobile-leaderboard-name {
        font-size: 1rem;
        font-weight: 600;
        margin: 0;
        color: var(--tenant-primary);
    }
    
    .mobile-leaderboard-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        padding-left: 1rem;
        font-size: 0.875rem;
    }
    
    .mobile-leaderboard-score {
        background: #f8f9fa;
        padding: 0.5rem;
        border-radius: 0.25rem;
        text-align: center;
        margin-top: 0.5rem;
        margin-left: 1rem;
    }
    
    .mobile-leaderboard-score-value {
        font-size: 1.25rem;
        font-weight: bold;
        color: var(--tenant-primary);
    }
    
    .mobile-leaderboard-score-label {
        font-size: 0.75rem;
        color: #6c757d;
        text-transform: uppercase;
    }
    
    /* Mobile profile page improvements */
    .mobile-profile-layout .col-md-6 {
        margin-bottom: 1.5rem;
    }
    
    .mobile-profile-layout .card-body {
        padding: 1rem;
    }
    
    .mobile-profile-layout .row.align-items-center {
        text-align: center;
    }
    
    .mobile-profile-layout .row.align-items-center .col-md-8 {
        margin-top: 1rem;
    }
    
    .mobile-profile-layout dl.row dt,
    .mobile-profile-layout dl.row dd {
        text-align: left;
    }
    
    .mobile-profile-layout dl.row dt {
        font-size: 0.875rem;
    }
    
    .mobile-profile-layout dl.row dd {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
    
    /* Enhanced mobile athlete details card */
    .mobile-profile-layout .card-header {
        padding: 0.75rem 1rem;
    }
    
    .mobile-profile-layout .card-header h4 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    /* Compact mobile athlete header */
    .mobile-athlete-header-compact {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .mobile-athlete-status-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .mobile-athlete-actions-compact {
        display: flex;
        gap: 0.25rem;
        flex-wrap: wrap;
    }
    
    .mobile-athlete-actions-compact .btn {
        flex: 1;
        min-width: 0;
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
        white-space: nowrap;
    }
    
    /* Compact profile image section */
    .mobile-profile-image-section {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .mobile-profile-image-section img,
    .mobile-profile-image-section i {
        width: 80px !important;
        height: 80px !important;
        font-size: 4rem !important;
    }
    
    /* Optimized details grid */
    .mobile-details-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem 1rem;
        margin-top: 0.5rem;
    }
    
    .mobile-detail-item {
        display: flex;
        flex-direction: column;
    }
    
    .mobile-detail-label {
        font-size: 0.75rem;
        color: #6c757d;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 0.125rem;
    }
    
    .mobile-detail-value {
        font-size: 0.875rem;
        color: #333;
        font-weight: 500;
        word-break: break-word;
    }
    
    /* Special styling for email field */
    .mobile-detail-item.email .mobile-detail-value {
        font-size: 0.8rem;
        word-break: break-all;
    }
    
    /* Status badge in mobile */
    .mobile-detail-item.status .mobile-detail-value {
        display: flex;
        align-items: center;
    }
    
    .mobile-detail-item.status .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Responsive button improvements */
    .mobile-athlete-actions-compact .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        border-radius: 1rem;
        min-height: 32px;
    }
    
    .mobile-athlete-actions-compact .btn-success {
        background-color: #28a745 !important;
        border-color: #28a745 !important;
    }
    
    .mobile-athlete-actions-compact .btn-outline-primary {
        font-weight: 500;
    }
    
    /* Compact spacing */
    .mobile-profile-layout .athlete-profile-mobile {
        padding: 0.75rem;
    }
    
    /* Testing history header improvements */
    .mobile-profile-layout .card-header.bg-light {
        background-color: var(--tenant-primary) !important;
        border-bottom: 1px solid #dee2e6;
        padding: 0.75rem 1rem;
    }
    
    .mobile-profile-layout .card-header .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
        border-radius: 1rem;
    }
    
    /* Profile card overall improvements */
    .mobile-profile-layout .card {
        border-radius: 0.5rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        border: 1px solid #e9ecef;
    }
    
    .mobile-profile-layout .card-header {
        border-radius: 0.5rem 0.5rem 0 0;
        background: linear-gradient(135deg, var(--tenant-primary) 0%, var(--tenant-primary-dark) 100%);
        color: white;
        border-bottom: none;
    }
    
    .mobile-profile-layout .card-body {
        border-radius: 0 0 0.5rem 0.5rem;
    }
    
    /* Mobile session history improvements */
    .mobile-session-list .list-group-item {
        padding: 1rem;
        border-radius: 0.375rem !important;
        margin-bottom: 0.75rem;
        border: 1px solid #dee2e6;
    }
    
    .mobile-session-list .list-group-item h5 {
        font-size: 1rem;
    }
    
    .mobile-session-list .list-group-item small {
        font-size: 0.8rem;
    }
    #sign-in-icon{
        background-color: #464d50  !important;
        color: #ffffff !important;
    }
    
    /* Mobile modals */
    .modal-content {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        flex: 1;
        min-width: 0;
    }
    
    /* Mobile video modal */
    .modal-xl .modal-content {
        height: 90vh;
    }
    
    .modal-xl .modal-body {
        padding: 0;
        overflow: hidden;
    }
    
    /* Mobile forms */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Additional zoom prevention for all input types on mobile */
    input[type="text"],
    input[type="email"], 
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="date"],
    input[type="time"],
    input[type="datetime-local"],
    select,
    textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
    
    .form-row {
        margin-left: -5px;
        margin-right: -5px;
    }
    
    .form-row > .col,
    .form-row > [class*="col-"] {
        padding-right: 5px;
        padding-left: 5px;
    }
    
    /* Mobile utility classes */
    .mobile-text-center {
        text-align: center;
    }
    
    .mobile-mb-3 {
        margin-bottom: 1rem;
    }
    
    .mobile-p-2 {
        padding: 0.5rem;
    }
    
    /* Hide elements on mobile */
    .d-mobile-none {
        display: none !important;
    }
    
    /* Show elements only on mobile */
    .d-mobile-block {
        display: block !important;
    }
    
    .d-mobile-flex {
        display: flex !important;
    }
    
    /* Mobile dashboard button improvements */
    .btn-group .btn {
        min-width: 44px; /* Ensure touch-friendly size */
    }
    
    .btn-group .btn i {
        margin-right: 0 !important; /* Remove margin when text is hidden */
    }
    
    /* Dashboard header improvements */
    .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .d-flex.justify-content-between.align-items-center.mb-4 .btn-group {
        align-self: stretch;
        width: 100%;
    }
    
    .d-flex.justify-content-between.align-items-center.mb-4 .btn-group .btn {
        flex: 1;
        justify-content: center;
    }
    
    /* Mobile breadcrumb adjustments */
    .breadcrumb {
        width: 100%;
        margin-bottom: 0;
        padding: 0.5rem;
        font-size: 0.875rem;
    }
}

/* Tablet specific styles */
@media (min-width: 577px) and (max-width: 768px) {
    .mobile-athlete-cards {
        display: none;
    }
    
    .desktop-athlete-table {
        display: block;
    }
    
    .mobile-leaderboard-cards {
        display: none;
    }
    
    .desktop-leaderboard-table {
        display: block;
    }
    
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 0.75rem 0.5rem;
    }
    
    .btn-group .btn {
        font-size: 0.875rem;
    }
    
    .modal-lg {
        max-width: 90%;
    }
    
    .modal-xl {
        max-width: 95%;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px; /* Minimum touch target size */
    }
    
    .btn-sm {
        min-height: 36px;
    }
    
    .favorite-btn {
        background: none !important;
        border: none !important;
        padding: 0;
        color: #ffc107 !important;
        font-size: inherit;
        touch-action: manipulation;
        outline: none !important;
        box-shadow: none !important;
    }
    
    .favorite-btn:focus,
    .favorite-btn:active {
        background: none !important;
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
        color: #ffc107 !important;
    }
    
    .list-group-item-action {
        padding: 1rem;
    }
    
    .table-responsive .table th,
    .table-responsive .table td {
        padding: 0.75rem;
    }
    
    /* Prevent sticky hover effects on INACTIVE filter buttons for touch devices */
    .compact-filters .filter-btn:not([data-active="true"]):hover,
    .compact-filters .btn-outline-secondary:not([data-active="true"]):hover,
    .compact-filters .btn-outline-warning:not([data-active="true"]):hover {
        background-color: initial !important;
        border-color: initial !important;
        color: initial !important;
        transform: none !important;
        box-shadow: none !important;
    }
    
    /* Ensure active states maintain their styling on touch devices */
    .compact-filters .filter-btn[data-active="true"],
    .compact-filters .filter-btn[data-active="true"]:hover,
    .compact-filters .filter-btn[data-active="true"]:active,
    .compact-filters .btn-outline-secondary[data-active="true"],
    .compact-filters .btn-outline-secondary[data-active="true"]:hover,
    .compact-filters .btn-outline-secondary[data-active="true"]:active {
        background-color: #356c9a !important; 
        border-color: #356c9a !important;
        color: white !important;
        box-shadow: 0 2px 4px rgba(53, 108, 154, 0.3) !important;
    }
    
    .compact-filters .filter-btn.btn-outline-warning[data-active="true"],
    .compact-filters .filter-btn.btn-outline-warning[data-active="true"]:hover,
    .compact-filters .filter-btn.btn-outline-warning[data-active="true"]:active,
    .compact-filters .btn-outline-warning[data-active="true"],
    .compact-filters .btn-outline-warning[data-active="true"]:hover,
    .compact-filters .btn-outline-warning[data-active="true"]:active {
        background-color: #ffc107 !important;
        border-color: #ffc107 !important;
        color: #212529 !important;
        box-shadow: 0 2px 4px rgba(255, 193, 7, 0.4) !important;
    }
    
    /* Ensure inactive buttons maintain their proper outline styling on touch */
    .compact-filters .filter-btn:not([data-active="true"]),
    .compact-filters .btn-outline-secondary:not([data-active="true"]) {
        background-color: white !important;
        border-color: #6c757d !important;
        color: #6c757d !important;
    }
    
    .compact-filters .filter-btn.btn-outline-warning:not([data-active="true"]),
    .compact-filters .btn-outline-warning:not([data-active="true"]) {
        background-color: white !important;
        border-color: #ffc107 !important;
        color: #856404 !important;
    }
    
    /* System Metrics Configuration table mobile optimization */
    #metrics .table-responsive {
        font-size: 0.8rem;
    }
    
    #metrics .table th,
    #metrics .table td {
        padding: 0.5rem 0.25rem;
        vertical-align: middle;
    }
    
    #metrics .table th {
        font-size: 0.75rem;
        font-weight: 600;
    }
    
    #metrics .table td strong {
        font-size: 0.85rem;
    }
    
    #metrics .table td small {
        font-size: 0.7rem;
    }
    
    #metrics .form-control {
        font-size: 0.8rem;
        padding: 0.375rem 0.5rem;
        min-height: 36px;
    }
    
    #metrics .custom-control {
        padding-left: 1.25rem;
    }
    
    #metrics .custom-control-input {
        width: 1rem;
        height: 1rem;
        margin-left: -1.25rem;
    }
}

/* Sticky footer for metrics configuration when tab is active - DESKTOP & MOBILE */
#metrics.show .card-footer,
#metrics.active .card-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background: #f8f9fa;
    border-top: 2px solid #dee2e6;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    margin: 0;
    border-radius: 0;
    padding: 0.75rem 1rem;
}

/* Add bottom padding to metrics card body to prevent content being hidden behind sticky footer */
#metrics.show .card-body,
#metrics.active .card-body {
    padding-bottom: 7rem; /* Increased from 5rem to ensure all content is visible */
}

/* Enhanced Metric Configuration Styles */
.metric-category-section .card {
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease-in-out;
}

.metric-category-section .card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.metric-category-section .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.25rem;
}

.metric-category-section .card-header h5 {
    color: #495057;
    font-weight: 600;
    margin: 0;
}

.metric-category-section .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.metric-row {
    transition: background-color 0.15s ease-in-out;
}

.metric-row:hover {
    background-color: #f8f9fa;
}

.metric-row td {
    vertical-align: middle;
    padding: 0.75rem 1rem;
}

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

/* Search and Filter Controls */
#metrics .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

#metrics .form-control {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

#metrics .form-control:focus {
    border-color: var(--tenant-primary);
    box-shadow: 0 0 0 0.2rem rgba(53, 108, 154, 0.25);
}

/* Summary Statistics Cards */
#metrics .card.bg-primary,
#metrics .card.bg-success,
#metrics .card.bg-info,
#metrics .card.bg-warning {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

#metrics .card.bg-primary:hover,
#metrics .card.bg-success:hover,
#metrics .card.bg-info:hover,
#metrics .card.bg-warning:hover {
    transform: translateY(-2px);
}

#metrics .card.bg-primary h4,
#metrics .card.bg-success h4,
#metrics .card.bg-info h4,
#metrics .card.bg-warning h4 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

#metrics .card.bg-primary small,
#metrics .card.bg-success small,
#metrics .card.bg-info small,
#metrics .card.bg-warning small {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Responsive adjustments for metric configuration */
@media (max-width: 768px) {
    #metrics .row.mb-4 > div {
        margin-bottom: 0.5rem !important;
    }
    
    #metrics .metric-category-section .card-header {
        padding: 0.75rem 1rem;
    }
    
    #metrics .metric-category-section .card-header h5 {
        font-size: 1rem;
    }
    
    #metrics .metric-row td {
        padding: 0.5rem 0.75rem;
    }
    
    #metrics .btn-group-sm .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    #metrics .card.bg-primary h4,
    #metrics .card.bg-success h4,
    #metrics .card.bg-info h4,
    #metrics .card.bg-warning h4 {
        font-size: 1.5rem;
    }
    
    /* Stack filter buttons on mobile */
    #metrics .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    #metrics .d-flex.gap-2 .btn {
        width: 100%;
    }
    #bulk-edit-controls.sticky-bulk-edit {
        position: sticky;
        top: 0;
        z-index: 1050;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        margin-bottom: 0.5rem;
        border-radius: 0 0 8px 8px;
      }
}

/* Filter and Action Button Styles */
#metrics .btn-outline-secondary,
#metrics .btn-outline-info {
    border-width: 1px;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

#metrics .btn-outline-secondary:hover,
#metrics .btn-outline-info:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#metrics .gap-2 {
    gap: 0.5rem !important;
}

/* Enhanced table styles for better readability */
#metrics .table-hover tbody tr:hover {
    background-color: rgba(53, 108, 154, 0.05);
}

#metrics .table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
}

/* Loading state for export button */
#metrics .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Animation for metric rows */
.metric-row {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* High DPI screen improvements */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 2dppx) {
    .athlete-avatar,
    .mobile-athlete-avatar,
    .mobile-leaderboard-avatar {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Professional Text Colors */
.text-primary {
  color: var(--tenant-primary) !important;
}

.text-info {
  color: var(--tenant-primary) !important;
}

.text-success {
  color: var(--tenant-primary) !important;
}

/* Link Colors */
a {
  color: var(--tenant-primary) !important;
}

a:hover {
  color: var(--tenant-primary-dark) !important;
}

/* Override for specific cases that need different spacing */
.fas.no-margin,
.far.no-margin,
.fal.no-margin,
.fab.no-margin {
  margin-right: 0 !important;
}

/* Icon-only buttons and standalone icons */
.btn .fas:only-child,
.btn .far:only-child,
.btn .fal:only-child,
.btn .fab:only-child {
  margin-right: 0 !important;
}

/* Icons in input group addons */
.input-group-text .fas,
.input-group-text .far,
.input-group-text .fal,
.input-group-text .fab {
  margin-right: 0 !important;
}

/* Icons at the end of flex containers */
.d-flex .fas:last-child,
.d-flex .far:last-child,
.d-flex .fal:last-child,
.d-flex .fab:last-child {
  margin-right: 0 !important;
}

/* Icons in badges and pills (they should be close to text) */
.badge .fas,
.badge .far,
.badge .fal,
.badge .fab {
  margin-right: 0.25rem !important;
}

/* Large icon displays (like profile placeholders) */
.fa-2x, .fa-3x, .fa-4x, .fa-5x, .fa-6x, .fa-7x, .fa-8x, .fa-9x, .fa-10x {
  margin-right: 0 !important;
}

/* Button group spacing and alignment */
.btn-group .btn {
  margin-right: 0.25rem;
}

.btn-group .btn:last-child {
  margin-right: 0;
}

/* Filter section improvements */
.filter-section {
  background-color: #fff5f5;
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

/* Improved table header styling */
.table thead th {
  background-color: #464d50 !important;
  color: white !important;
  border-bottom: 2px solid #464d50 !important;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

/* Status badges consistent styling */
.badge {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-weight: 500;
}

/* Action button improvements */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.25rem;
}

/* Consistent card spacing */
.card {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Smaller spacing for inline icons */
.fas.me-1,
.far.me-1,
.fal.me-1,
.fab.me-1 {
  margin-right: 0.25rem !important;
}

/* Larger spacing for headers */
.fas.me-2,
.far.me-2,
.fal.me-2,
.fab.me-2 {
  margin-right: 0.5rem !important;
}

/* Extra large spacing for prominent headers */
.fas.me-3,
.far.me-3,
.fal.me-3,
.fab.me-3 {
  margin-right: 1rem !important;
}

/* Styles for Metric Breakdown table */
.athlete-score {
  font-weight: bold;
  color: var(--tenant-primary) !important;
}

.comparison-cell-better { /* This comparison value is better than athlete's score - BAD for athlete */
  background-color: rgba(220, 53, 69, 0.15) !important;
  color: #dc3545 !important;
  font-weight: bold;
}

.comparison-cell-worse { /* This comparison value is worse than athlete's score - GOOD for athlete */
  background-color: rgba(40, 167, 69, 0.15) !important;
  color: #28a745 !important;
  font-weight: bold;
}

.btn-outline-primary .edit-icon {
    color: var(--tenant-primary);
}

/* Mobile modals */
.modal-content {
    margin: 0.5rem;
    max-height: calc(100vh - 1rem);
    overflow-y: auto;
}

.modal-header {
    padding: 1rem;
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-footer .btn {
    flex: 1;
    min-width: 0;
}

/* Mobile video modal */
.modal-xl .modal-content {
    height: 90vh;
}

.modal-xl .modal-body {
    padding: 0;
    overflow: hidden;
}

/* Enhanced mobile modal improvements */
.modal {
    padding: 0 !important;
}

.modal-dialog {
    margin: 0.5rem;
    max-width: calc(100vw - 1rem);
    width: calc(100vw - 1rem);
}

.modal-dialog.modal-lg {
    max-width: calc(100vw - 1rem);
    width: calc(100vw - 1rem);
}

.modal-dialog.modal-xl {
    max-width: calc(100vw - 0.5rem);
    width: calc(100vw - 0.5rem);
    margin: 0.25rem;
    height: calc(100vh - 0.5rem);
}

.modal-xl .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.modal-xl .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Mobile modal headers */
.modal-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    background: linear-gradient(135deg, var(--tenant-primary) 0%, var(--tenant-primary-dark) 100%);
    color: white;
    border-radius: 0.375rem 0.375rem 0 0;
}

.modal-header .modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.modal-header .close {
    padding: 0.5rem;
    margin: -0.5rem -1rem -0.5rem auto;
    color: white;
    opacity: 0.8;
    font-size: 1.5rem;
    font-weight: 300;
    text-shadow: none;
}

.modal-header .close:hover {
    color: white;
    opacity: 1;
}

.modal-header .close:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

/* Mobile modal body improvements */
.modal-body {
    padding: 1rem;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile modal forms */
.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-body .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
}

    .modal-body .form-control:focus {
        border-color: var(--tenant-primary);
        box-shadow: 0 0 0 0.2rem rgba(var(--tenant-primary-rgb), 0.25);
    }

.modal-body .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.modal-body .form-text {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Mobile modal footers */
.modal-footer {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 0 0 0.375rem 0.375rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-footer .btn {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
}

.modal-footer .btn-secondary {
    order: 1;
}

.modal-footer .btn-primary,
.modal-footer .btn-success {
    order: 2;
}

/* Removed .modal-xl.video-modal styles - now handled by #videoModal rules */

/* Mobile table responsive in modals */
.modal-body .table-responsive {
    font-size: 0.85rem;
    margin: -0.5rem;
    padding: 0.5rem;
}

.modal-body .table-responsive .table th,
.modal-body .table-responsive .table td {
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
    vertical-align: middle;
}

/* Mobile form rows in modals */
.modal-body .row {
    margin: 0 -0.5rem;
}

.modal-body .row > .col,
.modal-body .row > [class*="col-"] {
    padding: 0 0.5rem;
    margin-bottom: 1rem;
}

/* Mobile select and input improvements */
.modal-body select.form-control,
.modal-body input.form-control,
.modal-body textarea.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: none;
    min-height: 44px; /* Touch-friendly */
}

.modal-body select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
    padding-right: 2.5rem;
}

/* Mobile checkbox and radio improvements */
.modal-body .form-check {
    padding-left: 2rem;
    margin-bottom: 1rem;
}

.modal-body .form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    margin-left: -2rem;
    margin-top: 0.125rem;
}

.modal-body .form-check-label {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-left: 0.5rem;
}

/* Mobile accordion/collapse improvements in modals */
.modal-body .card {
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.modal-body .card-header {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: 0.9rem;
}

.modal-body .card-body {
    padding: 1rem;
}

/* Mobile loading states for modals */
.modal-loading {
    opacity: 0.6;
    pointer-events: none;
}

.modal-loading .modal-body::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    margin: -1rem 0 0 -1rem;
    border: 2px solid #f3f3f3;
    border-radius: 50%;
    border-top: 2px solid #356c9a;
    animation: spin 1s linear infinite;
}

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

/* Mobile alert improvements in modals */
.modal-body .alert {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
}

/* Mobile button groups in modals */
.modal-body .btn-group {
    width: 100%;
}

.modal-body .btn-group .btn {
    flex: 1;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

/* Prevent modal bounce on iOS */
.modal {
    -webkit-overflow-scrolling: touch;
}

.modal-open {
    overflow: hidden;
}

/* Modal backdrop improvements */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.6);
}

/* Accessibility improvements for mobile */
.modal-content {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 0.375rem;
}

/* Focus improvements */
.modal-content:focus {
    outline: none;
}

.modal .btn:focus,
.modal .form-control:focus {
    outline: 2px solid #356c9a;
    outline-offset: 2px;
}

/* Mobile session modal improvements */
.modal-xl .modal-dialog {
    height: calc(100vh - 1rem);
    max-height: calc(100vh - 1rem);
    margin: 0.5rem;
}

.modal-xl .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.modal-xl .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

/* Session modal specific improvements */
.modal-body .accordion {
    margin-bottom: 1rem;
}

.modal-body .accordion .card {
    border: 1px solid #e9ecef;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
}

.modal-body .accordion .card-header {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.modal-body .accordion .card-header .btn {
    font-size: 0.9rem;
    font-weight: 600;
    color: #356c9a;
    text-decoration: none;
    padding: 0;
}

.modal-body .accordion .card-body {
    padding: 1rem;
}

.modal-body .form-row {
    margin: 0 -0.5rem;
}

.modal-body .form-row .form-group {
    padding: 0 0.5rem;
    margin-bottom: 1rem;
}

/* Removed .modal-xl#videoModal styles - now handled by #videoModal rules */

/* Video iframe responsive */
.modal-body iframe {
    width: 100%;
    height: 100%;
    min-height: 250px;
    border: none;
}

/* Compact video library for mobile */
.exercise-card {
    margin-bottom: 1rem;
}

.exercise-card .card {
    border-radius: 0.375rem;
    overflow: hidden;
}

.exercise-card .card-body {
    padding: 0.75rem;
}

.exercise-card .card-title {
    font-size: 0.9rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.exercise-card .card-title .badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
}

.exercise-card .card-text {
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.exercise-card .card-footer {
    padding: 0.5rem 0.75rem;
    background: transparent;
}

.exercise-card .btn-group .btn {
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
}

.exercise-card .favorite-btn {
    background: none !important;
    border: none !important;
    padding: 0;
    color: #ffc107 !important;
    font-size: inherit;
}

/* Compact exercise cards grid */
#exerciseCards .col-lg-4,
#exerciseCards .col-md-6 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Filter section mobile improvements */
.filter-section .card-body {
    padding: 1rem;
}

.filter-section .row {
    margin: 0 -0.5rem;
}

.filter-section .row > div {
    padding: 0 0.5rem;
    margin-bottom: 1rem;
}

.filter-section .form-control-sm {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

.filter-section .btn-toolbar {
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-section .btn-group {
    flex-wrap: wrap;
    gap: 0.25rem;
}

.filter-section .btn-sm {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    min-width: 80px;
}

/* Mobile exercise list improvements (admin dashboard) */
.exercise-list-item {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e9ecef;
    background: white;
}

.exercise-list-item h6 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.exercise-list-item .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

.exercise-list-item p {
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.exercise-list-item .btn-group .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.exercise-list-item .favorite-btn {
    position: static;
    background: transparent;
    border: none;
    padding: 0.25rem;
    margin-right: 0.5rem;
}

/* Mobile form improvements in modals */
.modal-body select[multiple] {
    min-height: 120px;
    max-height: 150px;
    font-size: 0.85rem;
}

.modal-body .form-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Mobile accordion improvements */
.accordion .card-header {
    background: linear-gradient(135deg, var(--tenant-primary) 0%, var(--tenant-primary-dark) 100%);
    color: white;
    border-radius: 0.375rem 0.375rem 0 0;
}

.accordion .card-header .btn-link {
    color: white !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.accordion .card-header .btn-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

.accordion .card:first-child .card-header {
    border-radius: 0.375rem 0.375rem 0 0;
}

.accordion .card:last-child .card-body {
    border-radius: 0 0 0.375rem 0.375rem;
}

/* Video library management modal mobile */
.modal-body .input-group {
    margin-bottom: 1rem;
}

.modal-body .input-group .form-control {
    font-size: 0.9rem;
}

.modal-body .btn-toolbar {
    margin-bottom: 1rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-body .btn-toolbar .btn-group {
    flex-wrap: wrap;
    gap: 0.25rem;
}

.modal-body .btn-toolbar .btn {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    min-width: 70px;
}

/* Mobile table in modals */
.modal-body .table-responsive {
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.modal-body .table {
    font-size: 0.8rem;
    margin-bottom: 0;
}

.modal-body .table th,
.modal-body .table td {
    padding: 0.5rem 0.25rem;
    vertical-align: middle;
    border-color: #e9ecef;
}

.modal-body .table thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mobile search results summary */
.modal-body .text-muted.small {
    font-size: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 0.25rem;
}

/* Modal loading improvements */
.modal-body .spinner-border {
    width: 2rem;
    height: 2rem;
}

.modal-body .text-center.p-4 {
    padding: 2rem 1rem !important;
}

/* Mobile modal header improvements */
.modal-header {
    border-radius: 0.375rem 0.375rem 0 0;
}

.modal-header .modal-title {
    font-size: 1rem;
    line-height: 1.4;
}

.modal-header .close {
    font-size: 1.25rem;
    font-weight: 300;
    padding: 0.5rem;
    margin: -0.5rem -0.5rem -0.5rem auto;
}

/* Admin dashboard mobile exercise cards */
.mobile-exercise-cards {
    padding: 0 0.5rem;
}

.mobile-exercise-cards .exercise-list-item {
    margin: 0 -0.5rem 1rem -0.5rem;
}

/* Clean video modal implementation for all screen sizes */
#videoModal .modal-dialog {
    max-width: 90vw;
    width: 90vw;
    margin: 1rem auto;
    height: auto;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 2rem);
}

#videoModal .modal-content {
    border: none;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #000;
    height: auto;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#videoModal .modal-header {
    background: linear-gradient(135deg, var(--tenant-primary) 0%, var(--tenant-primary-dark) 100%);
    border-bottom: none;
    padding: 0.75rem 1rem;
    position: relative;
    z-index: 10;
}

#videoModal .modal-header .modal-title {
    color: white;
    font-size: 1rem;
    font-weight: 600;
}

#videoModal .modal-header .close {
    color: white;
    opacity: 0.9;
    font-size: 1.5rem;
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 9999; /* Highest priority to prevent interference */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#videoModal .modal-header .close:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

/* Video modal favorite button positioning and spacing */
#videoModal .modal-header .favorite-btn {
    color: white;
    opacity: 0.9;
    font-size: 1.2rem;
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    margin-right: 1rem; /* Space between favorite and close button */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

#videoModal .modal-header .favorite-btn:hover {
    background: rgba(255, 193, 7, 0.2);
    opacity: 1;
    transform: scale(1.1);
}

#videoModal .modal-header .ml-auto {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Additional spacing between buttons */
}

#videoModal .modal-body {
    padding: 0;
    background: #000;
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    max-height: 60vh;
}

#videoModal .modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    aspect-ratio: 16/9;
}

#videoModal .modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    display: flex;
    gap: 1.5rem; /* Increased spacing between button groups */
}

#videoModal .modal-footer .btn {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
    font-size: 0.9rem;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    min-width: 120px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#videoModal .modal-footer .btn:hover {
    background: #5a6268;
    border-color: #545b62;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Session modal mobile improvements */
.modal-body .accordion .card {
    margin-bottom: 0.75rem;
    border-radius: 0.375rem;
    overflow: hidden;
}

.modal-body .accordion .card .collapse {
    border-top: 1px solid #e9ecef;
}

.modal-body .accordion .card-body .row {
    margin: 0 -0.25rem;
}

.modal-body .accordion .card-body .row .form-group {
    padding: 0 0.25rem;
    margin-bottom: 0.75rem;
}

.modal-body .form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #495057;
}

.modal-body .form-control {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
}

.modal-body select[multiple] {
    background-image: none;
}

.modal-body select[multiple] option {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

/* Mobile modal footer improvements */
.modal-footer {
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 0.375rem 0.375rem;
}

.modal-footer .btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    min-width: 80px;
    margin: 0 0.25rem;
}

.modal-footer .btn-group {
    width: 100%;
    gap: 0.5rem;
}

.modal-footer .btn-group .btn {
    flex: 1;
    margin: 0;
}

/* Loading state improvements */
.modal-body .spinner-border {
    color: var(--tenant-primary);
}

.modal-body .text-center {
    color: #6c757d;
}

/* Form validation mobile improvements */
.modal-body .invalid-feedback {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.modal-body .form-text {
    color: #6c757d;
    line-height: 1.3;
}

/* Responsive modal sizing */
.modal-lg .modal-dialog {
    max-width: calc(100vw - 1rem);
    margin: 0.5rem;
}

.modal-dialog {
    margin: 0.5rem;
}

/* Exercise card button improvements */
.exercise-list-item .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.exercise-list-item .btn-group .btn {
    flex: 1;
    min-width: 60px;
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badge improvements */
.exercise-list-item .badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Search and filter mobile improvements */
.filter-section .input-group {
    margin-bottom: 1rem;
}

.filter-section .input-group .form-control {
    border-radius: 0.25rem 0 0 0.25rem;
    font-size: 0.9rem;
}

.filter-section .input-group-text {
    background: #f8f9fa;
    border-color: #ced4da;
    color: #6c757d;
    font-size: 0.85rem;
}

.filter-section .btn-outline-secondary {
    border-color: #ced4da;
    color: #6c757d;
    font-size: 0.8rem;
}

/* Consistent spacing */
.card-body {
    padding: 1rem;
}

.card-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(0,0,0,.125);
}

/* Touch-friendly interactions */
.btn, .form-control, .custom-control-label {
    -webkit-tap-highlight-color: transparent;
}

.btn:active, .form-control:focus {
    transform: translateY(1px);
    transition: transform 0.1s;
}

/* Accordion mobile improvements */
.accordion .btn-link {
    padding: 0.75rem 1rem;
    text-align: left;
    width: 100%;
    border: none;
    background: none;
}

.accordion .btn-link:focus {
    box-shadow: none;
    text-decoration: none;
}

.accordion .btn-link[aria-expanded="true"] {
    background: rgba(0, 0, 0, 0.1);
}

/* Custom checkbox improvements */
.custom-control {
    padding-left: 1.75rem;
    margin-bottom: 0.5rem;
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--tenant-primary);
    border-color: var(--tenant-primary);
}

.custom-control-label {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Modal backdrop improvements */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.6);
}

/* Video modal specific enhancements - simplified */
#videoModal {
    z-index: 1060;
}

/* Removed conflicting video modal styles - now handled by #videoModal rules */

    /* Admin dashboard exercise cards - work across all screen sizes */
    #exerciseCards {
        margin: 0 -0.5rem;
    }
    
    #exerciseCards .exercise-card {
        padding: 0 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    #exerciseCards .exercise-card .card {
        height: 100%;
        border-radius: 0.5rem;
        overflow: hidden;
        transition: transform 0.2s, box-shadow 0.2s;
    }
    
    #exerciseCards .exercise-card .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    /* Favorite button next to exercise name */
    #exerciseCards .favorite-btn {
        background: none !important;
        border: none !important;
        padding: 0;
        color: #ffc107 !important;
        font-size: inherit;
        cursor: pointer;
        transition: all 0.2s;
        margin-left: 0.25rem;
        vertical-align: middle;
    }
    
    #exerciseCards .favorite-btn:hover {
        background: none !important;
        color: #ffc107 !important;
        transform: scale(1.1);
    }
    
    /* Card body styling */
    #exerciseCards .card-body {
        padding: 1.25rem;
    }
    
    #exerciseCards .card-title {
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: 0.75rem;
        font-weight: 600;
        display: flex;
        align-items: flex-start;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    #exerciseCards .card-title .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        border-radius: 0.375rem;
    }
    
    #exerciseCards .card-text {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 0.75rem;
        color: #6c757d;
    }
    
    /* Card footer styling */
    #exerciseCards .card-footer {
        padding: 1rem 1.25rem;
        background: transparent;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    #exerciseCards .card-footer .btn {
        font-weight: 500;
        border-radius: 0.375rem;
        transition: all 0.2s;
    }
    
    #exerciseCards .card-footer .btn-primary {
        background: linear-gradient(135deg, var(--tenant-primary) 0%, var(--tenant-primary-dark) 100%);
        border: none;
        font-size: 0.9rem;
        padding: 0.625rem 1.25rem;
    }
    
    #exerciseCards .card-footer .btn-primary:hover {
        background: linear-gradient(135deg, var(--tenant-primary-dark) 0%, var(--tenant-primary-darker) 100%);
        transform: translateY(-1px);
    }
    
    #exerciseCards .card-footer .btn-group {
        margin-top: 0.75rem;
        width: 100%;
        border-radius: 0.375rem;
        overflow: hidden;
    }
    
    #exerciseCards .card-footer .btn-group .btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        border-radius: 0;
        flex: 1;
    }
    
    #exerciseCards .card-footer .btn-group .btn:first-child {
        border-radius: 0.375rem 0 0 0.375rem;
    }
    
    #exerciseCards .card-footer .btn-group .btn:last-child {
        border-radius: 0 0.375rem 0.375rem 0;
    }
    
    /* Responsive grid adjustments */
    @media (max-width: 767.98px) {
        #exerciseCards .col-lg-4,
        #exerciseCards .col-md-6 {
            -webkit-box-flex: 0;
            -ms-flex: 0 0 100%;
            flex: 0 0 100%;
            max-width: 100%;
            padding: 0 0.5rem;
        }
        
        #exerciseCards .card-body {
            padding: 1rem;
        }
        
        #exerciseCards .card-footer {
            padding: 0.75rem 1rem;
        }
        
        #exerciseCards .card-title {
            font-size: 0.95rem;
        }
        
        #exerciseCards .card-footer .btn-primary {
            font-size: 0.85rem;
            padding: 0.5rem 1rem;
        }
    }
    
    @media (min-width: 768px) and (max-width: 991.98px) {
        #exerciseCards .col-lg-4,
        #exerciseCards .col-md-6 {
            -webkit-box-flex: 0;
            -ms-flex: 0 0 50%;
            flex: 0 0 50%;
            max-width: 50%;
        }
    }

    /* Enhanced compact filter styles - more polished version */
    .compact-filters {
        background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
        border-radius: 0.75rem;
        padding: 1.25rem;
        margin-bottom: 1.5rem;
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        position: relative;
        overflow: hidden;
    }
    
    .compact-filters::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, #356c9a 0%, #2a5a82 50%, #1f4a6b 100%);
        border-radius: 0.75rem 0.75rem 0 0;
    }
    
    .compact-filters .search-section {
        margin-bottom: 0;
    }
    
    .compact-filters .input-group-sm {
        border-radius: 0.5rem;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        height: calc(1.5em + 1.5rem + 2px) !important; /* Match select height */
        min-height: calc(1.5em + 1.5rem + 2px);
        display: flex;
        align-items: stretch;
    }
    
    .compact-filters .input-group-sm > * {
        height: calc(1.5em + 1.5rem + 2px) !important;
        min-height: calc(1.5em + 1.5rem + 2px);
    }
    
    .compact-filters .input-group-text {
        background: linear-gradient(135deg, var(--tenant-primary) 0%, var(--tenant-primary-dark) 100%);
        border: none;
        color: white;
        padding: 0;
        font-size: 0.9rem;
        font-weight: 500;
        height: calc(1.5em + 1.5rem + 2px) !important;
        min-height: calc(1.5em + 1.5rem + 2px);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        flex: 0 0 48px;
        box-sizing: border-box;
    }
    
    .compact-filters .form-control {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        border: none;
        background: white;
        font-weight: 400;
        color: #2c3e50;
        height: calc(1.5em + 1.5rem + 2px) !important; /* Match select height */
        min-height: calc(1.5em + 1.5rem + 2px);
        line-height: 1.5;
        box-sizing: border-box;
    }
    
    /* Specific override for input-group form-control */
    .compact-filters .input-group .form-control {
        height: calc(1.5em + 1.5rem + 2px) !important;
        min-height: calc(1.5em + 1.5rem + 2px);
        flex: 1 1 auto;
    }
    
    .compact-filters .form-control:focus {
        box-shadow: none;
        background: white;
    }
    
    .compact-filters .btn-outline-secondary {
        background: #e9ecef;
        border: none;
        color: #6c757d;
        padding: 0.75rem 1rem;
        font-weight: 500;
        transition: all 0.2s ease;
        height: calc(1.5em + 1.5rem + 2px) !important; /* Match select height */
        min-height: calc(1.5em + 1.5rem + 2px);
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }
    
    .compact-filters .btn-outline-secondary:hover {
        background: #dc3545;
        color: white;
        transform: none;
    }
    
             .compact-filters .form-control.form-control-sm,
         .compact-filters .form-select,
         .compact-filters select {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        border: 1px solid rgba(0, 0, 0, 0.1);
        background: white;
        border-radius: 0.5rem;
        font-weight: 500;
        color: #2c3e50;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
        transition: all 0.2s ease;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23356c9a' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
        background-size: 14px 10px;
        background-position: right 1rem center;
        background-repeat: no-repeat;
        padding-right: 3rem;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        height: calc(1.5em + 1.5rem + 2px) !important; /* Match input-group height */
        min-height: calc(1.5em + 1.5rem + 2px);
        line-height: 1.5;
        box-sizing: border-box;
    }
    
    .compact-filters .form-control.form-control-sm:hover,
    .compact-filters .form-select:hover,
    .compact-filters select:hover {
        border-color: #356c9a;
        box-shadow: 0 2px 6px rgba(53, 108, 154, 0.15);
        transform: translateY(-1px);
    }
    
    /* Filter label styling */
    .filter-select-wrapper {
        position: relative;
    }
    
    .filter-label {
        font-size: 11px;
        font-weight: 600;
        color: #2c3e50;
        margin-bottom: 3px;
        display: block;
        opacity: 0.8;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .compact-filters .filter-buttons {
        gap: 0.75rem;
        flex-wrap: nowrap;
    }
    
    .compact-filters .filter-btn {
        border-radius: 0.5rem;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        font-weight: 600;
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        border: 2px solid transparent;
        position: relative;
        overflow: hidden;
        background: white;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .compact-filters .filter-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        transition: left 0.5s;
    }
    
    .compact-filters .filter-btn:hover::before {
        left: 100%;
    }
    
    .compact-filters .filter-btn i {
        font-size: 1.1rem;
        transition: transform 0.2s ease;
    }
    
    .compact-filters .filter-btn:hover {
        transform: translateY(-2px) scale(1.02);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        border-color: #356c9a;
    }
    
    .compact-filters .filter-btn:hover i {
        transform: scale(1.1);
    }
    
    .compact-filters .filter-btn.active,
    .compact-filters .filter-btn[data-active="true"] {
        background: linear-gradient(135deg, #356c9a 0%, #2a5a82 100%);
        border-color: #356c9a;
        color: white;
        box-shadow: 0 4px 12px rgba(53, 108, 154, 0.3);
        transform: translateY(-1px);
    }
    
    .compact-filters .filter-btn.btn-outline-warning.active,
    .compact-filters .filter-btn.btn-outline-warning[data-active="true"] {
        background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
        border-color: #ffc107;
        color: #212529;
        box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    }
    
    .compact-filters .filter-btn:active {
        transform: translateY(0) scale(0.98);
    }
    
    .compact-filters .results-summary {
        font-size: 0.85rem;
        color: #6c757d;
        padding-top: 1rem;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        margin-top: 1rem;
        font-weight: 500;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .compact-filters .results-summary i {
        color: #ffc107;
        margin-right: 0.25rem;
        font-size: 0.9rem;
    }
    
    .compact-filters .results-summary span:first-child {
        color: #2c3e50;
        font-weight: 600;
    }
    
    /* Mobile optimizations - refined */
    @media (max-width: 767.98px) {
        .compact-filters {
            padding: 1rem;
            margin-bottom: 1.25rem;
            border-radius: 0.5rem;
        }
        
        .compact-filters .search-section {
            margin-bottom: 0;
        }
        
        .compact-filters .input-group-text {
            padding: 0;
            font-size: 0.85rem;
            height: calc(1.5em + 1.25rem + 12px) !important; /* Mobile height - slightly taller */
            min-height: calc(1.5em + 1.25rem + 2px);
            width: 40px;
            flex: 0 0 40px;
        }
        
        .compact-filters .form-control {
            padding: 0.625rem 0.875rem;
            font-size: 0.85rem;
            height: calc(1.35em + 1.25rem + 2px); /* Mobile height */
        }
        
        .compact-filters .btn-outline-secondary {
            height: calc(1.35em + 1.25rem + 2px); /* Mobile height */
        }
        
        .compact-filters .filter-row .row {
            margin: 0 -0.375rem;
        }
        
        .compact-filters .filter-row .row > * {
            padding: 0 0.375rem;
            margin-bottom: 0.5rem;
        }
        
        /* Ensure search box takes full width on mobile */
        .compact-filters .filter-row .row > .col-12.col-lg-4:first-child {
            margin-bottom: 1rem;
        }
        
        .compact-filters .filter-buttons {
            justify-content: center !important;
            margin-top: 0.5rem;
            gap: 0.5rem;
            flex-wrap: wrap;
            width: 100%;
            display: flex;
        }
        
        .compact-filters .filter-btn {
            flex: 0 0 auto;
            min-width: 56px;
            max-width: 72px;
            padding: 0.75rem 0.5rem;
            font-size: 0.85rem;
        }
        
        /* Ensure the column containing filter buttons is centered on mobile */
        .compact-filters .filter-row .row > .col-6:last-child,
        .compact-filters .filter-row .row > .col-4:last-child,
        .compact-filters .filter-row .row > [class*="col-"]:last-child {
            display: flex;
            justify-content: center;
            align-items: flex-start;
        }
        
        .compact-filters .form-select,
        .compact-filters select {
            font-size: 0.75rem;
            padding: 0.625rem 0.875rem;
            padding-right: 2.5rem;
            height: calc(1.35em + 1.25rem + 2px); /* Mobile height */
        }
        
        .compact-filters .results-summary {
            font-size: 0.8rem;
            text-align: center;
            flex-direction: column;
            gap: 0.375rem;
            padding-top: 0.75rem;
            margin-top: 0.75rem;
        }
    }
    
    /* Tablet adjustments - refined */
    @media (min-width: 768px) and (max-width: 991.98px) {
        .compact-filters .filter-buttons {
            justify-content: flex-end;
            gap: 0.625rem;
        }
        
        .compact-filters .filter-btn {
            min-width: 52px;
            padding: 0.75rem 0.875rem;
        }
    }
    
    /* Focus states - enhanced */
    .compact-filters .form-control:focus,
    .compact-filters .form-control.form-control-sm:focus,
    .compact-filters .form-select:focus,
    .compact-filters select:focus {
        border-color: #356c9a;
        box-shadow: 0 0 0 0.25rem rgba(53, 108, 154, 0.15);
        outline: none;
        transform: translateY(-1px);
    }
    
    .compact-filters .filter-btn:focus {
        outline: none;
        box-shadow: 0 0 0 0.25rem rgba(53, 108, 154, 0.25);
        z-index: 2;
    }
    
    /* Animation refinements */
    .compact-filters .filter-btn {
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .compact-filters .filter-btn.active {
        animation: filterActivateRefined 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }
    
    @keyframes filterActivateRefined {
        0% {
            transform: scale(0.9) translateY(0);
        }
        50% {
            transform: scale(1.05) translateY(-3px);
        }
        100% {
            transform: scale(1) translateY(-1px);
        }
    }
    
    /* Grid improvements */
    .compact-filters .row.g-2 {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 0.5rem;
    }
    
    @media (max-width: 575.98px) {
        .compact-filters .row.g-2 {
            --bs-gutter-x: 0.5rem;
            --bs-gutter-y: 0.375rem;
        }
    }
    
    /* Loading state for filter buttons */
    .compact-filters .filter-btn.loading {
        position: relative;
        color: transparent;
    }
    
         .compact-filters .filter-btn.loading::after {
         content: '';
         position: absolute;
         width: 16px;
         height: 16px;
         border: 2px solid transparent;
         border-top: 2px solid currentColor;
         border-radius: 50%;
         animation: spin 1s linear infinite;
         top: 50%;
         left: 50%;
         transform: translate(-50%, -50%);
     }
     
     @keyframes spin {
         0% { transform: translate(-50%, -50%) rotate(0deg); }
         100% { transform: translate(-50%, -50%) rotate(360deg); }
     }

/* Enhanced Mobile Modal Optimizations */
@media (max-width: 768px) {
    /* Core modal sizing and positioning */
    .modal {
        padding: 0 !important;
    }
    
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100vw - 0.5rem);
        width: calc(100vw - 0.5rem);
        min-height: calc(100vh - 0.5rem);
    }
    
    .modal-dialog.modal-lg {
        max-width: calc(100vw - 0.5rem);
        width: calc(100vw - 0.5rem);
        margin: 0.25rem;
    }
    
    .modal-dialog.modal-xl {
        max-width: calc(100vw - 0.5rem);
        width: calc(100vw - 0.5rem);
        margin: 0.25rem;
        height: calc(100vh - 0.5rem);
        min-height: calc(100vh - 0.5rem);
    }
    
    /* Modal content and structure */
    .modal-content {
        height: 100%;
        display: flex;
        flex-direction: column;
        border-radius: 0.5rem;
        border: none;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    }
    
    .modal-xl .modal-content {
        height: 100%;
        max-height: 100%;
    }
    
    /* Compact modal headers */
    .modal-header {
        padding: 0.75rem;
        border-bottom: 1px solid #dee2e6;
        background: linear-gradient(135deg, #356c9a 0%, #2a5a82 100%);
        color: white;
        border-radius: 0.5rem 0.5rem 0 0;
        flex-shrink: 0;
    }
    
    .modal-header .modal-title {
        font-size: 1rem;
        font-weight: 600;
        color: white;
        margin: 0;
        line-height: 1.2;
    }
    
    .modal-header .close {
        padding: 0.25rem;
        margin: -0.25rem -0.25rem -0.25rem auto;
        color: white;
        opacity: 0.8;
        font-size: 1.5rem;
        font-weight: 300;
        text-shadow: none;
        background: none;
        border: none;
        line-height: 1;
    }
    
    .modal-header .close:hover {
        color: white;
        opacity: 1;
    }
    
    .modal-header .close:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
    }
    
    /* Compact modal body */
    .modal-body {
        padding: 0.75rem;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: white;
    }
    
    .modal-xl .modal-body {
        padding: 0.75rem;
    }
    
    /* Compact form styling */
    .modal-body .form-group {
        margin-bottom: 0.75rem;
    }
    
    .modal-body .form-group:last-child {
        margin-bottom: 0;
    }
    
    .modal-body .form-label,
    .modal-body label {
        font-weight: 600;
        color: #495057;
        margin-bottom: 0.25rem;
        font-size: 0.85rem;
        line-height: 1.2;
    }
    
    .modal-body .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.5rem 0.75rem;
        border-radius: 0.375rem;
        border: 1px solid #ced4da;
        min-height: 44px; /* Touch-friendly */
        line-height: 1.5;
    }
    
    .modal-body .form-control:focus {
        border-color: var(--tenant-primary);
        box-shadow: 0 0 0 0.2rem rgba(var(--tenant-primary-rgb), 0.25);
    }
    
    .modal-body select.form-control {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 0.75rem center;
        background-repeat: no-repeat;
        background-size: 1rem;
        padding-right: 2.5rem;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
    }
    
    .modal-body textarea.form-control {
        resize: vertical;
        min-height: 80px;
    }
    
    .modal-body .form-text {
        font-size: 0.75rem;
        color: #6c757d;
        margin-top: 0.25rem;
        line-height: 1.3;
    }
    
    /* Compact row and column spacing */
    .modal-body .row {
        margin: 0 -0.375rem;
    }
    
    .modal-body .row > .col,
    .modal-body .row > [class*="col-"] {
        padding: 0 0.375rem;
    }
    
    /* Compact checkbox and radio styling */
    .modal-body .form-check {
        padding-left: 1.5rem;
        margin-bottom: 0.75rem;
        min-height: 1.5rem;
    }
    
    .modal-body .form-check-input {
        width: 1.125rem;
        height: 1.125rem;
        margin-left: -1.5rem;
        margin-top: 0.125rem;
    }
    
    .modal-body .form-check-label {
        font-size: 0.85rem;
        line-height: 1.4;
        color: #495057;
        margin-left: 0.25rem;
    }
    
    /* Compact alert styling */
    .modal-body .alert {
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.75rem;
        border-radius: 0.375rem;
        font-size: 0.85rem;
        line-height: 1.3;
    }
    
    .modal-body .alert-info {
        background-color: rgba(53, 108, 154, 0.1);
        border-color: rgba(53, 108, 154, 0.2);
        color: #356c9a;
    }
    
    /* Compact modal footers */
    .modal-footer {
        padding: 0.75rem;
        border-top: 1px solid #dee2e6;
        background-color: #f8f9fa;
        border-radius: 0 0 0.5rem 0.5rem;
        flex-shrink: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: flex-end;
    }
    
    .modal-footer .btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        border-radius: 0.375rem;
        font-weight: 500;
        min-width: 80px;
        line-height: 1.2;
        border-width: 1px;
    }
    
    .modal-footer .btn-secondary {
        background-color: #6c757d;
        border-color: #6c757d;
        color: white;
    }
    
    .modal-footer .btn-primary {
        background-color: #356c9a;
        border-color: #356c9a;
        color: white;
    }
    
    .modal-footer .btn-success {
        background-color: #28a745;
        border-color: #28a745;
        color: white;
    }
    
    .modal-footer .btn-danger {
        background-color: #dc3545;
        border-color: #dc3545;
        color: white;
    }
    
    /* Stack buttons on very small screens */
    @media (max-width: 480px) {
        .modal-footer {
            flex-direction: column;
        }
        
        .modal-footer .btn {
            width: 100%;
            margin: 0;
        }
    }
    
    /* Compact accordion styling for session modals */
    .modal-body .accordion {
        margin-bottom: 0.75rem;
    }
    
    .modal-body .accordion .card {
        border: 1px solid #e9ecef;
        border-radius: 0.375rem;
        margin-bottom: 0.5rem;
    }
    
    .modal-body .accordion .card-header {
        padding: 0.5rem 0.75rem;
        background: linear-gradient(135deg, #356c9a 0%, #2a5a82 100%);
        color: white;
        border-bottom: none;
        border-radius: 0.375rem 0.375rem 0 0;
    }
    
    .modal-body .accordion .card-header h2 {
        margin: 0;
        font-size: 0.9rem;
    }
    
    .modal-body .accordion .card-header .btn {
        font-size: 0.85rem;
        font-weight: 600;
        color: white !important;
        text-decoration: none;
        padding: 0;
        background: none;
        border: none;
        text-align: left;
        width: 100%;
        line-height: 1.3;
    }
    
    .modal-body .accordion .card-header .btn:hover {
        color: rgba(255, 255, 255, 0.9) !important;
    }
    
    .modal-body .accordion .card-header .btn:focus {
        box-shadow: none;
        outline: none;
    }
    
    .modal-body .accordion .card-body {
        padding: 0.75rem;
        background: white;
    }
    
    .modal-body .accordion .card-body .row {
        margin: 0 -0.25rem;
    }
    
    .modal-body .accordion .card-body .row > .col,
    .modal-body .accordion .card-body .row > [class*="col-"] {
        padding: 0 0.25rem;
        margin-bottom: 0.5rem;
    }
    
    .modal-body .accordion .card-body .form-group {
        margin-bottom: 0.5rem;
    }
    
    .modal-body .accordion .card-body .form-group:last-child {
        margin-bottom: 0;
    }
    
    /* Video modal specific styling */
    /* Mobile-specific video modal optimizations */
    #videoModal .modal-dialog {
        max-width: 95vw;
        width: 95vw;
        margin: 0.5rem auto;
        max-height: 85vh;
        min-height: calc(100vh - 1rem);
    }
    
    #videoModal .modal-content {
        max-height: 85vh;
    }
    
    #videoModal .modal-header {
        padding: 0.5rem 0.75rem;
    }
    
    #videoModal .modal-header .modal-title {
        font-size: 0.9rem;
        padding-right: 2.5rem; /* Space for close button */
    }
    
    #videoModal .modal-header .close {
        width: 28px;
        height: 28px;
        font-size: 1.2rem;
        z-index: 9999; /* Ensure it's above everything */
    }
    
    #videoModal .modal-header .favorite-btn {
        width: 28px;
        height: 28px;
        font-size: 1rem;
        margin-right: 0.75rem; /* Space between favorite and close button */
    }
    
    #videoModal .modal-header .ml-auto {
        gap: 0.375rem; /* Tighter spacing on mobile */
    }
    
    #videoModal .modal-body {
        min-height: 250px;
        max-height: 50vh; /* Smaller on mobile */
    }
    
    #videoModal .modal-footer {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.75rem; /* Increased mobile spacing */
    }
    
    #videoModal .modal-footer .btn {
        font-size: 0.85rem;
        padding: 0.75rem 1.5rem;
        width: 100%;
        min-width: auto;
    }
    
    /* Exercise modal specific styling */
    .modal-body .exercise-form .form-group {
        margin-bottom: 0.75rem;
    }
    
    .modal-body .exercise-form .form-row {
        margin: 0 -0.375rem;
    }
    
    .modal-body .exercise-form .form-row > .col {
        padding: 0 0.375rem;
    }
    
    /* Table styling in modals */
    .modal-body .table-responsive {
        border-radius: 0.375rem;
        margin-bottom: 0.75rem;
        font-size: 0.8rem;
    }
    
    .modal-body .table {
        margin-bottom: 0;
    }
    
    .modal-body .table th,
    .modal-body .table td {
        padding: 0.5rem;
        vertical-align: middle;
        border-color: #e9ecef;
        font-size: 0.8rem;
    }
    
    .modal-body .table thead th {
        background: #f8f9fa;
        border-bottom: 2px solid #dee2e6;
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: #495057;
    }
    
    /* Button group styling in modals */
    .modal-body .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .modal-body .btn-group .btn {
        flex: 1;
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
        min-width: 60px;
    }
    
    /* Input group styling in modals */
    .modal-body .input-group {
        margin-bottom: 0.75rem;
    }
    
    .modal-body .input-group .form-control {
        font-size: 0.85rem;
    }
    
    .modal-body .input-group-text {
        background: #f8f9fa;
        border-color: #ced4da;
        color: #6c757d;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Badge styling in modals */
    .modal-body .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
    }
    
    /* Loading state improvements */
    .modal-body .spinner-border {
        width: 2rem;
        height: 2rem;
        color: #356c9a;
    }
    
    .modal-body .text-center {
        color: #6c757d;
        padding: 1rem;
    }
    
    /* Form validation improvements */
    .modal-body .invalid-feedback {
        font-size: 0.75rem;
        margin-top: 0.25rem;
        line-height: 1.2;
    }
    
    .modal-body .form-control.is-invalid {
        border-color: #dc3545;
        box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
    }
    
    /* Specific improvements for athlete modals */
    .modal-body .athlete-info-alert {
        background-color: rgba(53, 108, 154, 0.1);
        border: 1px solid rgba(53, 108, 154, 0.2);
        color: #356c9a;
        padding: 0.5rem 0.75rem;
        border-radius: 0.375rem;
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .modal-body .athlete-info-alert i {
        margin-top: 0.125rem;
        flex-shrink: 0;
    }
    
    /* Height input styling */
    .modal-body .height-inputs {
        display: flex;
        gap: 0.5rem;
    }
    
    .modal-body .height-inputs .form-control {
        flex: 1;
    }
    
    /* Date input styling */
    .modal-body input[type="date"] {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 2v3m8-3v3m-10 4h12M4 7h12a2 2 0 012 2v9a2 2 0 01-2 2H4a2 2 0 01-2-2V9a2 2 0 012-2z'/%3e%3c/svg%3e");
        background-position: right 0.75rem center;
        background-repeat: no-repeat;
        background-size: 1rem;
        padding-right: 2.5rem;
    }
    
    /* Prevent modal content from being selectable during touch interactions */
    .modal-content {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    .modal-content input,
    .modal-content textarea,
    .modal-content select {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
    
    /* Improve touch targets */
    .modal .btn,
    .modal .form-control,
    .modal .form-check-input {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Animation improvements */
    .modal.fade .modal-dialog {
        transition: transform 0.3s ease-out;
        transform: translate(0, -50px);
    }
    
    .modal.show .modal-dialog {
        transform: none;
    }
    
    /* Accessibility improvements */
    .modal-content:focus {
        outline: none;
    }
    
    .modal .btn:focus,
    .modal .form-control:focus {
        outline: 2px solid #356c9a;
        outline-offset: 2px;
    }
}

/* Additional improvements for small mobile screens */
@media (max-width: 480px) {
    .modal-dialog {
        margin: 0.125rem;
        max-width: calc(100vw - 0.25rem);
        width: calc(100vw - 0.25rem);
    }
    
    .modal-header {
        padding: 0.5rem;
    }
    
    .modal-header .modal-title {
        font-size: 0.9rem;
    }
    
    .modal-body {
        padding: 0.5rem;
    }
    
    .modal-body .form-group {
        margin-bottom: 0.5rem;
    }
    
    .modal-body .form-label,
    .modal-body label {
        font-size: 0.8rem;
    }
    
    .modal-body .form-control {
        font-size: 16px;
        padding: 0.375rem 0.5rem;
    }
    
    .modal-footer {
        padding: 0.5rem;
    }
    
    .modal-footer .btn {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
        min-width: 70px;
    }
    
    .modal-body .accordion .card-header {
        padding: 0.375rem 0.5rem;
    }
    
    .modal-body .accordion .card-body {
        padding: 0.5rem;
    }
    
    .modal-body .accordion .card-body .row > .col,
    .modal-body .accordion .card-body .row > [class*="col-"] {
        padding: 0 0.125rem;
        margin-bottom: 0.375rem;
    }
    
    /* Extra compact system metrics table for very small screens */
    #metrics .table {
        font-size: 0.7rem !important;
        margin-bottom: 0;
    }
    
    #metrics .table th,
    #metrics .table td {
        padding: 0.375rem 0.125rem !important;
        line-height: 1.2;
    }
    
    #metrics .table th {
        font-size: 0.65rem !important;
        font-weight: 700;
    }
    
    #metrics .table td strong {
        font-size: 0.75rem !important;
        line-height: 1.1;
    }
    
    #metrics .table td small {
        font-size: 0.6rem !important;
        line-height: 1.1;
        margin-top: 0.125rem;
    }
    
    #metrics .form-control {
        font-size: 0.7rem !important;
        padding: 0.25rem 0.375rem !important;
        min-height: 32px !important;
        line-height: 1.2;
    }
    
    #metrics .custom-control {
        padding-left: 1rem;
        transform: scale(0.9);
    }
    
    #metrics .custom-control-input {
        width: 0.9rem;
        height: 0.9rem;
        margin-left: -1rem;
    }
    
    #metrics .card-header h4 {
        font-size: 1.1rem;
    }
    
    #metrics .card-header small {
        font-size: 0.75rem;
    }
    
    /* Mobile adjustments for sticky footer */
    #metrics.show .card-footer,
    #metrics.active .card-footer {
        padding: 0.5rem 0.75rem;
    }
    
    #metrics.show .card-footer .btn,
    #metrics.active .card-footer .btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    #metrics.show .card-body,
    #metrics.active .card-body {
        padding-bottom: 6rem; /* Slightly less padding on mobile since footer is smaller */
    }
}

/* Exercise Details Modal - Center and improve stacking */
#exerciseDetailsModal .modal-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 2rem);
    margin: 1rem auto;
}

#exerciseDetailsModal .modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.3);
    background: white;
    max-width: 600px;
    width: 100%;
}

#exerciseDetailsModal .modal-header {
    background: linear-gradient(135deg, #356c9a 0%, #2a5a82 100%);
    color: white;
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 1rem 1.5rem;
}

#exerciseDetailsModal .modal-header .modal-title {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

#exerciseDetailsModal .modal-header .close {
    color: white;
    opacity: 0.9;
    font-size: 1.5rem;
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

#exerciseDetailsModal .modal-header .close:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
    transform: scale(1.1);
}

#exerciseDetailsModal .modal-body {
    padding: 1.5rem;
    background: white;
}

#exerciseDetailsModal .modal-body h6 {
    color: #356c9a;
    font-weight: 600;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

#exerciseDetailsModal .modal-body h6:first-child {
    margin-top: 0;
}

#exerciseDetailsModal .modal-body p {
    color: #495057;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

#exerciseDetailsModal .modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 1rem 1.5rem;
}

/* Modal stacking improvements */
.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal.show.modal-static .modal-dialog {
    transform: scale(1.02);
}

/* Ensure exercise details modal appears above video modal when stacked */
#exerciseDetailsModal.show {
    z-index: 1060 !important;
}

/* Ensure exercise details backdrop appears above video modal */
#exerciseDetailsModal + .modal-backdrop,
.modal-backdrop.exercise-details-backdrop {
    z-index: 1055 !important;
}

/* Center Admin Edit Modals (Team, Season, Season Phase) */
#editTeamModal .modal-dialog,
#editSeasonModal .modal-dialog,
#editSeasonPhaseModal .modal-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 2rem);
    margin: 1rem auto;
}

#editTeamModal .modal-content,
#editSeasonModal .modal-content,
#editSeasonPhaseModal .modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.3);
    background: white;
    max-width: 500px;
    width: 100%;
}

#editTeamModal .modal-header,
#editSeasonModal .modal-header,
#editSeasonPhaseModal .modal-header {
    background: linear-gradient(135deg, #356c9a 0%, #2a5a82 100%);
    color: white;
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 1rem 1.5rem;
}

#editTeamModal .modal-header .modal-title,
#editSeasonModal .modal-header .modal-title,
#editSeasonPhaseModal .modal-header .modal-title {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

#editTeamModal .modal-header .close,
#editSeasonModal .modal-header .close,
#editSeasonPhaseModal .modal-header .close {
    color: white;
    opacity: 0.9;
    font-size: 1.5rem;
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

#editTeamModal .modal-header .close:hover,
#editSeasonModal .modal-header .close:hover,
#editSeasonPhaseModal .modal-header .close:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
    transform: scale(1.1);
}

#editTeamModal .modal-body,
#editSeasonModal .modal-body,
#editSeasonPhaseModal .modal-body {
    padding: 1.5rem;
    background: white;
}

#editTeamModal .modal-footer,
#editSeasonModal .modal-footer,
#editSeasonPhaseModal .modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 1rem 1.5rem;
    justify-content: space-between;
}

/* Modal backdrop for stacked modals - only when needed */
.modal-backdrop + .modal-backdrop {
    opacity: 0.7;
    z-index: 1045;
}

/* Admin Dashboard Input Group Button Height Fix */
.tab-pane .input-group {
    display: flex;
    align-items: stretch;
}

.tab-pane .input-group .form-control {
    border-radius: 0.375rem 0 0 0.375rem;
}

.tab-pane .input-group-append {
    display: flex;
    align-items: stretch;
}

.tab-pane .input-group-append .btn {
    border-radius: 0 0.375rem 0.375rem 0;
    border-left: 0;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    min-height: calc(1.5em + 0.75rem + 2px);
}

/* Ensure consistent height across all form controls in input groups */
.tab-pane .input-group .form-control,
.tab-pane .input-group-append .btn {
    border: 1px solid #ced4da;
}

.tab-pane .input-group .form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.tab-pane .input-group-append .btn:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.tab-pane .input-group-append .btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Mobile responsive adjustments for exercise details modal */
@media (max-width: 768px) {
    #exerciseDetailsModal .modal-dialog {
        margin: 0.5rem;
        min-height: calc(100vh - 1rem);
    }
    
    #exerciseDetailsModal .modal-content {
        max-width: 100%;
    }
    
    #exerciseDetailsModal .modal-header {
        padding: 0.75rem 1rem;
    }
    
    #exerciseDetailsModal .modal-header .modal-title {
        font-size: 1rem;
        padding-right: 2rem;
    }
    
    #exerciseDetailsModal .modal-header .close {
        width: 28px;
        height: 28px;
        font-size: 1.2rem;
    }
    
    #exerciseDetailsModal .modal-body {
        padding: 1rem;
    }
    
    #exerciseDetailsModal .modal-footer {
        padding: 0.75rem 1rem;
    }
    
    /* Mobile adjustments for input groups */
    .tab-pane .input-group-append .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Mobile responsive adjustments for admin edit modals */
    #editTeamModal .modal-dialog,
    #editSeasonModal .modal-dialog,
    #editSeasonPhaseModal .modal-dialog {
        margin: 0.5rem;
        min-height: calc(100vh - 1rem);
    }
    
    #editTeamModal .modal-content,
    #editSeasonModal .modal-content,
    #editSeasonPhaseModal .modal-content {
        max-width: 100%;
    }
    
    #editTeamModal .modal-header,
    #editSeasonModal .modal-header,
    #editSeasonPhaseModal .modal-header {
        padding: 0.75rem 1rem;
    }
    
    #editTeamModal .modal-header .modal-title,
    #editSeasonModal .modal-header .modal-title,
    #editSeasonPhaseModal .modal-header .modal-title {
        font-size: 1rem;
        padding-right: 2rem;
    }
    
    #editTeamModal .modal-header .close,
    #editSeasonModal .modal-header .close,
    #editSeasonPhaseModal .modal-header .close {
        width: 28px;
        height: 28px;
        font-size: 1.2rem;
    }
    
    #editTeamModal .modal-body,
    #editSeasonModal .modal-body,
    #editSeasonPhaseModal .modal-body {
        padding: 1rem;
    }
    
    #editTeamModal .modal-footer,
    #editSeasonModal .modal-footer,
    #editSeasonPhaseModal .modal-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #editTeamModal .modal-footer .btn,
    #editSeasonModal .modal-footer .btn,
    #editSeasonPhaseModal .modal-footer .btn {
        width: 100%;
    }
}

/* Sticky column for metric breakdown table */
.sticky-column {
  position: sticky !important;
  left: 0;
  z-index: 20;
  border-right: 2px solid #dee2e6 !important;
  box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

/* Ensure sticky column background matches table header */
.thead-dark .sticky-column {
  background-color: #464d50 !important;
}

/* Ensure sticky column background matches table body */
.table tbody .sticky-column {
  background-color: #ffffff !important;
}

/* For striped tables, ensure proper background colors */
.table-striped tbody tr:nth-of-type(odd) .sticky-column {
  background-color: #f8f9fa !important;
}

/* Additional support for bordered tables */
.table-bordered .sticky-column {
  border-left: 1px solid #dee2e6 !important;
}

/* Styles for Metric Breakdown table */

/* Mobile optimizations for Team/Season Management cards */

/* All Admin Cards Horizontal Carousel with Snap Scrolling */
.all-cards-container {
    position: relative;
}

#adminTabs .nav-link{
    color: var(--tenant-primary) !important;
    font-weight: 600;
}
#adminTabs .nav-link.active{
    color: #fff !important;
    font-weight: 600;
}

#dashboardTabs .nav-link{
    color: var(--tenant-primary) !important;
    font-weight: 600;
}
#dashboardTabs .nav-link.active{
    color: #fff !important;
    font-weight: 600;
}
/* Neutral navbar background - more transparent white */
.navbar-dark.bg-dark {
    background-color: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Desktop navbar - keep neutral */
@media (min-width: 768px) {
    #navbarNav .nav-link,
    #navbarNav .nav-link span{
        color: #343a40 !important;
        font-weight: 500;
        transition: all 0.3s ease;
    }
    #navbarNav .nav-link:hover,
    #navbarNav .nav-link:hover span{
        color: #212529 !important;
    }
}

/* Mobile navbar - use dark text */
@media (max-width: 767.98px) {
    #navbarNav .nav-link,
    #navbarNav .nav-link span{
        color: #343a40 !important;
        font-weight: 500;
    }
    #navbarNav .nav-link:hover,
    #navbarNav .nav-link:hover span{
        color: #212529 !important;
    }
}

/* Icons - tenant-specific color when available, fallback to dark for neutral */
#navbarNav .nav-link i{
    color: var(--tenant-primary, #343a40) !important;
    margin-right: 0.5rem;
}

/* Additional hamburger menu fixes for neutral pages */
.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25) !important;
}

/* Ensure hamburger lines are always visible */
.navbar-toggler::before,
.navbar-toggler::after,
.navbar-toggler .hamburger-line,
.navbar-toggler .hamburger-line::before {
    background-color: #343a40 !important;
}

/* Force hamburger visibility on all screen sizes for neutral pages */
@media (max-width: 991.98px) {
    .navbar-toggler::before,
    .navbar-toggler::after,
    .navbar-toggler .hamburger-line,
    .navbar-toggler .hamburger-line::before {
        background-color: #343a40 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}



/* Desktop: Normal grid layout */
@media (min-width: 768px) {
    
    
    .all-cards-row {
        /* Normal row behavior - cards wrap to next line naturally */
        display: flex;
        flex-wrap: wrap;
    }
    
    .admin-card-col {
        /* Normal column behavior - keep original Bootstrap widths */
        margin-bottom: 1rem;
    }
}

/* Mobile: Horizontal scrollable carousel with snap */
@media (max-width: 767.98px) {
    .all-cards-scroll {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 10px;
        /* Scroll snap properties for smooth snapping */
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
    }
    
    /* Webkit scrollbar styling */
    .all-cards-scroll::-webkit-scrollbar {
        height: 6px;
    }
    
    .all-cards-scroll::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .all-cards-scroll::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }
    
    .all-cards-scroll::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
    
    .all-cards-row {
        flex-wrap: nowrap !important;
        width: max-content;
        margin: 0;
        display: flex;
    }
    
    .admin-card-col {
        /* Use original Bootstrap responsive widths but convert to mobile-friendly sizes */
        flex: none;
        margin-right: 15px;
        padding-left: 0;
        padding-right: 0;
        /* Scroll snap alignment */
        scroll-snap-align: start;
    }
    
    /* Different widths based on original Bootstrap columns */
    .admin-card-col.col-md-4 {
        /* Original col-md-4 cards (33.33% width) */
        width: calc(100vw - 60px); /* Almost full width minus padding */
        max-width: 350px; /* Cap the maximum width */
        min-width: 280px; /* Ensure minimum usable width */
    }
    
    .admin-card-col.col-md-6 {
        /* Original col-md-6 cards (50% width) */
        width: calc(100vw - 60px); /* Almost full width minus padding */
        max-width: 400px; /* Slightly wider cap for these cards */
        min-width: 320px; /* Ensure minimum usable width */
    }
    
    .admin-card-col:last-child {
        margin-right: 0;
        padding-right: 15px; /* Add padding to last card for spacing */
    }
    
    .admin-card-col:first-child {
        padding-left: 15px; /* Add padding to first card for spacing */
    }
    
    /* Maintain same card styling on mobile */
    .admin-card-col .card {
        height: 100%;
        width: 100%;
    }
}
@media (max-width: 768px) {
    /* Admin dashboard management cards mobile optimization */
    .admin-dashboard .row.mb-4 {
        margin-bottom: 1.5rem !important;
    }
    
    .admin-dashboard .col-md-4 {
        margin-bottom: 1rem;
    }
    
    /* Management card headers */
    .admin-dashboard .card-header h4 {
        font-size: 1rem;
        margin-bottom: 0;
        display: flex;
        align-items: center;
    }
    
    .admin-dashboard .card-header h4 i {
        font-size: 0.9rem;
        margin-right: 0.5rem;
    }
    
    /* Card body optimization */
    .admin-dashboard .card-body {
        padding: 0.75rem;
    }
    
    /* Add forms within management cards */
    .admin-dashboard .card-body form {
        margin-bottom: 0.75rem;
    }
    
    .admin-dashboard .card-body form .mb-2 {
        margin-bottom: 0.5rem !important;
    }
    
    .admin-dashboard .card-body form .form-control {
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    .admin-dashboard .card-body form .btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    /* List group items optimization */
    .admin-dashboard .list-group-item {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .admin-dashboard .list-group-item strong {
        font-size: 0.95rem;
        line-height: 1.3;
    }
    
    .admin-dashboard .list-group-item small {
        font-size: 0.8rem;
        margin-top: 0.25rem;
        display: block;
    }
    
    /* Button groups in list items */
    .admin-dashboard .list-group-item .btn-group {
        gap: 0.25rem;
    }
    
    .admin-dashboard .list-group-item .btn-group .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
        min-width: auto;
        width: auto;
    }
    
    .admin-dashboard .list-group-item .btn-group .btn i {
        font-size: 0.75rem;
    }
    
    /* Inline forms optimization */
    .admin-dashboard .list-group-item form {
        display: inline;
        margin: 0;
    }
    
    /* Empty state optimization */
    .admin-dashboard .list-group-item.text-center {
        padding: 1rem 0.75rem;
    }
    
    .admin-dashboard .list-group-item.text-center i {
        font-size: 1.5rem !important;
        margin-bottom: 0.5rem;
    }
    
    .admin-dashboard .list-group-item.text-center p {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    
    /* Form layout adjustments */
    .admin-dashboard .text-right {
        text-align: right !important;
    }
    
    .admin-dashboard .btn-success {
        min-width: auto;
    }
}

@media (max-width: 576px) {
    /* Extra small screens - single column layout */
    .admin-dashboard .row.mb-4 .col-md-4 {
        margin-bottom: 1.5rem;
    }
    
    .admin-dashboard .row.mb-4 .col-md-4:last-child {
        margin-bottom: 0;
    }
    
    /* Even more compact on very small screens */
    .admin-dashboard .card-body {
        padding: 0.6rem;
    }
    
    .admin-dashboard .list-group-item {
        padding: 0.6rem;
    }
    
    .admin-dashboard .card-header {
        padding: 0.6rem 0.75rem;
    }
    
    .admin-dashboard .card-header h4 {
        font-size: 0.95rem;
    }
    
    /* Button group stacking on very small screens */
    .admin-dashboard .list-group-item .btn-group {
        flex-direction: column;
        width: auto;
        gap: 0.25rem;
    }
    
    .admin-dashboard .list-group-item .btn-group .btn {
        width: auto;
        min-width: 32px;
        padding: 0.25rem 0.5rem;
    }
    
    /* Form button full width on very small screens */
    .admin-dashboard .card-body form .btn-success {
        width: 100%;
        margin-top: 0.25rem;
    }
    
    .admin-dashboard .text-right {
        text-align: center !important;
    }
}

/* --- Enhanced Mobile Responsiveness for Metric Filters --- */
@media (max-width: 768px) {
    #metrics .row.mb-4 {
        flex-direction: column;
        gap: 0.5rem;
    }
    #metrics .row.mb-4 > div {
        width: 100% !important;
        margin-bottom: 0.5rem !important;
    }
    #metrics .form-group {
        margin-bottom: 0.5rem;
    }
    #metrics .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    #metrics .d-flex.gap-2 .btn {
        width: 100%;
    }
    #metrics .card-footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    #metrics .card-footer .btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    /* Table improvements for mobile */
    #metrics .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    #metrics .table th, #metrics .table td {
        font-size: 1rem;
        padding: 0.5rem 0.5rem;
        min-width: 120px;
    }
    #metrics .table thead th {
        font-size: 1.1rem;
        font-weight: 700;
        background: #f8f9fa;
        color: #222;
        letter-spacing: 0.02em;
        text-align: left;
        border-bottom: 2px solid #dee2e6;
    }
    #metrics .metric-category-section .card-header h5 {
        font-size: 1.1rem;
        color: #222;
        font-weight: 700;
    }
    #metrics .metric-category-section .card-header small {
        font-size: 0.95rem;
    }
}

/* --- Desktop Table Header Improvements --- */
#metrics .table thead th {
    font-size: 1rem;
    font-weight: 700;
    background: #f8f9fa;
    color: #222;
    letter-spacing: 0.01em;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
}
#metrics .metric-category-section .card-header h5 {
    font-size: 1.15rem;
    color: #222;
    font-weight: 700;
}
#metrics .metric-category-section .card-header small {
    font-size: 1rem;
}

@media (max-width: 768px) {
    #bulk-edit-controls {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
        width: 100%;
    }

    #bulk-edit-controls label {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    #bulk-edit-controls select {
        width: 100% !important;
        margin-top: 0.25rem;
    }

    #bulk-edit-controls button {
        width: 100%;
    }
}

/* Dynamic category badge styles - colors applied via JavaScript */
.exercise-category-tag {
  color: white;
  background-color: #6c757d; /* Default gray, will be overridden by JS */
}

.metric-category-tag {
  color: white;
  background-color: #007bff; /* Default blue, will be overridden by JS */
}

/* ========================================
   LIVE TESTING SESSION EXERCISE SELECTION
   ======================================== */

/* Professional Exercise Selection Styles */


.exercise-count-badge .badge {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.exercise-selector-professional {
  width: 100% !important;
  clear: both !important;
}

.exercise-selector-professional .exercise-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 1rem !important;
  padding: 0.5rem 0 !important;
  width: 100% !important;
  list-style: none !important;
  margin: 0 !important;
}

.exercise-selector-professional .exercise-card-professional {
  background: white !important;
  border: 1px solid #e9ecef !important;
  border-radius: 12px !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  overflow: hidden !important;
  position: relative !important;
  min-height: 140px !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  margin: 0 !important;
  padding: 0 !important;
}

.exercise-selector-professional .exercise-card-professional:hover:not(.disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
  border-color: #007bff !important;
}

.exercise-selector-professional .exercise-card-professional.active {
  border-color: #28a745 !important;
  box-shadow: 0 4px 20px rgba(40, 167, 69, 0.2) !important;
}

.exercise-selector-professional .exercise-card-professional.active::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 4px !important;
  background: linear-gradient(90deg, #28a745, #20c997) !important;
}

.exercise-selector-professional .exercise-card-professional.disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

.exercise-selector-professional .exercise-card-header {
  padding: 1rem !important;
  background: #f8f9fa !important;
  border-bottom: 1px solid #e9ecef !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

.exercise-selector-professional .exercise-status-indicator {
  color: #6c757d !important;
  font-size: 1.2rem !important;
  transition: color 0.3s ease !important;
}

.exercise-selector-professional .exercise-card-professional.active .exercise-status-indicator {
  color: #28a745 !important;
}

.exercise-selector-professional .exercise-number {
  background: #e9ecef !important;
  color: #495057 !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  flex-shrink: 0 !important;
  transition: all 0.3s ease !important;
}

.exercise-selector-professional .exercise-card-professional.active .exercise-number {
  background: #28a745 !important;
  color: white !important;
}

.exercise-selector-professional .exercise-card-body {
  padding: 1rem !important;
  flex-grow: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  margin: 0 !important;
}

.exercise-selector-professional .exercise-name-professional {
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  color: #212529 !important;
  margin-bottom: 0.5rem !important;
  line-height: 1.3 !important;
  word-wrap: break-word !important;
}

.exercise-selector-professional .exercise-meta {
  display: flex !important;
  align-items: center !important;
  margin-bottom: 0.5rem !important;
  margin-top: auto !important;
}

.exercise-selector-professional .exercise-category {
  font-size: 0.8rem !important;
  color: #6c757d !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.3rem !important;
}

.exercise-selector-professional .exercise-card-footer {
  padding: 0.75rem 1rem !important;
  background: #f8f9fa !important;
  border-top: 1px solid #e9ecef !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-top: auto !important;
  margin-bottom: 0 !important;
}

.exercise-selector-professional .exercise-results-count {
  display: flex !important;
  align-items: center !important;
  gap: 0.3rem !important;
  font-size: 0.8rem !important;
  color: #6c757d !important;
}

.exercise-selector-professional .result-count {
  font-weight: 600 !important;
  color: #007bff !important;
}

.exercise-selector-professional .exercise-action {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
}

.exercise-selector-professional .current-label {
  color: #28a745 !important;
}

.exercise-selector-professional .select-label {
  color: #6c757d !important;
}

.exercise-selector-professional .exercise-card-professional:hover:not(.disabled) .select-label {
  color: #007bff !important;
}

/* Fallback for browsers that don't support CSS Grid */
.exercise-selector-professional .exercise-grid {
  display: -webkit-box !important;
  display: -ms-flexbox !important;
  display: flex !important;
  -ms-flex-wrap: wrap !important;
  flex-wrap: wrap !important;
  gap: 1rem !important;
  padding: 0.5rem 0 !important;
  width: 100% !important;
  list-style: none !important;
  margin: 0 !important;
}

.exercise-selector-professional .exercise-card-professional {
  -webkit-box-flex: 0 !important;
  -ms-flex: 0 0 calc(33.333% - 1rem) !important;
  flex: 0 0 calc(33.333% - 1rem) !important;
  max-width: calc(33.333% - 1rem) !important;
}

/* CSS Grid support - with higher specificity */
@supports (display: grid) {
  .exercise-selector-professional .exercise-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 1rem !important;
  }

  .exercise-selector-professional .exercise-card-professional {
    flex: none !important;
    max-width: none !important;
  }
}

/* Make the exercise grid responsive */
@media (max-width: 1200px) {
  .exercise-selector-professional .exercise-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  }

  .exercise-selector-professional .exercise-card-professional {
    flex: 0 0 calc(50% - 1rem) !important;
    max-width: calc(50% - 1rem) !important;
  }
}

@media (max-width: 992px) {
  .exercise-selector-professional .exercise-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
  }

  .exercise-selector-professional .exercise-card-professional {
    flex: 0 0 calc(50% - 1rem) !important;
    max-width: calc(50% - 1rem) !important;
  }
}

@media (max-width: 768px) {
  .exercise-selector-professional .exercise-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 0.75rem !important;
  }

  .exercise-selector-professional .exercise-card-header {
    padding: 0.75rem !important;
  }

  .exercise-selector-professional .exercise-card-body {
    padding: 0.75rem !important;
  }

  .exercise-selector-professional .exercise-card-footer {
    padding: 0.5rem 0.75rem !important;
  }

  .exercise-selector-professional .exercise-name-professional {
    font-size: 0.9rem !important;
  }
}

@media (max-width: 576px) {
  .exercise-selector-professional .exercise-grid {
    grid-template-columns: 1fr !important;
  }

  .exercise-selector-professional .exercise-card-professional {
    margin-bottom: 0.5rem !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

/* ============================================
   SCORE CHANGE INDICATORS
   ============================================ */

/* Score change indicators for live sessions */
.score-change-indicator {
    font-size: 0.8rem;
    margin-left: 0.25rem;
    vertical-align: middle;
}

.score-change-indicator.up {
    color: #28a745 !important;
    animation: pulse-success 2s ease-in-out infinite;
}

.score-change-indicator.down {
    color: #dc3545 !important;
    animation: pulse-danger 2s ease-in-out infinite;
}

.score-change-indicator.same {
    color: #ffc107 !important;
}

.score-change-indicator.none {
    color: #6c757d !important;
}

/* Pulse animations for score changes */
@keyframes pulse-success {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes pulse-danger {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Live session indicator styling */
.live-session-badge {
    color: #6c757d;
    font-size: 0.8rem;
}

.live-session-badge i {
    margin-right: 0.25rem;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .score-change-indicator {
        font-size: 0.7rem;
        margin-left: 0.15rem;
    }
    
    .live-session-badge {
        font-size: 0.75rem;
    }
}

/* Sticky Navbar Styles */
.navbar {
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.navbar.fixed-top {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Add padding to body to prevent content from hiding under fixed navbar */
body {
  padding-top: 80px;
  background-color: #fff5f5;
  padding-bottom: 1rem;
}

/* Enhanced navbar styles */
.navbar-dark {
  background-color: var(--tenant-secondary, rgba(255, 255, 255, 0.5)) !important;
}

.navbar-dark .navbar-brand {
  padding: 0;
  margin-right: 2rem;
}

/* Neutral navbar brand text color */
.navbar-dark .navbar-brand span {
  color: #343a40 !important;
}

.navbar-dark .nav-link {
  position: relative;
  padding: 0.5rem 1rem !important;
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* Desktop navbar styles */
@media (min-width: 768px) {
  .navbar-dark .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--tenant-primary, #343a40);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    opacity: 0;
  }

  .navbar-dark .nav-link:hover::after {
    width: 80%;
    opacity: 1;
  }

  .navbar-dark .nav-link.active::after {
    width: 80%;
    opacity: 1;
  }

  .navbar-dark .nav-link {
    color: #343a40 !important;
  }

  .navbar-dark .nav-link:hover {
    color: #212529 !important;
  }

  .navbar-dark .nav-link i {
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
    color: #343a40 !important;
  }

  .navbar-dark .nav-link:hover i {
    transform: translateY(-1px);
    color: #212529 !important;
  }
}

/* Mobile navbar styles */
@media (max-width: 767.98px) {
  body {
    padding-top: 70px;
  }

  .navbar-dark {
    padding: 0.5rem 1rem;
  }

  .navbar-collapse {
    background: rgba(255, 255, 255, 0.98) !important;
    border-radius: 8px !important;
    margin-top: 0.5rem !important;
    padding: 1rem !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
  }

  .navbar-dark .nav-link {
    color: #333 !important;
    padding: 0.75rem 1rem !important;
    border-radius: 6px;
  }

  .navbar-dark .nav-link:hover {
    background-color: rgba(var(--tenant-primary-rgb), 0.1);
    color: var(--tenant-primary) !important;
  }

  .navbar-dark .nav-link i {
    width: 24px;
    margin-right: 0.75rem;
    color: var(--tenant-primary) !important;
  }
}

/* Enhanced Desktop Leaderboard Styles */
.desktop-leaderboard-table {
    display: block;
}

.desktop-leaderboard-table .table {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.desktop-leaderboard-table .table thead th {
    background: linear-gradient(135deg, var(--tenant-primary) 0%, var(--tenant-primary-dark) 100%);
    color: white !important;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
    position: relative;
}

.desktop-leaderboard-table .table thead th:first-child {
    border-top-left-radius: 0.5rem;
    width: 60px;
    text-align: center;
}

.desktop-leaderboard-table .table thead th:last-child {
    border-top-right-radius: 0.5rem;
}

.desktop-leaderboard-table .table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
}

.desktop-leaderboard-table .table tbody tr:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.desktop-leaderboard-table .table tbody tr:last-child {
    border-bottom: none;
}

.desktop-leaderboard-table .table tbody td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border: none;
}

.desktop-leaderboard-table .table tbody th {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border: none;
    font-weight: 600;
    color: var(--tenant-primary);
    text-align: center;
    font-size: 1.1rem;
}

/* Rank styling for top 3 */
.desktop-leaderboard-table .table tbody tr:nth-child(1) th {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #856404;
    border-radius: 0.25rem;
    margin: 0 0.5rem;
    padding: 0.75rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.desktop-leaderboard-table .table tbody tr:nth-child(2) th {
    background: linear-gradient(135deg, #c0c0c0 0%, #e5e5e5 100%);
    color: #495057;
    border-radius: 0.25rem;
    margin: 0 0.5rem;
    padding: 0.75rem;
    font-size: 1.1rem;
    font-weight: bold;
}

.desktop-leaderboard-table .table tbody tr:nth-child(3) th {
    background: linear-gradient(135deg, #cd7f32 0%, #daa520 100%);
    color: #8b4513;
    border-radius: 0.25rem;
    margin: 0 0.5rem;
    padding: 0.75rem;
    font-size: 1.1rem;
    font-weight: bold;
}

/* Athlete column styling */
.desktop-leaderboard-table .table tbody td:nth-child(2) {
    min-width: 200px;
}

.desktop-leaderboard-table .table tbody td:nth-child(2) .d-flex {
    align-items: center;
    gap: 0.75rem;
}

.desktop-leaderboard-table .table tbody td:nth-child(2) img,
.desktop-leaderboard-table .table tbody td:nth-child(2) .rounded-circle {
    width: 45px !important;
    height: 45px !important;
    border: 2px solid #e9ecef;
    transition: border-color 0.2s ease;
}

.desktop-leaderboard-table .table tbody tr:hover td:nth-child(2) img,
.desktop-leaderboard-table .table tbody tr:hover td:nth-child(2) .rounded-circle {
    border-color: var(--tenant-primary);
}

.desktop-leaderboard-table .table tbody td:nth-child(2) a {
    color: var(--tenant-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.desktop-leaderboard-table .table tbody td:nth-child(2) a:hover {
    color: var(--tenant-primary-dark);
    text-decoration: underline;
}

/* Score column styling */
.desktop-leaderboard-table .table tbody td:nth-child(6) {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--tenant-primary);
    text-align: center;
}

/* Improvement column styling */
.desktop-leaderboard-table .table tbody td:nth-child(6).text-success {
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
}

/* Date column styling */
.desktop-leaderboard-table .table tbody td:last-child {
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
}

/* Card header enhancements */
.desktop-leaderboard-table .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid var(--tenant-primary);
    padding: 1rem 1.5rem;
}

.desktop-leaderboard-table .card-header h3 {
    color: var(--tenant-primary);
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.desktop-leaderboard-table .card-header h3 i {
    font-size: 1.2rem;
    color: var(--tenant-primary);
}

/* Card body enhancements */
.desktop-leaderboard-table .card-body {
    padding: 0;
}

/* Responsive table improvements */
.desktop-leaderboard-table .table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Filter section enhancements for desktop */
@media (min-width: 769px) {
    .compact-filters .card {
        border-radius: 0.5rem;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
        border: 1px solid rgba(0, 0, 0, 0.125);
    }
    
    .compact-filters .card-body {
        padding: 1.5rem;
    }
    
    .compact-filters .filter-label {
        font-weight: 600;
        color: var(--tenant-primary);
        margin-bottom: 0.5rem;
    }
    
    .compact-filters .form-control-sm {
        border-radius: 0.375rem;
        border: 1px solid #ced4da;
        transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    }
    
    .compact-filters .form-control-sm:focus {
        border-color: var(--tenant-primary);
        box-shadow: 0 0 0 0.2rem rgba(var(--tenant-primary-rgb), 0.25);
    }
    
    .compact-filters .filter-btn {
        border-radius: 0.375rem;
        transition: all 0.2s ease;
    }
    
    .compact-filters .filter-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
}

/* Mobile leaderboard cards - keep existing styles */
.mobile-leaderboard-cards {
    display: none;
}

/* Mobile overrides to ensure mobile view works correctly */
@media (max-width: 576px) {
    .desktop-leaderboard-table {
        display: none !important;
    }
    
    .mobile-leaderboard-cards {
        display: block !important;
    }
    
    /* Override any desktop table styles on mobile */
    .desktop-leaderboard-table .table {
        display: none !important;
    }
    
    .desktop-leaderboard-table .table-responsive {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .desktop-leaderboard-table {
        display: none !important;
    }
    
    .mobile-leaderboard-cards {
        display: block !important;
    }
}

/* ============================================
   CUSTOM TYPOGRAPHY & LAYOUT
   ============================================ */

/* Global font family improvements */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: #2c3e50;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    font-weight: 600;
    line-height: 1.3;
    color: #1a252f;
}

/* ============================================
   HERO SECTION STYLING
   ============================================ */

.hero-section {
    padding: 4rem 0 5rem 0;
    background: #fff5f5;
    margin: -2rem -15px 0 -15px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 3.5rem;
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    max-width: 700px;
    margin: 0 auto 3rem auto;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
    line-height: 1.7;
}

.hero-cta {
    margin-top: 2rem;
}

/* ============================================
   CUSTOM BUTTON STYLES
   ============================================ */

/* Primary CTA Button */
.btn-primary.btn-lg {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    border: none;
    padding: 1rem 2.5rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 50px;
    text-transform: none;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 25px rgba(238, 90, 82, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-primary.btn-lg::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary.btn-lg:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(238, 90, 82, 0.5);
    background: linear-gradient(135deg, #ff5252 0%, #e53e3e 100%);
}

.btn-primary.btn-lg:hover::before {
    left: 100%;
}

.btn-primary.btn-lg:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(238, 90, 82, 0.4);
}

/* Secondary/Outline Button */
.btn-outline-primary.btn-lg {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    color: #ffffff;
    padding: 1rem 2.5rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 50px;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.btn-outline-primary.btn-lg:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 255, 255, 0.2);
}

.btn-outline-primary.btn-lg:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.15);
}

/* Button Icons */
.btn-lg i {
    margin-right: 0.75rem;
    font-size: 1rem;
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */

.scroll-fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.scroll-scale-up {
    opacity: 0;
    transform: scale(0.9);
    animation: scaleUp 0.8s ease-out 0.3s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleUp {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   SECTION IMPROVEMENTS
   ============================================ */

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 2.75rem;
    color: #1a252f;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #6c757d;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

.features-section-spacing {
    margin-top: 6rem;
    margin-bottom: 3rem;
}

/* ============================================
   RESPONSIVE IMPROVEMENTS
   ============================================ */

@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0 4rem 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2.5rem;
    }
    
    .btn-lg {
        padding: 0.875rem 2rem;
        font-size: 1rem;
        margin-bottom: 1rem;
        width: 100%;
        max-width: 280px;
    }
    
    .section-title {
        font-size: 2.25rem;
    }
    
    .section-subtitle {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.75rem;
        font-size: 0.95rem;
    }
    
    .section-title {
        font-size: 1.875rem;
    }
}

/* ============================================
   ENHANCED FEATURE CARDS
   ============================================ */

.feature-card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
}

.feature-icon {
    color: #667eea;
    transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
    color: #5a67d8;
}

.feature-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    color: #1a252f;
    margin-bottom: 1rem;
}

.feature-text {
    font-family: 'Inter', sans-serif;
    color: #4a5568;
    font-weight: 400;
    line-height: 1.6;
}

.feature-check {
    color: #48bb78;
    font-size: 1.1rem;
}
