/* ==========================================================================
   Modal Workflows CSS
   Custom modal system for member workflow processing
   Updated to match application design system
   ========================================================================== */

/* Modal Overlay - Hidden by default */
.workflow-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* Darker overlay for better contrast */
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.workflow-modal-overlay.show {
  display: flex;
}

/* Modal Container */
.workflow-modal {
  background: white; /* Clean white background like your forms */
  border-radius: 20px; /* Match your container border radius */
  padding: 2.5rem;
  max-width: 450px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.08); /* Match your form shadows */
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px); /* Match your glass morphism */
  animation: modalSlideIn 0.4s ease-out;
  position: relative;
  color: #1a365d; /* Your primary navy color */
  box-sizing: border-box; /* Ensure padding is included in width calculations */
  overflow: hidden; /* Prevent any content from extending beyond borders */
}

/* Wide Modal for Edit Forms with Dropdowns */
.workflow-modal.wide {
  max-width: 800px; /* Much wider for edit forms */
  width: 95%; /* Use more screen space on mobile */
}

/* Add the signature top border gradient */
.workflow-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    #1a365d,
    #2d5a87,
    #4a90a4
  ); /* Your brand gradient */
  border-radius: 20px 20px 0 0;
  z-index: 1;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95); /* Subtler animation */
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Loading Spinner */
.workflow-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(26, 54, 93, 0.2); /* Your navy color with transparency */
  border-top: 4px solid #1a365d; /* Solid navy for spinner */
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 0 10px rgba(26, 54, 93, 0.3));
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Modal Text */
.workflow-modal h4 {
  color: #1a365d; /* Primary navy */
  font-weight: 700;
  margin-bottom: 1rem;
  font-size: 1.4rem;
  background: linear-gradient(
    135deg,
    #1a365d,
    #2d5a87
  ); /* Gradient text like your app */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.workflow-modal p {
  color: #6c757d; /* Muted text color from your forms */
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
}

/* Password Update Specific */
.password-update-modal {
  /* Remove the red gradient, keep clean white design */
  background: white;
}

.password-update-modal .workflow-spinner {
  border-top-color: #1a365d; /* Keep navy spinner */
  filter: drop-shadow(0 0 15px rgba(26, 54, 93, 0.4));
}

/* Progress Bar */
.workflow-progress {
  width: 100%;
  height: 6px;
  background: rgba(26, 54, 93, 0.1); /* Light navy background */
  border-radius: 3px;
  margin: 1.5rem 0;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  /* Ensure it's contained within modal padding */
  max-width: 100%;
  position: relative;
}

.workflow-progress-bar {
  height: 100%;
  background: linear-gradient(
    90deg,
    #1a365d,
    #2d5a87,
    #4a90a4
  ); /* Your brand gradient */
  border-radius: 3px;
  animation: progressSlide 3s ease-in-out forwards;
  box-shadow: 0 0 10px rgba(26, 54, 93, 0.3);
  width: 0%;
  /* Ensure the bar doesn't extend beyond container */
  max-width: 100%;
}

@keyframes progressSlide {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

/* Security Notice */
.workflow-security-notice {
  background: linear-gradient(
    135deg,
    rgba(26, 54, 93, 0.1),
    rgba(45, 90, 135, 0.1)
  ); /* Match your form notices */
  border-left: 4px solid #1a365d; /* Navy accent border */
  border-radius: 0 8px 8px 0; /* Match your notice styling */
  padding: 1.2rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  color: #1a365d; /* Navy text */
  line-height: 1.5;
}

.workflow-security-notice i {
  color: #28a745; /* Success green for security icon */
  margin-right: 0.5rem;
  font-size: 1.2rem;
  filter: drop-shadow(0 0 5px rgba(40, 167, 69, 0.3));
}

.workflow-security-notice strong {
  color: #1a365d; /* Navy for emphasis */
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

@keyframes progressSlide {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

/* Success State Styling */
.workflow-modal .success-icon {
  color: #28a745; /* Success green */
  font-size: 1.2rem;
  margin-right: 0.5rem;
  filter: drop-shadow(0 0 5px rgba(40, 167, 69, 0.3));
}

/* Countdown Timer */
.workflow-countdown {
  font-size: 0.9rem;
  color: #6c757d; /* Muted text */
  margin-top: 1rem;
}

.workflow-countdown strong {
  color: #1a365d; /* Navy for emphasis */
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 576px) {
  .workflow-modal {
    padding: 1.5rem;
    max-width: 350px;
    margin: 1rem;
  }

  .workflow-modal h4 {
    font-size: 1.2rem;
  }

  .workflow-modal p {
    font-size: 0.9rem;
  }

  .workflow-spinner {
    width: 50px;
    height: 50px;
  }

  .workflow-security-notice {
    padding: 1rem;
    font-size: 0.85rem;
  }
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}
