/* 
 * File: modal.css
 * Author: SEHS4517 - Group 102 - Group No.1 Team
 * Description: CSS for modal dialogs and overlays
 */

/* --- MODAL OVERLAY --- */
.custom-modal-overlay {
  position: fixed;
  z-index: 2100;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInModalOverlay 0.2s;
}

/* --- MODAL CONTAINER --- */
.custom-modal {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.22);
  min-width: 320px;
  max-width: 90vw;
  min-height: 50px;
  max-height: 90vh;
  position: relative;
  animation: popInModal 0.2s;
  display: flex;
  flex-direction: column;
  color: #000;
  overflow: hidden;
}

/* --- MODAL HEADER --- */
.custom-modal-title {
  font-size: 2em;
  font-family: 'Oranienbaum', sans-serif;
  font-weight: bold;
  text-align: center;
  padding: 15px 20px;
  background-color: var(--brand-color-super-light);
  color: #fff;
}

.custom-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  z-index: 1;
  line-height: 1;
  transition: color 0.2s;
}
.custom-modal-close:hover {
  color: var(--accent-color);
}

/* --- MODAL CONTENT --- */
.custom-modal-content {
  font-size: 1em;
  word-break: break-word;
  color: #000;
  padding: 20px;
}

/* --- MODAL BUTTONS --- */
.custom-modal-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  padding: 20px;
  border-top: 1px solid var(--border-color);
}
.custom-modal-buttons .button {
  min-width: 80px;
  width: 50%;
}
.custom-modal-buttons .button.button-submit {
  border-color: var(--brand-color-super-light);
  color: var(--brand-color-super-light);
}
.custom-modal-buttons .button.button-submit:hover {
  background-color: var(--brand-color-super-light);
  color: #fff;
}
.custom-modal-buttons .button.button-cancel {
  border-color: #666;
  color: #666;
}
.custom-modal-buttons .button.button-cancel:hover {
  background-color: #666;
  color: #fff;
}

/* --- MODAL FORM --- */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.modal-form p {
  margin-bottom: 5px;
  color: #666;
}
.modal-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.modal-form-group label {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}
.modal-form-group label .required {
  color: #e74c3c;
}
.modal-form-group input {
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-form-group input:focus {
  outline: none;
  border-color: var(--brand-color-super-light);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}
.modal-form-group input::placeholder {
  color: #aaa;
}

/* --- PAGE LOADING OVERLAY --- */
.page-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.page-loading-overlay.active {
  display: flex;
}
.page-loading-content {
  text-align: center;
  color: #fff;
}
.page-loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}
.page-loading-text {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* --- ANIMATIONS --- */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

@keyframes popInModal {
  from {
    transform: scale(0.85) translateY(30px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}
