/* Loading animation styles */
#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

#page-loader.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.loader-wrapper {
  text-align: center;
  background-color: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 15px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color, #5142e0);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-wrapper p {
  font-size: 16px;
  color: var(--primary-color, #5142e0);
  font-weight: 600;
  margin: 0;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Optional: Fancy loading animation with logo */
.fancy-loader .spinner {
  position: relative;
  border: none;
  background: #f3f3f3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.fancy-loader .spinner::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--primary-color, #5142e0);
  border-bottom-color: var(--accent-color, #4cc9f0);
  animation: spin 1s linear infinite;
}

.fancy-loader .spinner::after {
  content: "";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  content: "\f121"; /* code icon */
  color: var(--primary-color, #5142e0);
  font-size: 18px;
}

/* Toast notification styles to complement SweetAlert2 */
.custom-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.15);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9998;
  display: flex;
  align-items: center;
  max-width: 350px;
}

.custom-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.custom-toast.success {
  border-left: 4px solid #10b981;
}

.custom-toast.error {
  border-left: 4px solid #ef4444;
}

.custom-toast.info {
  border-left: 4px solid #3b82f6;
}

.custom-toast.warning {
  border-left: 4px solid #f59e0b;
}

.toast-icon {
  margin-right: 15px;
  font-size: 20px;
}

.custom-toast.success .toast-icon {
  color: #10b981;
}

.custom-toast.error .toast-icon {
  color: #ef4444;
}

.custom-toast.info .toast-icon {
  color: #3b82f6;
}

.custom-toast.warning .toast-icon {
  color: #f59e0b;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 2px;
  font-size: 16px;
}

.toast-message {
  font-size: 14px;
  opacity: 0.8;
}

.toast-close {
  color: #9ca3af;
  cursor: pointer;
  padding: 5px;
  margin-left: 10px;
  font-size: 16px;
  transition: color 0.3s ease;
}

.toast-close:hover {
  color: #4b5563;
}

/* Pulse effect for buttons */
.btn-pulse {
  position: relative;
}

.btn-pulse::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: inherit;
  animation: pulse 1.5s infinite;
  z-index: -1;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.2);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}
