/* =============================================
   CSS VARIABLES
   ============================================= */
   :root {
    --primary-color: #00274d;
    --primary-color-dark: #001f3a;
    --text-color: #333333;
    --light-bg: #f9f9f9;
    --border-color: #ced4da;
    --success-bg: #d4edda;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --warning-bg: #fff3cd;
    --hover-bg: #e9ecef;
    --custom-bg-color: var(--primary-color); /* Default value */
    --custom-text-color: #ffffff; /* Default value */
  }
  
  /* =============================================
     GENERAL TYPOGRAPHY AND LAYOUT
     ============================================= */
  body {
    font-family: "SequelSans-Regular", "Arial", sans-serif;
    background-color: #ffffff;
    color: var(--text-color);
    padding-bottom: 70px;
  }
  
  h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    font-family: 'HWAtlantic-Regulars', serif;
    color: #00275d !important;
  }
  
  .container {
    margin: 0 auto;
    max-width: 100%;
    padding: 0 10px;
  }
  
  .divider {
    display: flex;
    align-items: center;
    text-align: center;
  }
  
  .divider::before,
  .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
  }
  
  .divider::before {
    margin-right: 0.25em;
  }
  
  .divider::after {
    margin-left: 0.25em;
  }
  
  .nowrap {
    white-space: nowrap;
  }
  
  /* =============================================
     NAVIGATION AND HEADER
     ============================================= */
  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  header h1 {
    font-size: 2rem;
    font-weight: bold;
  }
  
  header a {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
  }
  
  .navbar {
    background-color: var(--primary-color);
    justify-content: space-between;
    flex-wrap: nowrap;
    padding: 0.5rem 0.75rem;
  }
  
  .navbar .nav-link {
    color: #fff;
  }
  
  .navbar .nav-link:hover {
    color: var(--hover-bg);
  }
  
  .navbar-brand img {
    height: 80px;
  }
  
  /* Progressive navbar styling with improved spacing */
  .priority-nav {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    margin-left: 20px;
  }
  
  .priority-nav .nav-link {
    padding: 0.5rem 0.5rem;
    color: rgba(0,0,0,.5);
    white-space: nowrap;
  }
  
  .priority-nav .nav-link:hover {
    color: rgba(0,0,0,.7);
    text-decoration: none;
  }
  
  /* Fix right-aligned navbar elements */
  .navbar-nav.ml-auto {
    margin-left: auto !important;
    white-space: nowrap;
  }
  
  /* Ensure dropdown toggle has proper space */
  .nav-link.dropdown-toggle {
    padding-right: 1rem;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  /* =============================================
     TABLES AND DATA DISPLAY
     ============================================= */
  table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1rem;
  }
  
  th, td {
    text-align: left;
    padding: 0.5rem;
  }
  
  th {
    background-color: var(--primary-color);
    color: white;
  }
  
  .table-hover tbody tr:hover {
    background-color: var(--hover-bg);
  }
  
  .table thead {
    background-color: var(--primary-color);
    color: #fff;
  }
  
  .table thead th {
    vertical-align: middle;
    text-align: center;
  }
  
  .table tbody td {
    vertical-align: middle;
    text-align: center;
  }
  
  .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 39, 77, 0.15);
  }
  
  .table-sortable th {
    cursor: pointer;
  }
  
  .table-sortable th:hover {
    background-color: var(--hover-bg);
  }
  
  .table-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  
  .table-container .table-wrapper {
    flex: 1 1 calc(20% - 10px); /* Default to 5 per row */
    margin: 5px;
  }
  
  .table-wrapper table {
    width: 100%;
    font-size: 14px; /* Fixed: was 14x */
  }
  
  .score-cell {
    text-align: center;
  }
  
  .score-field {
    padding: 5px;
    border-radius: 3px;
    min-width: 3ch; /* Adjust width to fit 3 characters */
    display: inline-block;
    text-align: center;
    border: 1px solid #ccc;
  }
  
  .editable {
    min-width: 3ch; /* Adjust width to fit 3 characters */
    display: inline-block;
    text-align: center;
  }
  
  /* Custom table styling */
  .custom-th {
    background-color: var(--custom-bg-color) !important;
    color: var(--custom-text-color) !important;
  }
  
  .custom-card {
    background-color: var(--custom-bg-color) !important;
    color: var(--custom-text-color) !important;
  }
  
  .nested-table {
    background-color: transparent !important;
    border: none !important;
  }
  
  .nested-table th, .nested-table td {
    background-color: transparent !important;
    border: none !important;
  }
  
  .game-default {
    background-color: #ADD8E6; /* Light blue */
  }
  .game-won {
  background-color: rgba(40, 167, 69, 0.2);
}
.game-lost {
  background-color: rgba(220, 53, 69, 0.2);
}
.game-tied {
  background-color: rgba(255, 193, 7, 0.2);
}
  
  .game-overdue {
    background-color: #FADBD8; /* Pale red */
  }
  
  .highlight {
    background-color: #ffffcc;
    border: 1px solid #cccccc;
  }
  
  .update-success {
    background-color: var(--success-bg) !important;
    transition: background-color 0.5s ease;
  }
  
  .depends-on {
    font-style: italic;
    color: #606060;
  }
  
  /* =============================================
     FORMS AND INPUTS
     ============================================= */
  form {
    display: flex;
    flex-wrap: wrap;
  }
  
  form label {
    width: 100%;
    font-weight: bold;
    margin-bottom: 0.5rem;
  }
  
  form input[type=text], form input[type=number], form select {
    width: 100%;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
  }
  
  form input[type=submit] {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    cursor: pointer;
    border-radius: 0.25rem;
  }
  
  .form-control {
    border-radius: 0.25rem;
    border-color: var(--border-color);
  }
  
  .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 39, 77, 0.25);
  }
  
  .gameCommentField {
    border: 1px solid #ccc;
    padding: 8px 10px;       /* More horizontal padding, less vertical */
    min-height: 3em;         /* Reduced minimum height */
    display: block;
    text-align: left;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
    overflow: auto;
    line-height: 1.4;        /* Better line height for readability */
    margin: 0;               /* Remove any margin */
  }
  
  /* Add this class for when in a modal context */
  .modal .gameCommentField {
    padding: 6px 8px;        /* Even tighter padding in modals */
    min-height: 2.5em;       /* Smaller minimum height in modals */
  }
  
  /* =============================================
     BUTTONS
     ============================================= */
  .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
  }
  
  .btn-primary:hover {
    background-color: var(--primary-color-dark);
    border-color: var(--primary-color-dark);
  }
  
  .btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
  }
  
  .btn-outline-primary:hover {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
  }
  
  .btn-outline-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
  }
  
  .btn-outline-danger:hover {
    color: #fff;
    background-color: var(--danger-color);
    border-color: var(--danger-color);
  }
  
  .btn-outline-info {
    color: var(--info-color);
    border-color: var(--info-color);
  }
  
  .btn-outline-info:hover {
    color: #fff;
    background-color: var(--info-color);
    border-color: var(--info-color);
  }
  
  /* =============================================
     LEGACY MODAL AND DIALOG STYLES
     ============================================= */
  .rn-modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
  }
  
  .rn-modal .modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
  }
  
  .rn-modal .modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
  }
  
  .rn-modal .modal-close:hover,
  .rn-modal .modal-close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
  }
  
  /* =============================================
     UTILITY CLASSES AND COMPONENTS
     ============================================= */
  #notificationArea {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 21050;
    width: min(360px, 90vw);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
  }

  #notificationArea .alert {
    margin: 0;
    width: 100%;
  }

  .login-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 20px;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
  }
  
  .login-header {
    text-align: center;
    margin-bottom: 30px;
  }
  
  .hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
  }
  
  .hero-image-container {
    width: 100%;
    height: 300px;
    background-size: cover;
    background-position: center;
    position: relative;
    transition: background-image 0.5s ease-in-out;
  }

/* Prevent accidental horizontal scrollbar on large viewports while
   preserving horizontal scrolling behavior for narrow devices. */
@media (min-width: 992px) {
  html, body {
    overflow-x: hidden;
  }
}
  
  .hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    text-align: center;
    padding: 20px;
    background-color: rgba(0,0,0,0.4);
    border-radius: 8px;
    max-width: 80%;
  }
  
  /* Filter menu container */
  .filter-menu {
    border: 1px solid #ddd;
    padding: 15px;
    margin-bottom: 20px;
    background-color: var(--light-bg);
    border-radius: 5px;
    overflow: hidden;
    display: none; /* Initially hidden */
  }
  
  /* Arrow icon styles */
  #filterArrow {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
  }
  
  #filterArrow.arrow-up {
    transform: rotate(-135deg);
  }
  
  #filterArrow.arrow-down {
    transform: rotate(45deg);
  }
  
  /* Button alignment */
  .filter-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }
  
  .filter-controls .btn {
    margin-left: 10px;
  }
  
  .filter-category {
    margin-bottom: 15px;
  }
  
  .filter-category h5 {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: bold;
  }
  
  .filter-actions {
    text-align: right;
  }
  
  .print-only {
    display: none;
  }
  /* Quick Filter Buttons */
.quick-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.quick-filter-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 20px;
  white-space: nowrap;
}

.quick-filter-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.quick-filter-btn i {
  margin-right: 5px;
}

.active-filters {
  display: flex;
  align-items: center;
}

.active-filters .badge {
  font-size: 0.9rem;
  padding: 0.35em 0.65em;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
  .filter-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .filter-controls > div:last-child {
    width: 100%;
    display: flex;
  }
  
  .filter-controls button,
  .filter-controls a {
    flex: 1;
  }
  
  .quick-filter-btn.active {
    background-color: #007bff;
    color: white;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.5);
  }
  
  .quick-filters-row {
    margin-bottom: 1rem;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
  }
  
  .quick-filter-btn {
    margin-right: 8px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
  }
  
  .quick-filter-btn:hover {
    transform: translateY(-2px);
  }
}
  /* =============================================
     LAYOUT GRID AND STRUCTURE
     ============================================= */
  .LeagueView {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 0px 0px;
    grid-auto-flow: row;
  }
  
  .LeagueInfo {
    grid-area: 1 / 1 / 2 / 5;
  }
  
  .PendingGames {
    grid-area: 2 / 1 / 3 / 2;
  }
  
  .CompletedGames {
    grid-area: 2 / 2 / 3 / 3;
  }
  
  .Roster {
    grid-area: 1 / 3 / 3 / 4;
  }
  
  .sidebar {
    background-color: var(--primary-color);
    min-height: 100vh;
  }
  
  .sidebar .nav-link {
    color: #333;
  }
  
  .sidebar .nav-link.active {
    font-weight: bold;
  }
  /* Admin Sidebar Styling */
.admin-sidebar {
  background-color: #f8f9fa;
  border-right: 1px solid #dee2e6;
  padding: 1rem;
}

.admin-nav-content {
  display: block;
}

.admin-sidebar .nav-link {
  color: #333;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  background-color: #e9ecef;
  color: var(--primary-color);
}

.admin-nav-toggle {
  display: none;
  width: 100%;
  margin-bottom: 1rem;
  text-align: left;
}

/* Mobile Responsive Behavior */
@media (max-width: 767.98px) {
  .admin-sidebar {
    position: relative;
    padding: 0.5rem;
  }
  
  .admin-nav-toggle {
    display: block;
  }
  
  .admin-nav-content {
    display: none;
    padding-top: 0.5rem;
  }
  
  .admin-nav-content.show {
    display: block;
    animation: fadeIn 0.3s;
  }
  
  /* Optional: Add fixed bottom navigation for most common actions */
  .admin-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem;
    z-index: 1000;
  }
  
  .admin-bottom-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    padding: 0.3rem;
  }
  
  .admin-bottom-nav .nav-link i {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Icon consistency in dropdowns */
.dropdown-item i {
  width: 1.2rem;
  text-align: center;
  margin-right: 0.5rem;
}

/* Add padding to bottom of page to prevent content from being hidden behind the nav */
body {
  padding-bottom: 70px;
}

/* Hide on tablet and larger screens */
@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
  

}


/* =============================================
   MOBILE NAVIGATION ELEMENTS
   ============================================= */

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #ffffff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.25rem;
  z-index: 1000;
  border-top: 1px solid #dee2e6;
}

.mobile-bottom-nav .nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  padding: 0.4rem 0.2rem;
  color: #6c757d;
  text-align: center;
  flex: 1;
  min-width: 0;
  transition: color 0.2s;
}

.mobile-bottom-nav .nav-link.active {
  color: var(--primary-color);
}

.mobile-bottom-nav .nav-link i {
  font-size: 1.4rem;
  margin-bottom: 0.2rem;
}

/* Logo in navbar */
.mobile-bottom-nav .mini-logo {
  height: 1.4rem;
  width: auto;
  margin-bottom: 0.2rem;
}

.mobile-bottom-nav .nav-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 1.4rem;
}

/* Mobile User Dropdown Menu */
.mobile-user-dropdown {
  position: fixed;
  bottom: 70px;
  right: 10px;
  display: none;
  width: 220px;
  max-width: 85vw;
  background-color: #fff;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 0.25rem;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
  padding: 0;
  margin: 0;
  list-style: none;
  text-align: left;
  z-index: 1060;
}

.mobile-user-dropdown.show {
  display: block;
  animation: fadeInUp 0.2s ease-out;
}

/* Mobile dropdown items styling */
.mobile-user-dropdown .dropdown-item {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  clear: both;
  font-size: 0.95rem;
  color: #212529;
  text-align: inherit;
  white-space: normal;
  background-color: transparent;
  border: 0;
}

.mobile-user-dropdown .dropdown-item:hover {
  background-color: #f8f9fa;
  color: #16181b;
}

.mobile-user-dropdown .dropdown-item i {
  width: 1.2rem;
  text-align: center;
  margin-right: 0.5rem;
}

/* Common dropdown elements */
.dropdown-divider {
  height: 0;
  margin: 0.5rem 0;
  overflow: hidden;
  border-top: 1px solid #e9ecef;
}

.dropdown-item-text {
  display: block;
  padding: 0.5rem 1rem;
  color: #212529;
}

/* Animations */
@keyframes fadeInUp {
  from { 
    opacity: 0;
    transform: translateY(10px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive behavior */
body {
  padding-bottom: 70px; /* Space for mobile nav */
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0; /* No padding needed on desktop */
  }
  
  .mobile-bottom-nav {
    display: none; /* Hide mobile nav on desktop */
  }
}

/* Hide regular navigation on mobile */
@media (max-width: 767.98px) {
  .navbar-brand {
    margin-right: auto;
  }
  
  .priority-nav,
  .navbar .navbar-nav.ml-auto,
  .navbar-toggler,
  .navbar-collapse {
    display: none !important;
  }
}

/* Hide top navigation elements on mobile */
@media (max-width: 767.98px) {
  /* Keep the navbar brand/logo visible */
  .navbar-brand {
    margin-right: auto;
    margin-left: auto;
    padding: 0.25rem 0;
  }
  
  /* Hide the priority navigation on mobile */
  .priority-nav {
    display: none !important;
  }
  
  /* Hide the user dropdown in the header */
  .navbar .navbar-nav.ml-auto {
    display: none !important;
  }
  
  /* Hide the navbar toggler button */
  .navbar-toggler {
    display: none !important;
  }
  
  /* Ensure navbar collapse is always hidden on mobile */
  .navbar-collapse {
    display: none !important;
  }
  
  /* Make navbar more compact on mobile */
  .navbar {
    padding: 0.25rem 0;
    justify-content: center;
  }
  
  /* Optional: Make the navbar background less prominent */
  .navbar.bg-light {
    background-color: transparent !important;
  }
}

/* =============================================
     PRINT STYLES
     ============================================= */
  @media print {
    .page-break {
      page-break-after: always;
    }
    
    table {
      width: 100%;
      border-collapse: collapse;
      border-spacing: 0;
      page-break-inside: avoid;
    }
    
    th, td {
      padding: 1px;
      text-align: center;
      page-break-inside: avoid;
    }
    
    .schedule-section,
    .table-container {
      page-break-inside: avoid;
    }
    
    /* Hide DataTables elements */
    .dataTables_filter,
    .dataTables_length,
    .dataTables_paginate,
    .dataTables_info,
    .form, .btn, .mb-6, .no-print {
      display: none !important;
    }
    
    .print-only {
      display: block;
    }
    
    tr {
      page-break-inside: avoid;
      page-break-after: auto;
    }
    
    thead {
      display: table-header-group;
    }
    
    tfoot {
      display: table-footer-group;
    }
    
    body::before {
      content: "";
      position: fixed;
      top: 50%;
      left: 50%;
      width: 80%;
      height: 80%;
      background-size: contain;
      opacity: 0.1;
      transform: translate(-50%, -50%);
      z-index: -1;
    }
    
    /* Table styling for print */
    .table-responsive-sm {
      background: none !important;
    }
    
    .custom-th {
      background-color: var(--custom-bg-color) !important;
      color: var(--custom-text-color) !important;
    }
    
    .custom-card {
      background-color: var(--custom-bg-color) !important;
      color: var(--custom-text-color) !important;
    }
    
    /* Force print background colors */
    * {
      -webkit-print-color-adjust: exact !important;
      print-color-adjust: exact !important;
    }
  }
  
  /* =============================================
     MEDIA QUERIES (CONSOLIDATED)
     ============================================= */
  @media (max-width: 767.98px) {
    /* Medium and smaller */
    .navbar-brand img {
      height: 60px;
    }
    
    .priority-nav .nav-link {
      padding: 0.5rem 0.4rem;
    }
    .navbar-nav .dropdown-menu {
      position: absolute;
      float: none;
      width: auto;
      margin-top: 0;
      background-color: #fff;
      border: 1px solid rgba(0,0,0,.15);
      box-shadow: 0 0.5rem 1rem rgba(0,0,0,.175);
      right: 0;
      left: auto;
    }
    
    /* Ensure dropdown doesn't go offscreen */
    .navbar-nav .dropdown-menu.show {
      transform: translateX(-50%);
      left: 50%;
    }

    .navbar-collapse {
      position: absolute;
      top: 100%;
      right: 0;
      width: auto;
      min-width: 280px;
      max-width: 90%;
      padding: 0.5rem;
      background-color: #f8f9fa;
      border: 1px solid #dee2e6;
      border-radius: 0.25rem;
      box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
      z-index: 1000;
    }
    
    /* Fix dropdown positioning without centering */
    .navbar-nav .dropdown-menu.show {
      transform: none;
      left: auto;
      right: 0;
      min-width: 280px; /* Match navbar-collapse width */
    }
    
    /* Fix overflow issues */
    .container {
      position: relative;
    }
    
    /* Ensure proper alignment of dropdown menu */
    .dropdown-menu-right {
      right: 0;
      left: auto;
    }
    
    /* Keep username button right-aligned */
    .navbar-nav.ml-auto {
      margin-left: 0 !important;
      text-align: right;
    }

    /* Hide header navigation on mobile when using bottom nav */
    /* Keep the navbar brand/logo visible */
    .navbar-brand {
      margin-right: auto;
    }
    
    /* Hide the priority navigation on mobile */
    .priority-nav {
      display: none !important;
    }
    
    /* Keep just the user dropdown in the header */
    .navbar .navbar-nav.ml-auto {
      display: none !important;
    }
    
    /* Hide the navbar toggler button */
    .navbar-toggler {
      display: none !important;
    }
    
    /* Ensure navbar collapse is always hidden on mobile */
    .navbar-collapse {
      display: none !important;
    }
  }
  
  @media (max-width: 575.98px) {
    /* Small and smaller */
    .navbar-brand img {
      height: 50px;
    }
    
    .priority-nav .nav-link {
      padding: 0.4rem 0.3rem;
      font-size: 0.9rem;
    }

    .navbar-nav .dropdown-menu {
      width: auto;
      min-width: 280px;
      max-width: 95vw;
    }
    
    /* Add text wrapping for dropdown items */
    .dropdown-item {
      white-space: normal;
      word-wrap: break-word;
      line-height: 1.3;
    }
  }
  
  @media (max-width: 350px) {
    /* Extra tiny screens (smaller iPhones) */
    .navbar-brand img {
      height: 45px;
    }
  }

  /* Restore proper padding on menu items */
  .navbar-collapse .navbar-nav .nav-link {
    padding: 0.5rem 1rem;
  }

/* Additional fixes that should be outside media queries */
/* Ensure dropdown items wrap text and have proper padding */
.dropdown-item {
  padding: 0.5rem 1rem;
  white-space: normal; /* Override Bootstrap's nowrap */
}

/* Handle long usernames and club names */
.nav-link.dropdown-toggle {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* For club name in navbar */
.club-name-short {
  display: inline-block;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* Consolidated media queries for responsive behavior */
@media (max-width: 991.98px) and (min-width: 768px) {
  /* Make nav links more compact at medium breakpoints */
  .priority-nav .nav-link {
    padding: 0.5rem 0.3rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 767.98px) {
  /* Navbar collapse styling */
  .navbar-collapse {
    position: absolute;
    top: 100%;
    right: 0;
    width: auto;
    min-width: 280px;
    max-width: 90%;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    z-index: 1000;
  }
  
  /* Fix dropdown menu positioning */
  .navbar-nav .dropdown-menu.dropdown-menu-right {
    right: 0;
    left: auto;
    transform: none !important;
    min-width: 280px;
    max-width: 100%;
  }
  
  .navbar-nav .dropdown-menu {
    position: absolute;
    float: none;
    width: auto;
    background-color: #fff;
    border: 1px solid rgba(0,0,0,.15);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.175);
  }
  
  /* Restore proper padding on menu items */
  .navbar-collapse .navbar-nav .nav-link {
    padding: 0.5rem 1rem;
  }
}

/* Dropdown item text wrapping */
.dropdown-item {
  padding: 0.5rem 1rem;
  white-space: normal; /* Override Bootstrap's nowrap */
  word-wrap: break-word;
  line-height: 1.3;
}

/* For club name in navbar */
.club-name-short {
  display: inline-block;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* User Dashboard styling */
.default-avatar {
  font-weight: bold;
  background-color: #6c757d;
}

@media (max-width: 767.98px) {
  .user-dashboard-actions .btn {
    margin-bottom: 1rem;
  }
}

/* Make buttons more touch-friendly on mobile */
@media (max-width: 575.98px) {
  .btn {
    padding: 0.5rem 1rem;
  }
  
  .user-dashboard-actions .btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80px;
  }
}

/* Mobile Game Card Styling */
.game-card-compact {
  border-radius: 10px;
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}

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

/* Game Header with Date and Time */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.075);
}

.game-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  margin-right: 10px;
  line-height: 1.1;
}

.game-info {
  flex-grow: 1;
  text-align: right;
  overflow: hidden;
}

.game-name {
  font-weight: 500;
  margin-bottom: 3px;
  font-size: 0.9rem;
  max-width: 100%;
}

.game-time-location {
  font-size: 0.85rem;
}

.game-time {
  font-weight: 500;
}

.game-court {
  font-size: 0.75rem;
  color: #666;
}

/* Status Badge */
.game-status-badge {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 0 8px 0 8px;
  color: white;
}

.game-status-badge.completed {
  background-color: #28a745;
}
.game-status-badge.today {
  background-color: #51ff00; /* Orange */
  color: rgb(0, 0, 0);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}
.game-status-badge.past {
  background-color: #dc3545;
}

.game-status-badge.upcoming {
  background-color: #007bff;
}

/* Player Teams Section */
.game-players-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team {
  padding: 8px;
  border-radius: 6px;
  background-color: #f8f9fa;
  text-align: center;
}

.is-user-team {
  background-color: rgba(0, 123, 255, 0.1);
  border-left: 3px solid var(--primary-color);
}

.vs-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 5px 0;
}

.vs {
  font-size: 0.8rem;
  font-weight: bold;
  color: #666;
}

.score {
  font-weight: bold;
  font-size: 1.1rem;
}

.score .winner {
  color: var(--primary-color);
}

.default-marker {
  font-size: 0.8rem;
  vertical-align: super;
  color: #dc3545;
}

/* Game Actions */
.game-actions {
  margin-top: 15px;
  text-align: right;
}

.depends-on {
  font-style: italic;
  color: #666;
  font-size: 0.9rem;
}

/* Mobile game list spacing */
.mobile-games-list {
  margin-bottom: 70px; /* Space for the mobile nav bar */
}

/* Make dropdown items more touch-friendly */
@media (max-width: 767.98px) {
  .dropdown-item {
    padding: 0.5rem 1rem;
  }
  
  .dropdown-item i {
    width: 20px;
    margin-right: 8px;
    text-align: center;
  }
}

/* Fix for dropdown menus in game cards */
.game-card .dropdown-menu {
  z-index: 1050 !important; /* Higher z-index to appear above other elements */
}

/* Ensure the game card has the correct positioning context */
.game-card {
  position: relative;
}
/* Game card footer containing league info and actions */
.game-footer {
  display: flex;
  justify-content: space-between;
  align-items: left;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.075);
}
.game-footer-left {
  text-align: left;
  flex-grow: 1;
}
.game-league-info {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: #666;
  flex-grow: 1;
}

.game-league-info .league-name {
  font-weight: 500;
  margin-bottom: 2px;
}

.game-league-info .division-name {
  font-size: 0.7rem;
}

/* Keep existing game-actions styling but adjust for new layout */
.game-actions {
  margin-top: 0;
  flex-shrink: 0;
}
/* Updated Game Header Layout with league/division in middle */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.075);
}

.game-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  margin-right: 10px;
  line-height: 1.1;
}
.game-date.today-date {
  background-color: #3bf00a;
  padding: 3px;
  border-radius: 4px;
  box-shadow: 0 0 5px rgba(47, 254, 5, 0.861);
}
.game-date.today-date .day-name {
  color: #000000;
  font-weight: bold;
}
.game-metadata {
  flex-grow: 1;
  text-align: center;
  padding: 0 8px;
  overflow: hidden;
}

.game-name {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.game-league-division {
  font-size: 0.75rem;
  color: #666;
}

.game-league {
  font-weight: 500;
}

.game-division {
  font-size: 0.7rem;
  margin-left: 3px;
  opacity: 0.8;
}

.game-division:before {
  content: "•";
  margin-right: 3px;
  opacity: 0.5;
}

.game-time-location {
  flex-shrink: 0;
  text-align: right;
  font-size: 0.85rem;
}

.game-time {
  font-weight: 500;
}

.game-court {
  font-size: 0.75rem;
  color: #666;
}

/* Active club indicator for superAdmin */
.active-club-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 15px;
  padding: 4px 8px;
  border-radius: 4px;
  background-color: rgba(0,123,255,0.1);
}

.active-club-indicator .badge {
  font-size: 0.85rem;
  padding: 0.35em 0.65em;
}

/* Make it more visible on mobile */
@media (max-width: 767.98px) {
  .active-club-indicator {
    margin: 10px 0;
    padding: 8px;
    width: 100%;
    justify-content: center;
  }
}

/* Optional: Add to your existing CSS or in a <style> tag */

/* ... existing CSS ... */
.bracket-rounds-container {
  display: flex;
  flex-direction: row; /* Default for wider screens */
  gap: 20px; /* Space between rounds */
  overflow-x: auto; /* Allow horizontal scrolling on small screens */
}

.bracket-round {
  flex: 1; /* Each round takes equal space if possible */
  min-width: 200px; /* Minimum width for a round column */
  padding: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  background-color: #f9f9f9;
}

.bracket-round h6 {
  text-align: center;
  margin-bottom: 15px;
  color: #333;
  font-weight: bold;
}

/* On smaller screens, stack rounds vertically */
@media (max-width: 768px) {
  .bracket-rounds-container {
    flex-direction: column;
  }
  .bracket-round {
    min-width: 100%; /* Full width on small screens */
    margin-bottom: 20px;
  }
}

.bracket-match {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #ddd;
  padding: 8px 10px;
  margin-bottom: 8px;
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  font-size: 0.85rem; /* Slightly smaller font for denser display */
}
.bracket-team {
  flex-basis: 42%; /* Adjust basis */
  text-align: center;
  padding: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bracket-team.bye {
  color: #888;
  font-style: italic;
}
.bracket-team.tbd {
  color: #555;
  font-style: italic;
}
.bracket-vs {
  flex-basis: 10%;
  text-align: center;
  font-weight: bold;
  color: #777;
  font-size: 0.8rem;
}
.seed-prefix {
  font-size: 0.75em;
  color: #6c757d;
  margin-right: 3px;
}
  .seed-column { width: 80px; }
  @media (max-width: 767.98px) {
    .seed-column { width: 60px; }
  }
    

/* Tournament Bracket Styling */
.bracket-container {
  padding: 20px 10px;
  overflow-x: auto;
  font-family: Arial, sans-serif;
  padding: 10px;
}

.bracket-rounds-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
  position: relative;
  margin-bottom: 20px;
}

.bracket-round {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.bracket-round-title {
  text-align: center;
  margin-bottom: 10px; /* Slightly reduced margin */
  font-size: 0.9rem; /* Slightly smaller title */
  font-weight: 600;
  color: #555;
}

.bracket-match-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  justify-content: center;
  padding: 8px 0;
}

.bracket-match {
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin: 0;
  position: relative;
  z-index: 1;
}

.bracket-team {
  padding: 6px 8px; /* Slightly less padding */
  font-size: 0.85rem; /* Slightly smaller text */
  border-bottom: 1px solid #eee;
  position: relative;
  display: flex;
  align-items: center;
}

.bracket-team:last-child {
  border-bottom: none;
}

.bracket-team.winner {
  background-color: rgba(40, 167, 69, 0.05);
  font-weight: 500;
}

.bracket-team-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seed-prefix {
  font-size: 0.75em;
  color: #6c757d;
  margin-right: 5px;
  min-width: 24px;
  text-align: right;
}

/* Connecting lines between matches */
.bracket-connector {
  position: absolute;
  right: -20px;
  border-color: #aaa;
  border-style: solid;
  z-index: 0;
}

.bracket-connector-horizontal {
  border-top-width: 2px;
  width: 20px;
  right: -20px;
}

.bracket-connector-vertical {
  border-right-width: 2px;
}

/* Make bracket more compact */
.bracket-container {
  padding: 15px 5px;
}

.bracket-round {
  min-width: 180px;
  padding: 5px;
  margin-right: 20px; /* Space for connectors */
}

.bracket-match-wrapper {
  position: relative;
  margin-bottom: 5px;
}

/* Hide bye games */
.bracket-match.bye-match {
  opacity: 0.5; /* Show faded instead of hiding completely */
}

@media (max-width: 767.98px) {
  .bracket-round {
    min-width: 180px;
  }
  
  .bracket-team {
    padding: 6px 8px;
    font-size: 0.85rem;
  }
}

/* Updated connector styles for proper alignment */
.bracket-connector {
  position: absolute;
  right: -20px;
  border-color: #aaa;
  border-style: solid;
  z-index: 0;
}

.bracket-connector-horizontal {
  border-top-width: 2px;
  width: 20px;
  right: -20px;
}

.bracket-connector-vertical {
  border-right-width: 2px;
}

/* Match wrapper positioning */
.bracket-match-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

/* For second round, add proper spacing */
.bracket-round[data-round="2"] .bracket-match-wrapper {
  margin-bottom: 0;
}

/* Match positioning */
.bracket-match {
  width: 100%;
  position: relative;
  z-index: 2;
  background-color: white;
}

/* League status badges */
.status-badge {
  font-size: 0.9rem;
  padding: 0.35em 0.65em;
  margin-left: 10px;
  vertical-align: middle;
}

.status-planning {
  background-color: #6c757d; /* gray */
}

.status-registration {
  background-color: #17a2b8; /* info blue */
}

.status-scheduled {
  background-color: #fd7e14; /* orange */
}

.status-active {
  background-color: #28a745; /* green */
}

.status-completed {
  background-color: #007bff; /* primary blue */
}

.status-archived {
  background-color: #6c757d; /* gray */
  opacity: 0.7;
}

.court-card {
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 20px;
        margin-bottom: 20px;
        background: white;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .court-header {
        display: flex;
        justify-content: between;
        align-items: center;
        margin-bottom: 15px;
    }
    
    .court-stats {
        display: flex;
        gap: 20px;
        margin-top: 15px;
    }
    
    .stat-item {
        text-align: center;
        padding: 10px;
        background: #f8f9fa;
        border-radius: 5px;
        flex: 1;
    }
    
    .stat-value {
        font-size: 1.5em;
        font-weight: bold;
        color: #007bff;
    }
    
    .availability-grid {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 5px;
        margin-top: 10px;
    }
    
    .day-header {
        text-align: center;
        font-weight: bold;
        padding: 5px;
        background: #e9ecef;
    }
    
    .time-slot {
        padding: 2px 4px;
        font-size: 0.8em;
        text-align: center;
        background: #d4edda;
        margin: 1px 0;
        border-radius: 2px;
    }
    
    .modal-lg {
        max-width: 900px;
    }
    
    .booking-table {
        max-height: 400px;
        overflow-y: auto;
    }
    
    .status-confirmed { color: #28a745; }
    .status-cancelled { color: #dc3545; }
    .status-completed { color: #6c757d; }
    
    .analytics-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .chart-container {
        height: 300px;
        background: white;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 15px;
    }

/* =============================================
   SPARKLINE STYLES
   ============================================= */
.sparkline circle {
  transition: r 0.2s ease;
}

.sparkline-point:hover {
  r: 2.5;
  opacity: 0.8;
  cursor: pointer;
}

.sparkline-point {
  cursor: help;
}