/**
 * Modal and Overlay Styles
 * Essential styles for modal functionality and blur effects
 * Used by: SignupModal, LoginModal, TeamSelectorModal
 */

/* ========================================
   MODAL OVERLAY SYSTEM
   Single source of truth for all modals
   ======================================== 
   
   USAGE:
   
   1. Show Modal (JavaScript):
      const modal = document.getElementById('your-modal');
      modal.classList.remove('hidden');
      modal.classList.add('flex');
      window.blurManager.enable('your-modal-id');
   
   2. Hide Modal (JavaScript):
      const modal = document.getElementById('your-modal');
      modal.classList.add('hidden');
      modal.classList.remove('flex');
      window.blurManager.disable('your-modal-id');
   
   3. Clear All Blur:
      window.blurManager.clearAll();
   
   FEATURES:
   - 50% black overlay with 8px backdrop blur
   - 4px blur on background content (via blur-active class)
   - Prevents body scrolling
   - Smooth transitions (0.3s)
   - Consistent z-index (9999)
   
   ======================================== */

/* Base overlay - covers entire viewport */
.full-page-overlay {
  /* Positioning */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  
  /* Layout */
  display: none;
  justify-content: center;
  align-items: center;
  
  /* Visual styling */
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  
  /* Transitions */
  transition: backdrop-filter 0.3s ease, opacity 0.3s ease;
  
  /* Reset any potential conflicts */
  margin: 0;
  padding: 0;
}

/* Show overlay */
.full-page-overlay.is-visible {
  display: flex;
}

/* Blur background content when ANY overlay is visible */
body.overlay-visible > *:not(#full-page-overlay):not(#login-modal):not(#team-selector-modal):not(#logged-in-user-warning-modal):not(#club-team-selector-modal):not(.drawer):not(script):not(style),
body.blur-active > *:not(#full-page-overlay):not(#login-modal):not(#team-selector-modal):not(#logged-in-user-warning-modal):not(#club-team-selector-modal):not(.drawer):not(script):not(style) {
  filter: blur(4px);
  transition: filter 0.3s ease;
}

/* Prevent scrolling when overlay is visible */
body.overlay-visible,
body.blur-active {
  overflow: hidden;
}

/* ========================================
   SESSION LOADING STATE
   ======================================== */

.session-loading {
  text-align: center;
  padding: 2rem;
}

.session-loading p {
  font-size: 1.4rem;
  color: #666;
  margin: 0;
}

.team-selector {
  max-height: 400px;
  overflow-y: auto;
}

.team-item {
  transition: all 0.2s;
}

.team-item:hover {
  background: #f5f5f5 !important;
  border-color: #5cb85c !important;
}

/* User navigation styles */
#user-nav-container a {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  text-decoration: none !important;
  color: inherit !important;
}

#user-nav-container img {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
}

#user-nav-container span {
  font-weight: 500 !important;
  font-size: 1.4rem !important;
  color: #333 !important;
}

#user-nav-container a:hover {
  color: #5cb85c !important;
}

#user-nav-container a:hover span {
  color: #5cb85c !important;
}

/* ========================================
   USER WARNING MODALS
   ======================================== */
.logged-in-warning {
  text-align: center;
  max-width: 400px;
  margin: 0 auto;
}

.logged-in-warning .warning-message {
  font-size: 1.6rem;
  color: #333;
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #5cb85c;
}

.logged-in-warning p {
  font-size: 1.4rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  color: #666;
}

.btn-club-settings {
  background: #6c757d;
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
  max-width: 200px;
}

.btn-club-settings:hover {
  background: #5a6268;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #ddd;
}

.btn-cancel,
.btn-continue {
  flex: 1;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.btn-cancel {
  background: #6c757d;
  color: white;
}

.btn-cancel:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

.btn-continue {
  background: #5cb85c;
  color: white;
}

.btn-continue:hover {
  background: #4cae4c;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(92, 184, 92, 0.3);
}

