/* == نافذة منبثقة == */
#aiTestModal {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#aiTestModal .modal-content {
  background: #ffffff;
  width: 90%;
  max-width: 650px;
  padding: 30px 25px;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  font-family: inherit;
  direction: rtl;
  text-align: right;
}

#aiTestModal .modal-content h3,
#aiTestModal .modal-content h4 {
  margin-bottom: 15px;
  font-size: 18px;
}

#aiTestModal .modal-content button.ai-answer-btn {
  margin: 8px 5px;
  padding: 10px 18px;
  border: none;
  background: #0073aa;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
}

#aiTestModal .modal-content button.ai-answer-btn:hover {
  background: #005f8d;
}

#aiTestModal .close-popup {
  position: absolute;
  top: 10px;
  left: 10px;
  font-weight: bold;
  font-size: 18px;
  background: #e53e3e;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 6px 12px;
  cursor: pointer;
}

/* == شبكة عرض الاختبارات == */
.ai-tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 20px 10px;
  box-sizing: border-box;
  direction: rtl;
}

.ai-test-card {
  background: #f9f9f9;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  text-align: right;
}

.ai-test-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.ai-test-card p {
  font-size: 14px;
  margin-bottom: 15px;
  color: #555;
}

.ai-test-card .start-test-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.ai-test-card .start-test-btn:hover {
  background: #c82333;
}
.ai-loading p {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

.dots::after {
    content: '';
    display: inline-block;
    width: 1em;
    animation: dots 1.2s steps(3, end) infinite;
}

@keyframes dots {
    0% { content: ''; }
    33% { content: '.'; }
    66% { content: '..'; }
    100% { content: '...'; }
}

#aiTestModal {
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

.ai-question-header {
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
    color: #444;
}

.ai-question-text {
    font-size: 18px;
    font-weight: bold;
    color: #222;
    margin-bottom: 20px;
    text-align: right;
    direction: rtl;
}

.ai-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-answer-btn {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    background: #f9f9f9;
}

.ai-answer-btn:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.recommended-doctors {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
}

.recommended-doctors li {
    margin: 6px 0;
    padding: 8px 12px;
    background: #f8f9fa;
    border-left: 4px solid #0073aa;
    border-radius: 6px;
    font-size: 15px;
    transition: background 0.2s ease-in-out;
}

.recommended-doctors li:hover {
    background: #eef4fa;
}

.recommended-doctors a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.recommended-doctors i {
    margin-left: 6px;
    color: #0073aa;
}


