/* ==================== MODAL SYSTEM ==================== */
/* Global modal components with overlay, header, content, and footer */

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Base Modal */
.modal {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-heavy);
  max-width: 400px;
  width: 90%;
  max-height: 90vh;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

/* Modal Header */
.modal-header {
  background: var(--primary-green);
  color: white;
  padding: 1.5rem 2rem;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h1,
.modal-header h2,
.modal-header h3,
.modal-header h4,
.modal-header h5,
.modal-header h6 {
  color: white !important;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

/* Modal Close Button */
.close-modal {
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.close-modal:hover {
  opacity: 1;
}

/* Modal Content */
.modal-content {
  background: white;
  padding: 2rem;
  max-height: 400px;
  overflow-y: auto;
  flex: 1;
}

/* Modal Footer */
.modal-footer {
  background: white;
  padding: 1.5rem 2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

/* Button spacing override for modal footer */
.modal-footer .btn + .btn {
  margin-top: 0;
}

/* ==================== SPECIFIC MODAL VARIANTS ==================== */

/* Login Modal */
#loginModalOverlay {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#loginModalOverlay .login-modal {
  margin: auto;
  position: relative;
}

/* Profile Modal */
#profileModalOverlay {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#profileModalOverlay .profile-modal {
  margin: auto;
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
  width: 90vw;
  max-width: 450px;
}

#profileModalOverlay .profile-form {
  max-height: none;
}

#profileModalOverlay .container {
  max-height: none !important;
  overflow-y: visible !important;
}

/* ==================== MODAL SCROLLBAR STYLING ==================== */

/* Profile Modal Scrollbar */
#profileModalOverlay .profile-modal::-webkit-scrollbar {
  width: 8px;
}

#profileModalOverlay .profile-modal::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
}

#profileModalOverlay .profile-modal::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

#profileModalOverlay .profile-modal::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}