/* ==================== صفحه اصلی سناریوها ==================== */
.scenarios-page {
  animation: fadeIn 0.4s ease;
}

.scenarios-header {
  text-align: center;
  margin-bottom: 30px;
}

.scenarios-header h2 {
  font-size: 32px;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
}

.scenarios-header p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
}

/* گرید سناریوها */
.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
  padding: 10px;
}

/* کارت سناریو */
.scenario-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.scenario-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* هدر کارت */
.scenario-header {
  padding: 18px 20px;
  color: white;
}

.scenario-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.scenario-icon {
  font-size: 36px;
}

.scenario-level {
  background: rgba(255, 255, 255, 0.25);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
}

.scenario-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
}

/* محتوای کارت */
.scenario-body {
  padding: 20px;
}

.scenario-context {
  color: #666;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 15px;
}

/* برچسب‌های لغات */
.scenario-vocab-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.vocab-tag {
  background: #f0f0f5;
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 11px;
  color: #4361ee;
  font-weight: 500;
}

.vocab-tag-more {
  background: #e0e0e0;
  color: #666;
}

/* دکمه شروع */
.start-scenario-btn {
  width: 100%;
  background: linear-gradient(135deg, #4361ee, #7209b7);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.start-scenario-btn:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

/* ==================== صفحه جزئیات سناریو ==================== */
.scenario-detail {
  background: white;
  border-radius: 28px;
  padding: 35px;
  max-width: 950px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* هدر جزئیات */
.detail-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 2px solid #eee;
  flex-wrap: wrap;
}

.back-btn {
  background: #f0f0f0;
  border: none;
  padding: 10px 20px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-btn:hover {
  background: #e0e0e0;
  transform: translateX(-3px);
}

.detail-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.detail-icon {
  font-size: 40px;
}

.detail-title-area h2 {
  margin: 0;
  color: #333;
  font-size: 24px;
}

/* باکس اطلاعات موقعیت */
.info-box {
  background: #f8f9fa;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 30px;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.info-label {
  font-weight: 600;
  color: #4361ee;
  min-width: 80px;
}

.info-text {
  color: #555;
}

/* کانتینر دیالوگ */
.dialog-container {
  margin-bottom: 35px;
  max-height: 500px;
  overflow-y: auto;
  border-radius: 20px;
  background: #f8f9fa;
  padding: 20px;
}

/* خطوط دیالوگ */
.dialog-line {
  margin-bottom: 15px;
  padding: 14px 18px;
  border-radius: 18px;
  animation: slideIn 0.3s ease;
}

.dialog-line.user-line {
  background: linear-gradient(135deg, #4361ee, #7209b7);
  color: white;
  text-align: right;
}

.dialog-line.bot-line {
  background: #f0f0f0;
  color: #333;
  text-align: left;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.speaker-name {
  font-weight: 700;
  font-size: 13px;
}

.speak-dialog-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.speak-dialog-btn:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.05);
}

.dialog-text {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 6px;
}

.dialog-translation {
  font-size: 12px;
  opacity: 0.75;
}

/* باکس لغات جدید */
.vocab-box {
  background: #f8f9fa;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 25px;
}

.vocab-box h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 18px;
}

.vocab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.vocab-item {
  background: white;
  padding: 10px 18px;
  border-radius: 50px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
}

.vocab-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.vocab-word {
  font-weight: 700;
  color: #4361ee;
}

.vocab-meaning {
  color: #666;
  font-size: 13px;
}

.speak-vocab-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 5px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.speak-vocab-btn:hover {
  transform: scale(1.1);
  background: #f0f0f0;
}

/* باکس نکات */
.tips-box {
  background: #fff3e0;
  border-radius: 16px;
  padding: 20px;
  border-right: 4px solid #f39c12;
  margin-bottom: 25px;
}

.tips-box h3 {
  margin: 0 0 10px 0;
  color: #e67e22;
  font-size: 18px;
}

.tips-box p {
  margin: 0;
  color: #555;
  line-height: 1.6;
}

/* دکمه تمرین نقش */
.practice-btn {
  width: 100%;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.practice-btn:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

/* ==================== صفحه تمرین نقش (Role Play) ==================== */
.roleplay-container {
  background: white;
  border-radius: 28px;
  padding: 30px;
  max-width: 950px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

.roleplay-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.exit-roleplay-btn {
  background: #f0f0f0;
  border: none;
  padding: 10px 20px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.exit-roleplay-btn:hover {
  background: #e0e0e0;
}

.roleplay-header h2 {
  margin: 0;
  font-size: 22px;
  color: #333;
}

/* باکس اطلاعات تمرین */
.roleplay-info {
  background: #f8f9fa;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 25px;
}

.roleplay-info p {
  margin: 5px 0;
  color: #555;
}

/* پیام‌های تمرین */
.roleplay-messages {
  height: 400px;
  overflow-y: auto;
  background: #f0f0f5;
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
}

.roleplay-messages::-webkit-scrollbar {
  width: 6px;
}

.roleplay-messages::-webkit-scrollbar-track {
  background: #e0e0e0;
  border-radius: 10px;
}

.roleplay-messages::-webkit-scrollbar-thumb {
  background: #4361ee;
  border-radius: 10px;
}

/* پیام ربات */
.bot-message {
  background: white;
  padding: 12px 16px;
  border-radius: 18px;
  margin-bottom: 12px;
  max-width: 85%;
  animation: slideIn 0.2s ease;
}

.bot-message .bot-name {
  font-weight: 700;
  color: #4361ee;
  font-size: 12px;
  margin-bottom: 5px;
}

.bot-message .bot-text {
  font-size: 15px;
  color: #333;
}

.bot-message .bot-translation {
  font-size: 11px;
  color: #888;
  margin-top: 5px;
}

/* پیام کاربر */
.user-message {
  background: linear-gradient(135deg, #4361ee, #7209b7);
  color: white;
  padding: 12px 16px;
  border-radius: 18px;
  margin-bottom: 12px;
  text-align: right;
  max-width: 85%;
  margin-left: auto;
  animation: slideIn 0.2s ease;
}

.user-message .user-name {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 5px;
  opacity: 0.8;
}

.user-message .user-text {
  font-size: 15px;
}

/* پیام اطلاعات */
.info-message {
  text-align: center;
  color: #888;
  padding: 15px;
  font-size: 14px;
}

/* ناحیه ورودی تمرین */
.roleplay-input-area {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
}

.roleplay-input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.roleplay-input:focus {
  outline: none;
  border-color: #4361ee;
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.send-roleplay-btn {
  background: linear-gradient(135deg, #4361ee, #7209b7);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.send-roleplay-btn:hover {
  transform: scale(1.02);
}

.mic-roleplay-btn {
  background: #e67e22;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.mic-roleplay-btn:hover {
  background: #d35400;
  transform: scale(1.02);
}

/* بازخورد تمرین */
.roleplay-feedback {
  text-align: center;
  margin-top: 15px;
}

.roleplay-feedback .success {
  background: #27ae60;
  color: white;
  padding: 12px;
  border-radius: 50px;
  animation: fadeIn 0.3s ease;
}

/* انیمیشن‌ها */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== ریسپانسیو ==================== */
@media (max-width: 768px) {
  .scenarios-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .scenario-detail {
    padding: 20px;
  }

  .detail-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .dialog-line {
    padding: 10px 14px;
  }

  .dialog-text {
    font-size: 14px;
  }

  .roleplay-container {
    padding: 20px;
  }

  .roleplay-messages {
    height: 350px;
  }

  .user-message,
  .bot-message {
    max-width: 95%;
  }

  .roleplay-input-area {
    flex-wrap: wrap;
  }

  .send-roleplay-btn,
  .mic-roleplay-btn {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .scenario-header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .vocab-item {
    width: 100%;
    justify-content: space-between;
  }
}
