/* Recurring Days of Week Checkboxes Styling */
.repeat-days-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.repeat-days-group label {
  display: flex;
  align-items: center;
  background: rgba(144, 173, 203, 0.1);
  border-radius: 6px;
  padding: 4px 10px 4px 6px;
  font-size: 0.98em;
  color: #b7c9e6;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border: 1px solid transparent;
}
.repeat-days-group label:hover,
.repeat-days-group input:focus + label {
  background: rgba(144, 173, 203, 0.22);
  color: #fff;
  border: 1px solid #90adcb;
}
.repeat-days-group input[type="checkbox"] {
  accent-color: #90adcb;
  width: 1.1em;
  height: 1.1em;
  margin-right: 6px;
  border-radius: 3px;
  border: 1px solid #223649;
  background: #1a2332;
  transition: box-shadow 0.2s;
}
.repeat-days-group input[type="checkbox"]:checked {
  box-shadow: 0 0 0 2px #90adcb44;
}
.repeat-days-group input[type="checkbox"]:focus {
  outline: 2px solid #90adcb;
}
.repeat-days-group label.selected {
  background: #223649;
  color: #fff;
  border: 1px solid #90adcb;
}
.repeat-days-group label input[type="checkbox"] {
  margin-right: 6px;
}
:root {
  --primary-900: hsl(256, 43%, 7%);
  --border-1: hsla(271, 100%, 70%, 0.5); /* Lighter purple for top border */
  --border-2: hsla(271, 100%, 40%, 0.3); /* Darker purple for bottom border */
}

body {
  /* Use the actual filename in your assets folder */
  /* Fallback for older browsers */
  background: url("../assets/background.png") no-repeat center center fixed !important;
  /* Modern browsers with WebP support */
  background: url("../assets/background.webp") no-repeat center center fixed !important;
  background-size: cover !important;
  background-color: var(--primary-900) !important;
  min-height: 100vh;
  position: relative;
  z-index: 0;
}

/* Ensure main content is below dropdowns */
main {
  position: relative;
  z-index: 1;
}

/* Header styling with frosted glass effect */
header.flex.justify-between.items-center.px-10.py-2.border-b.border-\[\#223649\] {
  position: relative !important;
  background: hsla(271, 100%, 15%, 0.25) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: none !important;
  z-index: 1000 !important;
}

header.flex.justify-between.items-center.px-10.py-2.border-b.border-\[\#223649\]::before {
  content: "" !important;
  position: absolute !important;
  z-index: -1 !important;
  inset: 0 !important;
  padding: 1px !important;
  padding-top: 0 !important; /* No border on top */
  background: linear-gradient(
    to bottom,
    var(--border-1),
    var(--border-2)
  ) !important;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
  -webkit-mask-composite: xor !important;
  mask-composite: exclude !important;
}

/* Stats rectangles/boxes */
.grid-cols-2.md\:grid-cols-4 > div {
  position: relative !important;
  background: hsla(271, 100%, 15%, 0.85) !important;
  border-radius: 1rem !important;
  padding: 1.5rem !important;
  z-index: 1 !important;
  /* Performance optimizations - REMOVED backdrop-filter and will-change */
  contain: layout style paint;
}

.grid-cols-2.md\:grid-cols-4 > div::before {
  content: "" !important;
  position: absolute !important;
  z-index: -1 !important;
  inset: 0 !important;
  padding: 1px !important;
  border-radius: 1rem !important;
  background: linear-gradient(
    to bottom,
    var(--border-1),
    var(--border-2)
  ) !important;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
  -webkit-mask-composite: xor !important;
  mask-composite: exclude !important;
}

.kills,
.accuracy,
.games,
.damage {
  color: #ffffff !important; /* Bright white */
  font-weight: bold !important;
}

/* Account dropdown styling */
.dropdown-menu {
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  z-index: 100000 !important; /* Increased z-index to appear above all elements */
  width: 14rem !important;
  margin-top: 0.5rem !important;
  background: hsla(
    271,
    100%,
    15%,
    0.95
  ) !important; /* More opaque background */
  border-radius: 0.5rem !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3),
    0 4px 6px -2px rgba(0, 0, 0, 0.2) !important;
}

.dropdown-menu::before {
  content: "" !important;
  position: absolute !important;
  z-index: -1 !important;
  inset: 0 !important;
  padding: 1px !important;
  border-radius: 1rem !important;
  background: linear-gradient(
    to bottom,
    var(--border-1),
    var(--border-2)
  ) !important;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
  -webkit-mask-composite: xor !important;
  mask-composite: exclude !important;
}

/* New CSS-based hover dropdown */
.account-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.account-item {
  position: relative;
  display: flex;
  align-items: center;
}

.account-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  color: white;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  white-space: nowrap;
  min-width: max-content;
}

.account-link:hover {
  background: hsla(271, 100%, 50%, 0.1);
}

.dropdown-arrow {
  height: 0.75rem;
  width: 0.75rem;
  fill: currentColor;
  transition: transform 0.3s ease;
  /* Performance optimization */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
}

.account-item:hover .dropdown-arrow {
  transform: rotate(180deg) translateZ(0);
}

.account-submenu {
  position: absolute !important;
  top: 100% !important;
  right: 0 !important;
  width: 280px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.2s ease, visibility 0.2s ease !important;
  pointer-events: none !important;
  padding: 0.5rem !important;
  margin-top: 0.5rem !important;
  z-index: 100000 !important;
  background: rgba(30, 15, 50, 0.95) !important;
  border: 1px solid rgba(139, 92, 246, 0.3) !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
}

/* Create invisible bridge between trigger and dropdown */
.account-submenu::before {
  content: "";
  position: absolute;
  top: -0.5rem;
  left: 0;
  right: 0;
  height: 0.5rem;
  background: transparent;
}

.dropdown-options {
  position: absolute !important;
  top: calc(100% + 0.5rem) !important;
  left: 0 !important;
  right: 0 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.3s ease, visibility 0.3s ease !important;
  padding: 0.5rem !important;
  z-index: 1000 !important;
  background: rgba(30, 15, 50, 0.95) !important;
  border: 1px solid rgba(139, 92, 246, 0.3) !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
}

/* Bridge area no longer needed with fixed positioning */

/* Show dropdown immediately on hover - with better targeting */
.account-item:hover .account-submenu,
.account-submenu:hover {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transition-delay: 0s !important; /* No delay when showing */
  display: block !important;
}

/* Ensure dropdown stays open when hovering over links */
.account-submenu:hover,
.account-submenu-link:hover {
  transition-delay: 0s;
}

/* Custom dropdown open state for overview page */
.custom-dropdown.open .dropdown-options {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.account-user-info {
  padding: 1rem;
  border-bottom: 1px solid hsla(271, 100%, 70%, 0.2);
}

.account-links {
  padding: 0.5rem;
}

.account-auth-section {
  border-top: 1px solid hsla(271, 100%, 70%, 0.2);
  padding: 0.5rem;
}

.account-submenu-item {
  margin: 0.125rem 0;
}

.account-submenu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #90adcb;
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  cursor: pointer; /* Ensure cursor shows as pointer */
}

.account-submenu-link:hover {
  background: hsla(271, 100%, 50%, 0.15);
  color: white;
  transform: translateX(4px);
}

/* Ensure links inside dropdown keep dropdown open */
.account-submenu a:hover,
.account-submenu a:focus {
  transition-delay: 0s !important;
}

/* Make entire dropdown area clickable/hoverable */
.account-submenu * {
  pointer-events: auto;
}

.account-submenu-link svg {
  height: 1.25rem;
  width: 1.25rem;
  flex-shrink: 0;
}

.login-link {
  color: #8b5cf6 !important;
}

.login-link:hover {
  color: #a78bfa !important;
}

.logout-link {
  color: #ef4444 !important;
}

.logout-link:hover {
  color: #f87171 !important;
  background: hsla(0, 84%, 60%, 0.1) !important;
}

/* Source dropdown - Custom dropdown matching login dropdown style */
.source-dropdown-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  position: relative !important;
  z-index: 1000 !important;
}

.source-label {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #90adcb !important;
  white-space: nowrap !important;
}

.custom-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1rem !important;
  padding: 0.75rem 1.25rem !important;
  background: hsla(271, 100%, 15%, 0.85) !important;
  border: 1px solid hsla(271, 100%, 70%, 0.3) !important;
  border-radius: 0.5rem !important;
  color: white !important;
  cursor: pointer !important;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1) !important;
  min-width: 220px !important;
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  height: 48px !important;
  box-sizing: border-box !important;
  /* Performance optimizations */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: background-color, border-color;
}

.dropdown-trigger:hover {
  background: hsla(271, 100%, 50%, 0.1) !important;
  border-color: hsla(271, 100%, 70%, 0.5) !important;
}

.dropdown-arrow-icon {
  height: 1rem !important;
  width: 1rem !important;
  color: #90adcb !important;
  transition: transform 0.3s ease !important;
  flex-shrink: 0 !important;
  /* Performance optimization */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform;
}

.custom-dropdown.open .dropdown-arrow-icon {
  transform: rotate(180deg) !important;
}

.dropdown-option {
  display: flex !important;
  align-items: center !important;
  padding: 0.75rem 1rem !important;
  color: #90adcb !important;
  cursor: pointer !important;
  border-radius: 0.5rem !important;
  transition: all 0.2s ease !important;
  font-size: 0.875rem !important;
  margin: 0.125rem 0 !important;
}

.dropdown-option:hover {
  background: hsla(271, 100%, 50%, 0.15) !important;
  color: white !important;
  transform: translateX(4px) !important;
}

.dropdown-option.selected {
  background: hsla(271, 100%, 50%, 0.2) !important;
  color: white !important;
}

/* Leaderboard controls styling */
.leaderboard-controls {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 1.5rem !important;
  gap: 2rem !important;
  flex-wrap: wrap !important;
}

.control-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
  min-width: 200px !important;
}

/* Horizontal control group for inline labels */
.control-group-horizontal {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  min-width: 250px !important;
}

.control-label {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #90adcb !important;
  margin-bottom: 0.25rem !important;
}

/* Inline label for horizontal layout */
.control-label-inline {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #90adcb !important;
  white-space: nowrap !important;
  min-width: 60px !important;
}

/* Make season dropdown and source dropdown same width as other custom dropdowns */
.season-dropdown,
.source-dropdown {
  min-width: 200px !important;
}

/* Scrollable dropdown for long lists like seasons */
.scrollable-dropdown {
  max-height: 200px !important;
  overflow-y: auto !important;
}

/* Custom scrollbar for dropdown */
.scrollable-dropdown::-webkit-scrollbar {
  width: 6px !important;
}

.scrollable-dropdown::-webkit-scrollbar-track {
  background: hsla(271, 100%, 15%, 0.3) !important;
  border-radius: 3px !important;
}

.scrollable-dropdown::-webkit-scrollbar-thumb {
  background: hsla(271, 100%, 50%, 0.5) !important;
  border-radius: 3px !important;
}

.scrollable-dropdown::-webkit-scrollbar-thumb:hover {
  background: hsla(271, 100%, 50%, 0.7) !important;
}

/* Legend Stats section header styling */
.legend-stats-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 1rem !important;
  flex-wrap: wrap !important;
  gap: 1rem !important;
}

/* Remove old select styling since we're using custom dropdown */
select#data-source {
  display: none !important;
}

/* Legend stats table */
#legendStatsTable {
  background: rgba(75, 0, 130, 0.7) !important;
  position: relative !important;
  z-index: 1 !important; /* Force table to low z-index */
}

/* Legend Stats Table Header with tempered glass effect */
thead.bg-\[\#223649\] {
  position: relative !important;
  background: hsla(0, 0%, 0%, 0.4) !important;
  z-index: 1 !important; /* Force table header to low z-index */
}

thead.bg-\[\#223649\]::before {
  content: "" !important;
  position: absolute !important;
  z-index: -1 !important;
  inset: 0 !important;
  padding: 1px !important;
  background: linear-gradient(
    to bottom,
    var(--border-1),
    var(--border-2)
  ) !important;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
  -webkit-mask-composite: xor !important;
  mask-composite: exclude !important;
}

/* Header cells styling */
thead.bg-\[\#223649\] th {
  color: #ffffff !important;
  font-weight: 600 !important;
  position: relative !important;
  background: transparent !important;
}

/* Hover effect for header cells */
thead.bg-\[\#223649\] th:hover {
  background: hsla(0, 0%, 100%, 0.05) !important;
}

#legendStatsTable th,
#legendStatsTable td {
  color: #ffffff !important;
  border: 1px solid rgba(107, 35, 142, 0.3) !important;
}

/* Table header */
#legendStatsTable thead th {
  background: rgba(
    59,
    0,
    98,
    0.8
  ) !important; /* Semi-transparent darker purple for header */
  color: #ffffff !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

/* Table row hover effect */
#legendStatsTable tbody tr:hover {
  background: rgba(
    91,
    16,
    146,
    0.8
  ) !important; /* Semi-transparent lighter purple for hover */
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

/* Table borders */
#legendStatsTable th,
#legendStatsTable td {
  border-color: #6b238e !important; /* Slightly lighter purple for borders */
}

/* Table wrapper border */
div.overflow-x-auto.rounded-xl {
  border: 2px solid #ffffff !important;
  background: rgba(75, 0, 130, 0.7) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

/* Common Form Elements */
input[type="text"],
select {
  background-color: #223649 !important;
  border: 1px solid #314d68 !important;
  border-radius: 0.5rem !important;
  padding: 0.5rem 1rem !important;
  color: white !important;
  width: 100% !important;
}

input[type="text"]:focus,
select:focus {
  outline: none !important;
  border-color: #38a169 !important;
}

/* Common Button Styles */
.btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  padding: 0.5rem 1rem !important;
  font-weight: 600 !important;
  border-radius: 0.5rem !important;
  transition: all 0.2s ease-in-out !important;
  width: 100% !important;
  cursor: pointer !important;
  position: relative !important;
  overflow: hidden !important;
}

@keyframes checkmark {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.animate-checkmark {
  animation: checkmark 0.3s ease-in-out forwards;
}

.btn:disabled {
  cursor: not-allowed !important;
  opacity: 0.9 !important;
}

.btn-primary {
  background-color: #8b5cf6 !important;
  color: white !important;
}

.btn-primary:hover:not(:disabled) {
  background-color: #7c3aed !important;
  transform: translateY(-1px) !important;
}

.btn-success {
  background-color: #38a169 !important;
  color: white !important;
}

.btn-success:hover:not(:disabled) {
  background-color: #2f855a !important;
  transform: translateY(-1px) !important;
}

.btn-purple {
  background-color: #8b5cf6 !important;
  color: white !important;
}

.btn-purple:hover:not(:disabled) {
  background-color: #7c3aed !important;
  transform: translateY(-1px) !important;
}

.btn-linked {
  background-color: #38a169 !important;
  color: white !important;
  cursor: not-allowed !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  padding: 0.5rem 1rem !important;
  font-weight: 600 !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 0 0 1px rgba(56, 161, 105, 0.5) !important;
  transition: all 0.2s ease-in-out !important;
}

.btn-linked svg {
  width: 1.25rem !important;
  height: 1.25rem !important;
  color: white !important;
  stroke-width: 3 !important;
}

/* Common Card Styles */
.card {
  position: relative !important;
  background: hsla(271, 100%, 15%, 0.25) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-radius: 1rem !important;
  padding: 1.5rem !important;
  margin-bottom: 1rem !important;
}

.card::before {
  content: "" !important;
  position: absolute !important;
  z-index: -1 !important;
  inset: 0 !important;
  padding: 1px !important;
  border-radius: 1rem !important;
  background: linear-gradient(
    to bottom,
    var(--border-1),
    var(--border-2)
  ) !important;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0) !important;
  -webkit-mask-composite: xor !important;
  mask-composite: exclude !important;
}

/* Common Text Styles */
.text-muted {
  color: #90adcb !important;
}

/* Dropdown specific styles */
.dropdown-container {
  position: relative !important;
}

.profile-btn {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.25rem !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0.375rem !important;
  cursor: pointer !important;
  transition: background-color 0.2s !important;
}

.profile-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

.profile-btn img {
  width: 2rem !important;
  height: 2rem !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

.dropdown-menu a,
.dropdown-menu button {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  padding: 0.5rem 1rem !important;
  color: #c9d1d9 !important;
  text-decoration: none !important;
  transition: background-color 0.2s !important;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
  background-color: #1f6feb !important;
  color: white !important;
}

.dropdown-menu hr {
  margin: 0.25rem 0 !important;
  border: none !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.login-btn {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  padding: 0.5rem 1rem !important;
  background: #1f6feb !important;
  color: white !important;
  border: none !important;
  border-radius: 0.375rem !important;
  cursor: pointer !important;
  transition: background-color 0.2s !important;
  font-weight: 500 !important;
}

.login-btn:hover {
  background: #388bfd !important;
}

/* Hide elements by default */
.hidden {
  display: none !important;
}

/* Ensure dropdown menu respects hidden state */
.dropdown-menu.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Search Bar Styles */
.search-bar {
  background-color: #223649 !important;
  border: 1px solid #314d68 !important;
  border-radius: 0.5rem !important;
  padding: 0.5rem 1rem !important;
  padding-left: 2.5rem !important;
  width: 16rem !important;
}

.search-bar:focus {
  outline: none !important;
  border-color: #38a169 !important;
}

/* Player Search Input */
.input {
  width: 100%;
  max-width: 220px;
  height: 45px;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px solid hsla(271, 100%, 70%, 0.3);
  outline: none;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: 0px 0px 20px -18px;
  background: hsla(271, 100%, 15%, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  font-size: 14px;
}

.input::placeholder {
  color: #90adcb;
  opacity: 0.8;
}

.input:hover {
  border: 2px solid hsla(271, 100%, 70%, 0.5);
  box-shadow: 0px 0px 20px -17px rgba(139, 92, 246, 0.3);
}

.input:active {
  transform: scale(0.95);
}

.input:focus {
  border: 2px solid white;
  box-shadow: 0px 0px 20px -10px rgba(255, 255, 255, 0.4);
}

/* ====== CALENDAR STYLES (Scrims Page) ====== */
.calendar-contain {
  position: relative;
  width: 100%;
  max-width: 1200px;
  min-width: 320px;
  margin: 0 auto;
  background: hsla(271, 100%, 15%, 0.25) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-radius: 1rem !important;
  overflow: hidden;
  color: white;
  border: 2px solid hsla(271, 100%, 70%, 0.4) !important;
}

.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: hsla(271, 100%, 15%, 0.4) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid hsla(271, 100%, 70%, 0.2);
}

.month-year-display {
  flex: 1;
  text-align: center;
}

.month-year-display span {
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
}

.month-nav-left,
.month-nav-right {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid hsla(271, 100%, 70%, 0.3);
  background: hsla(271, 100%, 15%, 0.3);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  opacity: 1;
}

.month-nav-left:hover,
.month-nav-right:hover {
  background: hsla(271, 100%, 50%, 0.2);
  color: #8b5cf6;
  transform: translateY(-1px);
  border-color: hsla(271, 100%, 70%, 0.5);
}

.month-nav-left {
  margin-right: 1rem;
}

.month-nav-right {
  margin-left: 1rem;
}

.calendar__sidebar {
  width: 100%;
  background: hsla(271, 100%, 15%, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding-bottom: 0.7rem;
}

@media (min-width: 55em) {
  .calendar__sidebar {
    position: absolute;
    inset: 0 auto 0 0;
    width: 35%;
    top: 120px; /* Increased from 60px to account for title bar + nav + toolbar */
  }
}

.sidebar__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 1rem;
  background: hsla(271, 100%, 15%, 0.3);
  border-bottom: 1px solid hsla(271, 100%, 70%, 0.2);
}

.sidebar__heading {
  font-size: 1.4rem;
  font-weight: 700;
  padding: 0 1rem;
  margin: 1rem 0;
  color: white;
  text-align: center;
}

.sidebar__list {
  list-style: none;
  margin: 0;
  padding: 0 1rem 1rem;
}

.sidebar__list-item {
  margin: 0.7rem 0;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.list-item__time {
  display: inline-block;
  width: 62px;
  color: #90adcb;
  font-size: 0.85rem;
  font-weight: 500;
  flex-shrink: 0;
}

.sidebar__empty {
  opacity: 0.6;
  padding: 0 1rem 1rem;
  color: #90adcb;
}

.calendar__days {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 520px;
  padding: 0.8rem 1rem 1rem;
  background: hsla(271, 100%, 15%, 0.1);
}

@media (min-width: 55em) {
  .calendar__days {
    margin-left: 35%;
  }
}

.calendar__top-bar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.5rem;
}

.top-bar__days {
  text-align: center;
  padding: 0.5rem 0;
  background: hsla(271, 100%, 15%, 0.3);
  border-radius: 8px;
  font-size: 0.9rem;
}

.calendar__week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.calendar__day {
  background: hsla(271, 100%, 15%, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid hsla(271, 100%, 70%, 0.2);
  border-radius: 10px;
  padding: 1rem 0.4rem 0.5rem;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
}

.calendar__day:hover {
  transform: translateY(-2px);
  border-color: hsla(271, 100%, 70%, 0.5);
  background: hsla(271, 100%, 15%, 0.35);
}

.calendar__day.selected {
  border-color: hsla(271, 100%, 70%, 0.7);
  background: hsla(271, 100%, 20%, 0.4);
}

.calendar__day.selected .badge {
  background: #8b5cf6 !important;
  color: white !important;
  z-index: 15 !important;
  border: 2px solid white !important;
}

/* Removed badge styling - calendar days now only show "X events" text */

.calendar__date {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  line-height: 1;
}

.calendar__task {
  font-size: 0.8rem;
  color: #90adcb;
  opacity: 0.9;
}

.calendar__day.inactive .calendar__date,
.calendar__day.inactive .calendar__task {
  color: #555;
  opacity: 0.5;
}

.calendar__day.today .calendar__date {
  color: #8b5cf6;
}

.tier-dots {
  display: flex;
  gap: 4px;
  position: absolute;
  right: 6px;
  top: 6px;
}

.qdot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.tier-algs {
  background: #ff0040;
} /* Red = ALGS */
.tier-tournaments {
  background: #ffd700;
} /* Gold = Tournaments */
.tier-elite {
  background: #00ff88;
} /* Green = Elite Scrims */
.tier-entry {
  background: #00aaff;
} /* Blue = Entry Scrims */
.tier-collegiate {
  background: #ff8800;
} /* Orange = Collegiate */
.tier-creator {
  background: #ffffff;
} /* White = Creator */
.tier-womens {
  background: #ff69b4;
} /* Pink = Womens */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  line-height: 1;
  border: 1px solid hsla(271, 100%, 70%, 0.3);
  background: hsla(271, 100%, 15%, 0.5);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill:hover {
  background: hsla(271, 100%, 15%, 0.7);
  border-color: hsla(271, 100%, 70%, 0.5);
}

.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.pill input[type="checkbox"] {
  margin: 0;
  width: auto;
}

.btn-danger {
  background-color: #ef4444 !important;
  color: white !important;
  border-color: #ef4444 !important;
}

.btn-danger:hover:not(:disabled) {
  background-color: #dc2626 !important;
  transform: translateY(-1px) !important;
}

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  align-items: center;
  justify-content: center;
}

.tier-filter-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 320px;
}

.new-event-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.filter-label {
  font-size: 0.9rem;
  color: #90adcb;
  font-weight: 600;
  white-space: nowrap;
  min-width: 80px;
}

.btn-large {
  padding: 0.75rem 1.5rem !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
}

.role-select {
  background: hsla(271, 100%, 15%, 0.5) !important;
  border: 1px solid hsla(271, 100%, 70%, 0.3) !important;
  color: white !important;
  border-radius: 6px !important;
  padding: 0.25rem 0.5rem !important;
  font-size: 0.85rem !important;
}

.event-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid hsla(271, 100%, 70%, 0.3);
  border-radius: 10px;
  padding: 0.6rem;
  background: hsla(271, 100%, 15%, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
}

.event-item:hover {
  background: hsla(271, 100%, 15%, 0.6);
  border-color: hsla(271, 100%, 70%, 0.5);
  transform: translateX(2px);
}

.event-item h4 {
  margin: 0;
  font-size: 0.9rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.event-item .meta {
  font-size: 0.75rem;
  color: #90adcb;
}

.location-link {
  color: #8b5cf6 !important;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 0.25rem;
  padding: 0.125rem 0.25rem;
  margin: -0.125rem -0.25rem;
}

.location-link:hover {
  color: #a78bfa !important;
  background: hsla(271, 100%, 50%, 0.1);
  text-decoration: underline;
}

.location-link:focus {
  outline: 2px solid #8b5cf6;
  outline-offset: 2px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  z-index: 99999 !important;
  overflow-y: auto;
}

.modal {
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  background: hsla(271, 100%, 15%, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid hsla(271, 100%, 70%, 0.4);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  overflow-y: auto;
  margin: auto;
  position: relative;
  z-index: 100000 !important;
}

.modal h3 {
  margin: 0.2rem 0 1rem;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-grid {
  display: grid;
  gap: 1rem;
}

.modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.modal label {
  font-size: 0.85rem;
  color: #90adcb;
  margin-bottom: 0.25rem;
  display: block;
}

.modal input[type="text"],
.modal input[type="datetime-local"],
.modal textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid hsla(271, 100%, 70%, 0.3);
  border-radius: 8px;
  font: inherit;
  background: hsla(271, 100%, 15%, 0.5);
  color: white;
  transition: all 0.2s ease;
}

/* Modal custom dropdowns now use the same custom dropdown styling as filter dropdowns */

.modal input:focus,
.modal textarea:focus {
  outline: none;
  border-color: hsla(271, 100%, 70%, 0.6);
  background: hsla(271, 100%, 15%, 0.7);
}

/* Modal dropdowns should match datetime input width */
.modal .custom-dropdown {
  width: 100% !important;
}

.modal .custom-dropdown .dropdown-trigger {
  width: 100% !important;
  min-width: auto !important;
}

.modal textarea {
  min-height: 80px;
  resize: vertical;
}

.modal__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-top: 1rem;
  align-items: center;
}

/* Button grouping for modal actions */
.modal__actions #cancelBtn {
  margin-right: auto;
}

.modal__actions #saveBtn {
  margin-left: auto;
}

.modal-role-info {
  background: hsla(271, 100%, 15%, 0.3);
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid hsla(271, 100%, 70%, 0.2);
  margin-top: 0.5rem;
}

.modal-role-info p {
  margin: 0;
  font-size: 0.875rem;
  color: #90adcb;
}

.modal-role-info strong {
  color: white;
}

/* Badge styling removed - no longer using circular badges, only "X events" text */
.badge {
  display: none !important;
}

.role-hint {
  font-size: 0.8rem;
  color: #90adcb;
  padding: 0 1rem 1rem;
}

@media (pointer: coarse) {
  .calendar__day {
    min-height: 110px;
  }
}

/* Event Details Popup */
.event-popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.event-popup {
  background: hsla(271, 100%, 15%, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid hsla(271, 100%, 70%, 0.4);
  border-radius: 1rem;
  padding: 1.5rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  position: relative;
}

.event-popup h3 {
  margin: 0 0 1rem 0;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.event-popup-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #90adcb;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}

.event-popup-close:hover {
  color: white;
  background: hsla(271, 100%, 50%, 0.2);
}

.event-popup-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.event-popup-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.event-popup-label {
  font-size: 0.875rem;
  color: #90adcb;
  font-weight: 500;
}

.event-popup-value {
  color: white;
  font-size: 1rem;
}

.event-popup-time {
  font-size: 1.25rem;
  font-weight: 600;
  color: #8b5cf6;
}

.event-popup-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.event-popup-link {
  color: #8b5cf6 !important;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  background: hsla(271, 100%, 50%, 0.1);
  border: 1px solid hsla(271, 100%, 70%, 0.3);
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.event-popup-link:hover {
  background: hsla(271, 100%, 50%, 0.2);
  border-color: hsla(271, 100%, 70%, 0.5);
  text-decoration: none;
}

.event-popup-description {
  background: hsla(271, 100%, 15%, 0.3);
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid hsla(271, 100%, 70%, 0.2);
  color: #e2e8f0;
  line-height: 1.5;
}

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

/* Advanced Features Styling */
.modal-advanced {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid hsla(271, 100%, 70%, 0.2);
}

.modal-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #e2e8f0;
}

.template-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin-bottom: 0.5rem;
  background: hsla(271, 100%, 20%, 0.1);
  border-radius: 0.5rem;
  border: 1px solid hsla(271, 100%, 70%, 0.2);
}

.template-info h4 {
  margin: 0 0 0.25rem 0;
  font-weight: 600;
  color: #e2e8f0;
}

.template-info p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: #90adcb;
}

.template-actions {
  display: flex;
  gap: 0.5rem;
}

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

.btn-secondary {
  background: hsla(271, 100%, 40%, 0.3);
  color: #e2e8f0;
  border: 1px solid hsla(271, 100%, 70%, 0.3);
}

.btn-secondary:hover {
  background: hsla(271, 100%, 40%, 0.5);
}

/* Multi-select mode styling */
.event-selectable {
  cursor: pointer;
  position: relative;
}

.event-selectable.selected::after {
  content: "✓";
  position: absolute;
  top: 2px;
  right: 2px;
  background: #10b981;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* Modal responsive adjustments */
@media (max-width: 768px) {
  .modal {
    max-width: 95vw;
    margin: 1rem auto;
    padding: 1rem;
  }

  .modal-backdrop {
    padding: 1rem 0.5rem;
  }

  .modal-row {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 600px) {
  .modal {
    max-height: 85vh;
  }

  .modal-backdrop {
    align-items: flex-start;
    padding: 1rem;
  }
}
