/* Modal overlay styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 999;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
  
  .modal-overlay.visible {
    opacity: 1;
  }
  
  /* Modal registration form styles */
  #registration-form-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    max-width: 90%;
    width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    padding: 30px;
    display: none;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
  }
  
  #registration-form-container.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  
  /* Scrollbar styling for the modal */
  #registration-form-container::-webkit-scrollbar {
    width: 8px;
  }
  
  #registration-form-container::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
  }
  
  #registration-form-container::-webkit-scrollbar-thumb {
    background: #e91e63;
    border-radius: 10px;
  }
  
  #registration-form-container::-webkit-scrollbar-thumb:hover {
    background: #d81b60;
  }
  
  /* Close button */
  .modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(233, 30, 99, 0.1);
    border: none;
    color: #e91e63;
    font-size: 24px;
    line-height: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
  }
  
  .modal-close-btn:hover {
    background-color: rgba(233, 30, 99, 0.2);
    transform: rotate(90deg);
  }
  
  /* Form styles */
  .registration-section h3 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f48fb1;
    position: relative;
  }
  
  .registration-section h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: #e91e63;
  }
  
  .registration-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 20px;
  }
  
  .form-group {
    margin-bottom: 15px;
    position: relative;
  }
  
  .form-group:nth-last-child(2) {
    grid-column: span 2;
  }
  
  .form-group:last-child {
    grid-column: span 2;
    text-align: center;
    margin-top: 20px;
  }
  
  .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 15px;
  }
  
  .required-asterisk {
    color: #e91e63;
    font-weight: bold;
  }
  
  .required-fields-note {
    grid-column: span 2;
    text-align: left;
    font-size: 14px;
    color: #666;
    margin: 5px 0 15px;
  }
  
  .form-group input,
  .form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: #fafafa;
  }
  
  .form-group input:focus,
  .form-group textarea:focus {
    outline: none;
    border-color: #e91e63;
    box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
    background-color: #fff;
  }
  
  .form-group input::placeholder,
  .form-group textarea::placeholder {
    color: #aaa;
    opacity: 0.7;
  }
  
  .error-message {
    color: #f44336;
    font-size: 13px;
    margin-top: 5px;
    display: none;
  }
  
  .success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 18px;
    margin: 30px 0;
  }
  
  .submit-button {
    background: linear-gradient(135deg, #e91e63, #f06292);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.2);
    width: 100%;
    max-width: 300px;
  }
  
  .submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 30, 99, 0.3);
    background: linear-gradient(135deg, #d81b60, #e91e63);
  }
  
  .submit-button:active {
    transform: translateY(1px);
  }
  
  /* Make form responsive and mobile-friendly */
  @media (max-width: 768px) {
    #registration-form-container {
      width: 100%;
      max-width: 100%;
      height: 100vh;
      max-height: 100vh;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
      border-radius: 0;
      transform: none;
      padding: 20px;
    }
    
    #registration-form-container.visible {
      transform: none;
    }
    
    .registration-section h3 {
      font-size: 20px;
      margin-top: 30px;
    }
    
    .registration-form {
      grid-template-columns: 1fr;
      grid-gap: 15px;
    }
    
    .form-group:nth-last-child(2),
    .form-group:last-child {
      grid-column: span 1;
    }
    
    .form-group label {
      font-size: 14px;
    }
    
    .form-group input,
    .form-group textarea {
      padding: 12px 14px;
      font-size: 15px;
    }
    
    .submit-button {
      width: 100%;
      margin: 0 auto;
      padding: 14px 20px;
    }
    
    .modal-close-btn {
      top: 10px;
      right: 10px;
    }
    
    /* Fix iOS scroll bug */
    .modal-overlay {
      position: fixed;
      height: 100%;
    }
    
    /* Better tap targets for mobile */
    .form-group input,
    .form-group textarea,
    .submit-button {
      min-height: 48px;
    }
  }
  
  /* Special handling for small mobile screens */
  @media (max-width: 480px) {
    #registration-form-container {
      padding: 15px;
    }
    
    .registration-section h3 {
      font-size: 18px;
      margin-top: 40px;
      margin-bottom: 15px;
    }
    
    .form-group {
      margin-bottom: 12px;
    }
  }
  
  /* Orientation handling for mobile */
  @media (max-height: 600px) and (orientation: landscape) {
    #registration-form-container {
      top: 0;
      transform: translateX(-50%);
      height: 100vh;
    }
    
    #registration-form-container.visible {
      transform: translateX(-50%);
    }
    
    .registration-section h3 {
      margin-top: 40px;
      font-size: 18px;
    }
  }