/**
 * Frontend Dashboard - Native Modern Modal & Toast System
 * Clean, lightweight, responsive UI with sleek animations
 */

/* Backdrop Overlay */
.fed-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999999;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

.fed-modal-backdrop.fed-modal-active {
  opacity: 1;
  visibility: visible;
}

/* Modal Card */
.fed-modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 1.5rem; /* 24px */
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.04);
  padding: 2rem 1.75rem 1.75rem;
  text-align: center;
  transform: scale(0.92) translateY(12px);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.fed-modal-backdrop.fed-modal-active .fed-modal-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Close Button */
.fed-modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
  padding: 0;
}

.fed-modal-close-btn:hover {
  color: #334155;
  background-color: #f1f5f9;
}

/* Icon Container */
.fed-modal-icon-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.25rem;
}

.fed-modal-icon {
  width: 68px;
  height: 68px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Animated SVG Elements */
.fed-modal-icon svg {
  width: 48px;
  height: 48px;
  display: block;
}

/* Success Icon */
.fed-modal-icon-success {
  background-color: #ecfdf5;
  color: #10b981;
}

.fed-modal-icon-success .fed-svg-circle {
  stroke: #10b981;
  stroke-width: 3;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: fedStrokeCircle 0.5s ease-out 0.1s forwards;
}

.fed-modal-icon-success .fed-svg-check {
  stroke: #10b981;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: fedStrokeCheck 0.35s ease-out 0.4s forwards;
}

/* Error Icon */
.fed-modal-icon-error {
  background-color: #fff1f2;
  color: #f43f5e;
}

.fed-modal-icon-error .fed-svg-circle {
  stroke: #f43f5e;
  stroke-width: 3;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: fedStrokeCircle 0.5s ease-out 0.1s forwards;
}

.fed-modal-icon-error .fed-svg-x1,
.fed-modal-icon-error .fed-svg-x2 {
  stroke: #f43f5e;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
}

.fed-modal-icon-error .fed-svg-x1 {
  animation: fedStrokeCheck 0.3s ease-out 0.35s forwards;
}

.fed-modal-icon-error .fed-svg-x2 {
  animation: fedStrokeCheck 0.3s ease-out 0.45s forwards;
}

/* Warning Icon */
.fed-modal-icon-warning {
  background-color: #fffbeb;
  color: #f59e0b;
}

.fed-modal-icon-warning .fed-svg-circle {
  stroke: #f59e0b;
  stroke-width: 3;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: fedStrokeCircle 0.5s ease-out 0.1s forwards;
}

.fed-modal-icon-warning .fed-svg-line {
  stroke: #f59e0b;
}

.fed-modal-icon-warning .fed-svg-dot {
  fill: #f59e0b;
}

/* Info Icon */
.fed-modal-icon-info {
  background-color: #f0fdfa;
  color: #0aaaaa;
}

.fed-modal-icon-info .fed-svg-circle {
  stroke: #0aaaaa;
  stroke-width: 3;
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: fedStrokeCircle 0.5s ease-out 0.1s forwards;
}

.fed-modal-icon-info .fed-svg-line {
  stroke: #0aaaaa;
}

.fed-modal-icon-info .fed-svg-dot {
  fill: #0aaaaa;
}

/* Question Icon */
.fed-modal-icon-question {
  background-color: #f8fafc;
  color: #64748b;
}

.fed-modal-icon-question .fed-svg-circle {
  stroke: #64748b;
  stroke-width: 3;
}

/* Keyframes for SVG stroke drawing */
@keyframes fedStrokeCircle {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes fedStrokeCheck {
  to {
    stroke-dashoffset: 0;
  }
}

/* Content Area */
.fed-modal-content {
  margin-bottom: 1.5rem;
}

.fed-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
  margin: 0 0 0.5rem 0;
  word-break: break-word;
}

.fed-modal-text {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #64748b;
  margin: 0;
  word-break: break-word;
}

.fed-modal-text p {
  margin: 0 0 0.5rem 0;
}

.fed-modal-text p:last-child {
  margin-bottom: 0;
}

/* Actions */
.fed-modal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.fed-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  border-radius: 0.75rem; /* 12px */
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  outline: none;
  min-width: 100px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.fed-modal-btn:active {
  transform: scale(0.97);
}

.fed-modal-btn-confirm {
  background-color: #0aaaaa;
  color: #ffffff;
  border-color: #0aaaaa;
}

.fed-modal-btn-confirm:hover {
  background-color: #088b8b;
  border-color: #088b8b;
}

.fed-modal-btn-cancel {
  background-color: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

.fed-modal-btn-cancel:hover {
  background-color: #f1f5f9;
  color: #1e293b;
  border-color: #cbd5e1;
}

/* Timer Progress Bar */
.fed-modal-timer-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #0aaaaa;
  width: 0;
  transition: width linear;
}

/* Toast Container & Toasts */
.fed-toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999999999;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  pointer-events: none;
  max-width: 380px;
  width: 100%;
}

.fed-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: #0f172a;
  color: #ffffff;
  padding: 0.875rem 1.25rem;
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(1.5rem);
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease-out;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.fed-toast.fed-toast-show {
  transform: translateY(0);
  opacity: 1;
}

.fed-toast-icon {
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fed-toast-icon.fed-toast-icon-success {
  color: #34d399;
}

.fed-toast-icon.fed-toast-icon-error {
  color: #fb7185;
}

.fed-toast-icon.fed-toast-icon-warning {
  color: #fbbf24;
}

.fed-toast-icon.fed-toast-icon-info {
  color: #38bdf8;
}

.fed-toast-body {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  color: #f8fafc;
  word-break: break-word;
}

.fed-toast-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.fed-toast-close:hover {
  color: #ffffff;
}
