/**
 * Navigation & Link Protection System - Modal Popup CSS
 * تصميم النوافذ المنبثقة
 */

/* Modal Overlay */
.nav-prot-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-prot-modal.nav-prot-modal-show {
  opacity: 1;
  visibility: visible;
}

.nav-prot-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

/* Modal Content */
.nav-prot-modal-content {
  position: relative;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  direction: rtl;
  text-align: right;
}

.nav-prot-modal.nav-prot-modal-show .nav-prot-modal-content {
  transform: scale(1);
}

/* Modal Header */
.nav-prot-modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-prot-modal-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.nav-prot-modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.2s ease;
}

.nav-prot-modal-close:hover {
  color: #333;
}

/* Modal Body */
.nav-prot-modal-body {
  padding: 25px;
}

.nav-prot-captcha-container {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-prot-captcha-error {
  margin-top: 15px;
  padding: 12px;
  background-color: #fee;
  border: 1px solid #fcc;
  border-radius: 6px;
  color: #c33;
  font-size: 14px;
  text-align: center;
}

/* Simple Math CAPTCHA */
.nav-prot-simple-math {
  text-align: center;
  width: 100%;
}

.nav-prot-simple-math p {
  margin: 0 0 20px 0;
  font-size: 16px;
  color: #666;
}

.nav-prot-math-question {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 24px;
  margin: 20px 0;
}

.nav-prot-math-number {
  font-weight: bold;
  color: #333;
  font-size: 28px;
  min-width: 40px;
  text-align: center;
}

.nav-prot-math-operator {
  color: #666;
  font-size: 24px;
}

.nav-prot-math-equals {
  color: #666;
  font-size: 24px;
  margin: 0 10px;
}

.nav-prot-math-answer {
  width: 80px;
  height: 45px;
  font-size: 20px;
  text-align: center;
  border: 2px solid #ddd;
  border-radius: 6px;
  padding: 0 10px;
  transition: border-color 0.2s ease;
}

.nav-prot-math-answer:focus {
  outline: none;
  border-color: #2eacce;
}

/* Modal Footer */
.nav-prot-modal-footer {
  padding: 20px 25px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.nav-prot-modal-button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.nav-prot-modal-button.nav-prot-modal-cancel {
  background-color: #f5f5f5;
  color: #666;
}

.nav-prot-modal-button.nav-prot-modal-cancel:hover {
  background-color: #e0e0e0;
}

.nav-prot-modal-button.nav-prot-modal-submit {
  background-color: #2eacce;
  color: #ffffff;
}

.nav-prot-modal-button.nav-prot-modal-submit:hover {
  background-color: #2598b8;
}

.nav-prot-modal-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* reCAPTCHA و hCaptcha */
#nav-prot-recaptcha,
#nav-prot-hcaptcha {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 78px;
}

/* تصميم متجاوب */
@media (max-width: 768px) {
  .nav-prot-modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .nav-prot-modal-header {
    padding: 15px 20px;
  }
  
  .nav-prot-modal-header h3 {
    font-size: 18px;
  }
  
  .nav-prot-modal-body {
    padding: 20px;
  }
  
  .nav-prot-modal-footer {
    padding: 15px 20px;
    flex-direction: column;
  }
  
  .nav-prot-modal-button {
    width: 100%;
  }
  
  .nav-prot-math-question {
    font-size: 20px;
  }
  
  .nav-prot-math-number {
    font-size: 24px;
  }
}

/* دعم LTR */
[dir="ltr"] .nav-prot-modal-content {
  direction: ltr;
  text-align: left;
}

[dir="ltr"] .nav-prot-modal-footer {
  justify-content: flex-start;
}

/* أنيميشن */
@keyframes nav-prot-modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes nav-prot-modal-scale-in {
  from {
    transform: scale(0.9);
  }
  to {
    transform: scale(1);
  }
}
