/**
 * YL Modal Styles
 * 
 * Reusable modal system styles
 * 
 * @package YL Theme
 * @version 1.0.0
 */

/* Modal Overlay */
.yl-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modal Container */
.yl-modal {
  background: white;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
  text-align: center;
}

/* Modal Animation */
@keyframes modalSlideIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Modal Header */
.yl-modal-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center; /* centers the title */
  padding: 20px 20px 0 20px;
  border-bottom: none;
}

.yl-modal-header h3 {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 28px;
  color: #4e4e43;
}

/* Close Button */
.yl-modal-close {
  background: none;
  color: #6c757d;
  padding: 0;
  margin: 0;
  line-height: 1;
  transition: color 0.2s;
  position: absolute;
  right: 16px; /* keep close button always on the right */
  border: none;
  font-size: 18px;
  cursor: pointer;
}

.yl-modal-close:hover {
  color: #4e4e43;
}

/* Modal Content */
.yl-modal-content {
  padding: 0 32px;
}

/* Modal Icon */
.yl-modal-icon {
  margin-bottom: 10px;
}

.yl-modal-icon i {
  font-size: 48px;
  color: #ff9500;
}

/* Modal Title */
.yl-modal-content h3 {
  margin: 0 0 8px 0;
  color: #262626;
}

/* Modal Message */
.yl-modal-content p {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 24px;
  color: #4a5568;
  margin-bottom: 32px;
}

/* Modal Message with HTML support */
.yl-modal-message {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 24px;
  color: #4a5568;
}

.yl-modal-message p {
  margin-bottom: 16px;
}

.yl-modal-message p:last-child {
  margin-bottom: 0;
}

/* Modal Info Box */
.yl-modal-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background-color: #f8f3ed;
}

.yl-modal-info-icon {
  flex-shrink: 0;
}

.yl-modal-info-icon i {
  font-size: 16px;
  color: #ff9500;
}

.yl-modal-info-text {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: #4e4e43;
  text-align: left;
}

/* Modal Actions */
.yl-modal-actions {
  display: flex;
  gap: 12px;
  padding: 32px;
  border-top: none;
  justify-content: center;
}

/* Modal Buttons */
.yl-modal-btn {
  padding: 12px 32px;
  border: none;
  border-radius: 25px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 120px;
}

/* Primary Button */
.yl-modal-btn-primary {
  background-color: #a12a1f;
  color: white;
}

.yl-modal-btn-primary:hover {
  background-color: #8b1f1a;
}

/* Secondary Button */
.yl-modal-btn-secondary {
  background-color: white;
  color: #a12a1f;
  border: 1px solid #a12a1f;
}

.yl-modal-btn-secondary:hover {
  background-color: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 768px) {
  .yl-modal {
    width: 95%;
    margin: 20px;
  }

  .yl-modal-actions {
    flex-direction: row;
  }

  .yl-modal-btn {
    width: 100%;
  }

  .yl-modal-content {
    padding: 0 24px 24px 24px;
    font-size: 13px;
  }

  .yl-modal-actions {
    padding: 0 24px 24px 24px;
  }
}

/* Accessibility */
.yl-modal-overlay:focus {
  outline: none;
}

.yl-modal-btn:focus {
  outline: 2px solid #a12a1f;
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .yl-modal {
    border: 2px solid #000;
  }

  .yl-modal-btn {
    border-width: 2px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .yl-modal {
    animation: none;
  }

  .yl-modal-btn {
    transition: none;
  }
}
