/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #0f172a;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  font-weight: bold;
  z-index: 99990;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  transition: 0.3s;
}
.back-to-top:hover { 
  background: white; 
  color: black; 
  transform: translateY(-5px); 
}

/* Modals */
.modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: rgba(15, 23, 42, 0.85); 
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex; justify-content: center; align-items: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
  padding: 20px;
  box-sizing: border-box;
}
.modal.show { opacity: 1; pointer-events: auto; }

/* Modal Pəncərəsi - Elementlər arası ümumi boşluq */
.modal-content {
  background: var(--dark-bg); 
  border: 1px solid rgba(255, 255, 255, 0.1) !important; 
  padding: 35px 30px; 
  border-radius: 16px; 
  max-width: 650px; 
  width: 100%; 
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  text-align: left; 
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
  transform: translateY(-20px); 
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-sizing: border-box;
  margin: auto;
}
.modal.show .modal-content { transform: translateY(0); }

/* Modal Başlıq və Mətn */
.modal-header-content h2,
.modal-content h2 { 
  font-size: 26px; 
  color: #ffffff; 
  margin-bottom: 0; 
}
.modal-header-content p,
.modal-content p { 
  color: var(--text-muted); 
  font-size: 16px; 
  line-height: 1.6; 
  margin: 0; 
}

.close-modal { 
  position: absolute; 
  top: 18px; 
  right: 22px; 
  font-size: 28px; 
  color: var(--text-muted); 
  cursor: pointer; 
  transition: 0.2s;
  background: none;
  border: none;
  z-index: 10;
}
.close-modal:hover { color: #ffffff; }

/* Horizontal Teacher Card */
.teacher-card {
  width: 100%; 
  padding: 22px 25px; 
  border-radius: 14px; 
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12); 
  display: flex; 
  align-items: center; 
  gap: 25px; 
  box-sizing: border-box;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  text-align: left;
}

.teacher-card img { 
  width: 110px; 
  height: 110px; 
  border-radius: 50%; 
  object-fit: cover; 
  border: none; 
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.teacher-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.teacher-card h3 { 
  font-size: 21px; 
  color: #fff; 
  margin: 0; 
  font-weight: 700;
}

.teacher-card p { 
  font-size: 15px; 
  color: var(--text-muted); 
  margin: 0; 
  line-height: 1.4;
}

.teacher-card span { 
  font-size: 14px; 
  color: #ffffff; 
  font-weight: 600; 
}

/* Modal Düyməsi - Mətnlə düymə arasındakı məsafə daha da artırıldı (24px) */
#modalCloseBtn, 
.modal-content .btn-gold { 
  background-color: var(--gold) !important;
  color: #ffffff !important;
  width: 100%;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
  font-size: 17px;
  text-decoration: none;
  display: block;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: opacity 0.3s ease;
  margin-top: 24px; 
}
#modalCloseBtn:hover { opacity: 0.9; }

/* Chatbot */
.chat-toggle { position: fixed; bottom: 80px; right: 20px; background: var(--dark-bg); color: white; width: 55px; height: 55px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 22px; cursor: pointer; z-index: 999999; }
.chatbot { position: fixed; bottom: 150px; right: 20px; width: 320px; height: 420px; background: #fff; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); display: none; flex-direction: column; overflow: hidden; z-index: 999999; }

.chat-header { background: var(--dark-bg); color: #fff; padding: 12px; display: flex; justify-content: space-between; align-items: center; }

.chat-header button {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  transition: all 0.2s ease;
  outline: none;
}

.chat-header button:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(90deg);
}

.chat-body { flex: 1; padding: 10px; overflow-y: auto; }
.chat-input { display: flex; border-top: 1px solid #eee; }
.chat-input input { flex: 1; padding: 10px; border: none; outline: none; }
.chat-input button { background: #F80505; color: #fff; border: none; padding: 10px 15px; cursor: pointer; }
.user-msg { background: #21386f; color: #fff; padding: 10px 14px; border-radius: 15px 15px 0 15px; margin: 8px 0; max-width: 80%; margin-left: auto; width: fit-content; word-wrap: break-word; }
.bot-msg { background: #f3f4f6; color: #333; padding: 10px 14px; border-radius: 15px 15px 15px 0; margin: 8px 0; max-width: 80%; width: fit-content; word-wrap: break-word; border: 1px solid #e5e7eb; }
.quick-messages { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border-top: 1px solid #eee; background: #fafafa; }
.quick-messages button { background: var(--dark-bg); color: white; border: none; padding: 6px 10px; font-size: 12px; border-radius: 20px; cursor: pointer; transition: 0.2s; }

.typing-indicator-box {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  padding: 12px 18px !important;
  width: auto !important;
  max-width: 70px;
}

.typing-indicator-box .dot {
  width: 8px;
  height: 8px;
  background-color: #707e94;
  border-radius: 50%;
  animation: bounceDot 1.4s infinite ease-in-out both;
}

.typing-indicator-box .dot:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator-box .dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0); } 
  40% { transform: scale(1.0); }
}

/* QR Reader */
#qr-reader {
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  background: #0f172a !important;
  padding: 15px !important;
  border-radius: 8px !important;
  text-align: center !important;
  color: #fff !important;
}

#qr-reader button {
  background-color: #F80505 !important;
  color: #ffffff !important;
  border: none !important;
  padding: 10px 18px !important;
  font-weight: bold !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  margin: 10px 0 !important;
  display: inline-block !important;
}

#qr-reader select {
  background: #1e293b !important;
  color: #fff !important;
  padding: 8px !important;
  border: 1px solid #334155 !important;
  border-radius: 6px !important;
  margin-bottom: 10px !important;
}

#qr-reader video {
  width: 100% !important;
  border-radius: 6px !important;
}

/* Mobil tənzimləmələr */
@media (max-width: 600px) {
  .teacher-card {
    flex-direction: column;
    text-align: center;
  }
  .teacher-info {
    align-items: center;
  }
  #modalCloseBtn, 
  .modal-content .btn-gold { 
    width: 100%; 
  }
}
