/* Common AI Tutor Styles */
:root {
  --header-height: 5.56rem;
}

.writing-padding {
  padding: 0.75rem 1rem;
}

.hide-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.p-disabled {
  pointer-events: all !important;
  cursor: not-allowed !important;
}

.aspect-square {
  aspect-ratio: 1/1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hight-index {
  z-index: 100000 !important;
}

.ai-container {
  height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
}

.generate-btn {
  background: var(--primary-primary-default) !important;
  border: none !important;
  border-radius: var(--border-radius-32) !important;
  padding: 1rem 2rem !important;
  font-weight: 600 !important;
  font-size: 1rem !important;
  color: var(--text-white-txt) !important;
  transition: all 0.3s ease !important;
  width: fit-content;
  margin-bottom: 1rem;
}

.generate-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 0.75rem 1.5rem rgba(249, 115, 22, 0.4) !important;
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%) !important;
}

.generate-btn:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Header Ai */
.custom-menubar-placeholder {
  height: 8.56rem;
}

@keyframes keduall-header-animation {
  from {
    opacity: 0;
    transform: translate(0px, -150px);
  }

  to {
    opacity: 1;
    transform: translate(0px, 0px);
  }
}

#header-ai .custom-menubar-placeholder {
  height: var(--header-height);
}

#header-ai .header-logo {
  width: 142px;
}

#header-ai .top-header {
  background: unset;
}

#header-ai .custom-menubar {
  & .top-header {
    .button-link {
      color: var(--text-default-txt);
      border-bottom: 0.125rem solid var(--text-default-txt);
    }
  }
}

.custom-menubar-dropdown-hold-position {
  top: 3.5rem !important;
}

#header-ai .custom-menubar {
  & .top-header {
    & .notification-badge::before {
      color: #000000;
    }
  }
}

#header-ai .nav-menu {
  gap: 3rem;
}

#header-ai .custom-menubar {

  .top-header {
    .header-dropdown {
      svg {
        width: 0.5rem;
        color: var(--text-default-txt);
      }
    }

    .button-link {
      color: var(--text-default-txt);
      border-bottom: 0.125rem solid var(--text-default-txt);
    }

    .notification-badge::before {
      color: var(--text-default-txt);
    }

    .dropdown-link {
      i {
        color: var(--text-default-txt);
      }
    }

  }
}

@media (max-width: 768px) {
  #header-ai .custom-menubar-placeholder {
    height: 8.56rem;
  }

  #header-ai .top-header {
    background: var(--primary-primary-default);
    width: 100%;
  }

  #header-ai .custom-menubar {
    & .top-header {
      & .notification-badge::before {
        color: #ffffff;
      }
    }
  }

  #header-ai .custom-menubar {
    & .top-header {
      .button-link {
        color: var(--text-white-txt);
        border-bottom: 0.125rem solid var(--text-white-txt);
      }
    }
  }


  #header-ai .custom-menubar {

    .top-header {
      .header-dropdown {
        svg {
          width: 0.5rem;
          color: var(--text-white-txt);
        }
      }

      .button-link {
        color: var(--text-white-txt);
        border-bottom: 0.125rem solid var(--text-white-txt);
      }

      .notification-badge::before {
        color: var(--text-white-txt);
      }

      .dropdown-link {
        i {
          color: var(--text-white-txt);
        }
      }

      >div>a {
        color: var(--text-white-txt);
      }
    }

  }

}

@media (max-width: 1250px) {
  .nav-menu {
    display: none;
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}


/* Container main */
.ai-tutor-container {
  max-width: 1450px;
  margin: 0 auto;
  padding: 2rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* Hero section */
.hero-section {
  text-align: center;
  margin-bottom: 4rem;
}

.hero-section .main-title {
  font-size: 3rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1rem;
}

.hero-section .subtitle {
  font-size: 1.25rem;
  color: #6b7280;
  max-width: 600px;
  margin: 0 auto;
}

/* Tools section */
.tools-section {
  margin-bottom: 4rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.tool-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  border-color: #3b82f6;
}

.tool-card .tool-icon {
  margin-bottom: 1.5rem;
}

.tool-card h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 1rem;
}

.tool-card p {
  color: #6b7280;
  line-height: 1.6;
}

/* Featured section */
.featured-section {
  text-align: center;
}

.featured-section .section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1rem;
}

.featured-section .section-subtitle {
  font-size: 1.125rem;
  color: #6b7280;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
}

.featured-card {
  border-radius: 1.5rem;
  padding: 3rem 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.featured-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.roleplay-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.topik-card {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.featured-content {
  text-align: center;
}

.featured-icon {
  margin-bottom: 2rem;
}

.featured-card h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.featured-card p {
  font-size: 1.125rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.cta-button {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.cta-button:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
  .ai-tutor-container {
    padding: 1rem;
  }

  .hero-section .main-title {
    font-size: 2rem;
  }

  .hero-section .subtitle {
    font-size: 1.125rem;
  }

  .tools-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .featured-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .featured-card {
    padding: 2rem 1.5rem;
  }

  .featured-section .section-title {
    font-size: 2rem;
  }
}

/* Animate.css customizations */
.animate__delay-1s {
  animation-delay: 1s;
}

.animate__delay-2s {
  animation-delay: 2s;
}

/* Hover effects with animate.css */
.tool-card:hover .animate__pulse {
  animation: pulse 1s infinite;
}

.featured-card:hover .animate__pulse {
  animation: pulse 1s infinite;
}

/* AI Learning Planner Styles */
.ai-learning-planner-section {
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(100vh - var(--header-height));
}

/* Learning Planner Chat interface */
.learning-planner-chat-container {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.learning-planner-chat-container .chat-title h3 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.2rem;
  font-weight: 600;
}

.learning-planner-chat-container .chat-title p {
  margin: 0.25rem 0 0 0;
  color: #6c757d;
  font-size: 0.9rem;
}

.learning-planner-chat-container .back-button {
  background: #6c757d;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background-color 0.2s;
}

.learning-planner-chat-container .back-button:hover {
  background: #5a6268;
}

.learning-planner-chat {
  height: 85vh;
  display: flex;
  flex-direction: column;
}

.chat-header {
  background: white;
  padding: 16px 20px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.back-button {
  background: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.back-button:hover {
  background: #5a6268;
}

.chat-header h2 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.4rem;
  font-weight: 600;
}

/* Import MessageTemplates styles */

/* Welcome Hero Styles */
.welcome-hero {
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  border-radius: 1.5rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1);
  padding: 3rem 2rem;
  margin: 0 auto;
  max-width: 45rem;
  text-align: center;
  transition: all 0.3s ease;
}

.welcome-hero:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.15);
}

.welcome-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--orange-color);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.welcome-description {
  font-size: 1.125rem;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.welcome-cta {
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 2rem;
}

.start-button {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border: none;
  border-radius: 0.75rem;
  padding: 1rem 2rem;
  color: white;
  font-weight: 600;
  font-size: 1.125rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0.5rem 1rem rgba(249, 115, 22, 0.3);
}

.start-button:hover {
  transform: translateY(-0.125rem);
  box-shadow: 0 0.75rem 1.5rem rgba(249, 115, 22, 0.4);
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
}

/* History List Styles */
.user-plans-section {
  max-width: 45rem;
  margin: 2rem auto;
}

.plans-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.plans-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #374151;
}

.plans-list {
  display: grid;
  gap: 0.75rem;
}

.plan-item {
  background: white;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.plan-item:hover {
  transform: translateY(-0.125rem);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.plan-summary {
  font-size: 0.875rem;
  color: #374151;
  margin-bottom: 0.25rem;
}

.plan-date {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Form Container Styles */
.learning-planner-container {
  max-width: 45rem;
  margin: 0 auto;
  background: white;
  border-radius: 1.5rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Form Header */
.form-header {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  padding: 2rem;
  text-align: center;
  color: white;
}

.form-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

/* Form Styles */
.planner-form {
  padding: 2rem;
}

.planner-form .form-actions {
  display: flex;
  justify-content: flex-end;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group.full-width {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.375rem;
}

.form-field {
  position: relative;
}

/* Pill Group Styles */
.pill-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.375rem;
  margin-top: 0.375rem;
}

.pill-button {
  padding: 0.5rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 2rem;
  background: white;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-button:hover {
  border-color: var(--orange-color);
  color: var(--orange-color);
}

.pill-button.active {
  border-color: var(--orange-color);
  background: var(--orange-color);
  color: white;
}

/* Button Styles */
.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.back-button {
  background: white;
  border: 2px solid #e5e7eb;
  color: #6b7280;
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.back-button:hover:not(:disabled) {
  border-color: #9ca3af;
  color: #374151;
}

.back-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.generate-plan-btn {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  border: none;
  color: white;
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.generate-plan-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
  transform: translateY(-0.125rem);
}

.generate-plan-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Result Section Styles */
.result-container {
  max-width: 45rem;
  margin: 0 auto;
  background: white;
  border-radius: 1.5rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: slideIn 0.5s ease-out;
}

.result-header {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  padding: 2rem;
  text-align: center;
  color: white;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.streaming-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  opacity: 0.9;
}

.result-content {
  padding: 2rem;
}

.plan-text {
  font-size: 1rem;
  line-height: 1.6;
  color: #374151;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.cursor-blink {
  animation: blink 1s infinite;
}

@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

.result-actions {
  padding: 1.5rem 2rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.result-button {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.new-plan-button {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
}

.new-plan-button:hover {
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
  transform: translateY(-0.125rem);
}

.back-to-welcome-button {
  background: white;
  border: 2px solid #e5e7eb;
  color: #6b7280;
}

.back-to-welcome-button:hover {
  border-color: #9ca3af;
  color: #374151;
}

.start-chat-button {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  order: -1;
  /* Đặt nút này lên đầu */
}

.start-chat-button:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-0.125rem);
  box-shadow: 0 0.5rem 1rem rgba(16, 185, 129, 0.3);
}

/* Loading Indicator */
.loading-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6b7280;
  font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .ai-learning-planner-section {
    padding: 1rem 0.5rem;
  }

  .welcome-hero {
    padding: 2rem 1.5rem;
  }

  .welcome-title {
    font-size: 1.5rem;
  }

  .welcome-description {
    font-size: 1rem;
  }

  .learning-planner-container,
  .result-container {
    margin: 0 0.5rem;
  }

  .planner-form {
    padding: 1.5rem;
  }

  .result-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .start-chat-button {
    order: 0;
    /* Reset order on mobile */
  }

  .pill-group {
    gap: 0.25rem;
  }

  .pill-button {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }
}

/* Confirmation Page Styles */
.confirmation-container {
  max-width: 45rem;
  margin: 0 auto;
  background: white;
  border-radius: 1.5rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: slideIn 0.5s ease-out;
}

.confirmation-header {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  padding: 2rem;
  text-align: center;
  color: white;
}

.confirmation-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.confirmation-subtitle {
  font-size: 1rem;
  margin: 0;
  opacity: 0.9;
}

.confirmation-content {
  padding: 2rem;
}

.review-section {
  background: #f8fafc;
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid #e2e8f0;
}

.review-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #374151;
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.info-item {
  background: white;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-size: 1rem;
  font-weight: 500;
  color: #111827;
}

.skills-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.skill-group {
  background: white;
  padding: 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
}

.skill-group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  color: #374151;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  padding: 0.375rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.skill-tag.strong {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.skill-tag.weak {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.no-selection {
  color: #9ca3af;
  font-style: italic;
  font-size: 0.875rem;
}

.confirmation-actions {
  padding: 1.5rem 2rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.confirmation-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.back-button {
  background: white;
  border: 2px solid #e5e7eb;
  color: #6b7280;
}

.back-button:hover:not(:disabled) {
  border-color: #9ca3af;
  color: #374151;
}

.back-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.confirm-button {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  border: none;
}

.confirm-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
  transform: translateY(-0.125rem);
}

.confirm-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Mobile Responsive for Confirmation */
@media (max-width: 768px) {
  .confirmation-container {
    margin: 0 0.5rem;
  }

  .confirmation-content {
    padding: 1.5rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .skills-section {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .confirmation-actions {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .skill-tags {
    gap: 0.375rem;
  }
}

/* Updated PlannerForm Styles - Figma Design */
.planner-form-wrapper {
  max-width: 45rem;
  margin: 0 auto;
}

.planner-form-header-text {
  text-align: center;
  margin-bottom: 2rem;
}

.planner-form-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #374151;
  margin: 0 0 0.75rem 0;
  line-height: 1.2;
}

.planner-form-subtitle {
  font-size: 1rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

.planner-form-container {
  background: white;
  border: 1px solid var(--forms-third-border);
  border-radius: 1.5rem;
  box-shadow: 0px 20px 40px -15px #B545151A;
  overflow: hidden;
  animation: slideIn 0.5s ease-out;
}

.planner-form {
  padding: 2rem;
}

.form-fields-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: start;
}

.form-row.full-width {
  grid-template-columns: 1fr;
}

.form-field-group {
  display: grid;
  grid-template-columns: 1fr 3fr;
  width: 100%;
}

.form-label {
  display: block;
  font-size: 1rem;
  font-weight: var(--font-weight-regular);
  color: var(--text-dark-txt);
  margin-bottom: 0.5rem;
}

.form-dropdown {
  width: 100%;
}

.form-dropdown .p-dropdown {
  width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.form-dropdown .p-dropdown:hover {
  border-color: var(--orange-color);
}

.form-dropdown .p-dropdown.p-focus {
  border-color: var(--orange-color);
  box-shadow: 0 0 0 0.2rem rgba(249, 115, 22, 0.2);
}

.pill-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.pill-button {
  padding: 0.5rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 2rem;
  background: white;
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 4rem;
  text-align: center;
}

.pill-button:hover {
  border-color: var(--orange-color);
  color: var(--orange-color);
  transform: translateY(-0.125rem);
}

.pill-button.active {
  border-color: var(--orange-color);
  background: var(--orange-color);
  color: white;
  box-shadow: 0 0.25rem 0.5rem rgba(249, 115, 22, 0.3);
}

.back-button {
  background: white;
  border: 2px solid #e5e7eb;
  color: #6b7280;
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.back-button:hover:not(:disabled) {
  border-color: #9ca3af;
  color: #374151;
  transform: translateY(-0.125rem);
}

.back-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.next-button {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
  border: none !important;
  color: white !important;
  border-radius: 0.5rem !important;
  padding: 0.75rem 1.5rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  box-shadow: 0 0.25rem 0.5rem rgba(249, 115, 22, 0.3) !important;
}

.next-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%) !important;
  transform: translateY(-0.125rem) !important;
  box-shadow: 0 0.5rem 1rem rgba(249, 115, 22, 0.4) !important;
}

.next-button:disabled {
  opacity: 0.7 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Mobile Responsive for Updated Form */
@media (max-width: 768px) {
  .planner-form-wrapper {
    padding: 1rem 0.5rem;
  }

  .planner-form-header-text {
    margin-bottom: 1.5rem;
  }

  .planner-form-title {
    font-size: 1.5rem;
  }

  .planner-form-subtitle {
    font-size: 0.875rem;
  }

  .planner-form {
    padding: 1.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-fields-container {
    gap: 1rem;
  }

  .form-actions {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .pill-group {
    gap: 0.375rem;
  }

  .pill-button {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    min-width: 3.5rem;
  }
}

/* ===== AI ROLEPLAY MAIN COMPONENT ===== */
.ai-roleplay {
  height: calc(100vh - var(--header-height));
  display: block;
  overflow-y: auto;
}

.roleplay-form-container {
  min-width: 45rem;
  margin: 0 auto;
}

.roleplay-form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.roleplay-form-header h2 {
  font-size: 2rem;
  font-weight: bold;
  color: #1f2937;
  margin-bottom: 12px;
}

.roleplay-form-header p {
  font-size: 1.1rem;
  color: #6b7280;
}

.roleplay-form {
  background: #ffffff;
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid #EEEEEE;
}

.roleplay-form .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 24px;
}

.roleplay-form .form-group {
  height: 100%;
  display: flex;
  flex-direction: column;
  margin-bottom: 0px;
}

.roleplay-form .form-group.full {
  grid-column: 1 / -1;
}

.level-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex: auto;
}

.level-btn {
  padding: 10px 18px;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
  cursor: pointer;
}

.level-btn.active {
  background: #FFFCF9;
  color: var(--primary-primary-default);
  border: 1px solid var(--primary-primary-default);
}

.roleplay-form .form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  justify-content: space-between;
  margin-top: 8px;
}

.roleplay-chat-container .chat-form-container {
  border-top: 1px dashed #e5e7eb;
  margin-top: 16px;
  padding-top: 16px;
}

.scenario-items {
  display: flex;
  gap: 16px;
}

/* CARD */
.scenario-item {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: var(--border-radius-8);
  overflow: hidden;
  cursor: pointer;
  background: var(--primary-primary-default);
  transition: transform .3s ease;
  will-change: transform;
}

.scenario-item:hover {
  transform: scale(1.05);
}

.scenario-item::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  background: linear-gradient(to top,
      rgba(0, 0, 0, .7) 0%,
      rgba(0, 0, 0, 0) 62.83%);
  z-index: 1;
  pointer-events: none;
}

.scenario-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scenario-item .text {
  position: absolute;
  bottom: 10px;
  left: 10px;
  color: #fff;
  font-size: var(--font-size-14);
  text-shadow: 0 2px 4px rgba(0, 0, 0, .6);
  z-index: 2;
}

.scenario-item.active {
  box-shadow: 0 0 0 3px var(--buttons-primary);
}

.scenario-item.active::after {
  content: "✔";
  position: absolute;
  top: -2px;
  right: -2px;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--buttons-primary);
  color: #fff;
  font-size: var(--font-size-14);
  border-bottom-left-radius: calc(var(--border-radius-8) - 3px);
  z-index: 3;
  pointer-events: none;
}

.roleplay-accordion-item .p-accordion-header-link {
  display: flex;
  flex-direction: row-reverse;
}

.roleplay-accordion-item .p-accordion-toggle-icon {
  color: var(--text-ai-secondary-txt);
}

/* AI TOPIK Generation Styles */
.ai-topik-generation {
  height: calc(100vh - var(--header-height));
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Error Message */
.error-message {
  position: fixed;
  top: 1.25rem;
  right: 20px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
}

.error-message button {
  background: #dc2626;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
}

.error-message button:hover {
  background: #b91c1c;
}

/* Form Container */
.topik-form-container {
  max-width: 45rem;
  width: 100%;
  margin: 0 auto;
}

.topik-form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.topik-form-header h2 {
  font-size: 2rem;
  font-weight: bold;
  color: #1f2937;
  margin-bottom: 12px;
}

.topik-form-header p {
  font-size: 1.1rem;
  color: #6b7280;
}

.topik-form {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid #EEEEEE;
  margin-bottom: 1rem;
}

.topik-form .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.topik-form .form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 0px;
}

.form-group label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.form-select,
.form-input {
  padding: 8px 12px;
  border: 1px solid var(--forms-third-border);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-select:focus,
.form-input:focus {
  outline: none;
  border-color: #f7941d;
  box-shadow: 0 0 0 3px rgba(247, 148, 29, 0.1);
}

.form-input {
  width: 100%;
}

.topik-form .form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
}

.generate-button {
  background: #f7941d;
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 100px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: var(--font-size-14);
}

.generate-button:hover:not(:disabled) {
  background: #e8851a;
}

.generate-button:disabled {
  background: #EEEEEE;
  color: #9E9E9E;
  cursor: not-allowed;
}

.random-button {
  background: var(--white-color);
  border: 1px solid var(--buttons-primary);
  color: #424242;
  font-size: var(--font-size-14);
}

.random-button:hover:not(:disabled) {
  background: var(--white-color);
  border: 1px solid var(--buttons-primary);
  color: #424242;
}

/* Chat Container */
.topik-chat-container {
  display: flex;
  margin: 0 auto;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  width: 100%;
}

.chat-header {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.back-button {
  background: #f7941d;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 1rem;
  font-weight: 500;
}

.back-button:hover {
  background: #e8851a;
}

.chat-header h3 {
  margin: 0;
  color: #1f2937;
  font-size: 1rem;
}

.ai-message {
  line-height: 1.6;
}

.passage {
  font-size: 1rem;
  line-height: 1.5rem;
  color: #828282;
}

.passage u {
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* Main Question */
.topik-title-section {
  display: flex;
  gap: 8px;
  align-items: center;
}

.topik-question-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-chip {
  background: #E0E0E0;
  color: #424242;
  padding: 2px 10px;
  height: fit-content;
  border-radius: 16px;
  font-size: var(--font-size-14);
}

.save-library-button {
  background: none;
  color: var(--text-default-text);
  border: 1px solid #BDBDBD;
  padding: 6px 12px;
  border-radius: 0.5rem;
  font-size: var(--font-size-14);
  width: fit-content;
  margin-left: auto;
}

.saved-button {
  background: var(--buttons-system-active);
  color: var(--surfaces-body-bg);
}

.main-question {
  font-weight: 600;
  color: #1f2937;
  margin: 16px 0 12px 0;
  font-size: 1.1rem;
}

.main-question u {
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.question-option {
  padding: 8px 12px;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  gap: 8px;
  align-items: center;
}

.correct {
  color: #4CAF50;
}

.incorrect {
  color: #F44336;
}

.question-option:hover {
  font-weight: 600;
  color: #555555;
}

.regular-text {
  margin: 8px 0;
}

.answer-button {
  padding: 8px 12px;
  border: none;
  width: 100%;
  opacity: 0.3;
  border-radius: 100px;
  background: var(--buttons-primary);
  font-size: var(--font-size-14);
}

.answer-button.active {
  opacity: 1;
}

.message-time {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 4px;
  text-align: right;
}

.message.ai .message-time {
  text-align: left;
}

.chat-input-container {
  padding: 16px 24px;
  background: white;
  border-top: 1px solid #e5e7eb;
}

.chat-input-wrapper {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 0.5rem;
  resize: none;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
  max-height: 120px;
}

.chat-input:focus {
  outline: none;
  border-color: #f7941d;
  box-shadow: 0 0 0 3px rgba(247, 148, 29, 0.1);
}

.send-button.p-button {
  background: var(--primary-primary-default);
  border-radius: 100px;
  color: var(--text-white-txt);
  border: none;
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  white-space: nowrap;
}

.send-button.p-button.p-disabled {
  color: var(--text-ai-secondary-txt);
}

.send-button:hover:not(:disabled) {
  background: #e8851a;
}

.send-button.p-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #d1d5db;
}

/* Responsive Design */
@media (max-width: 768px) {
  .topik-form-container {
    padding: 20px 16px;
  }

  .topik-form {
    padding: 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .chat-messages {
    padding: 16px;
  }

  .message {
    max-width: 90%;
  }

  .chat-input-container {
    padding: 12px 16px;
  }
}

/* AI Vocabulary Expansion Styles */
/* AI Vocabulary Expansion Styles */
.ai-vocabulary {
  height: 100%;
  max-height: calc(100vh - var(--header-height));
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Error Message */
.error-message {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
}

.error-message button {
  background: #dc2626;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
}

.error-message button:hover {
  background: #b91c1c;
}

/* Welcome Container */
.vocabulary-welcome-container {
  display: flex;
  width: 100%;
  max-width: 45rem;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.welcome-content {
  text-align: center;
  width: 100%;
}

.welcome-content h1 {
  font-size: 2.5rem;
  font-weight: bold;
  color: #1f2937;
  margin-bottom: 16px;
}

.welcome-content p {
  font-size: 1.2rem;
  color: #6b7280;
  margin-bottom: 40px;
}

.welcome-form {
  width: 100%;
}

.input-wrapper {
  position: relative;
  width: 100%;
}

.welcome-input {
  width: 100%;
  padding: 20px 60px 20px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 1.1rem;
  background: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
}

.welcome-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.welcome-input:disabled {
  background: #f3f4f6;
  cursor: not-allowed;
}

/* Chat Container */
.vocabulary-chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

/* Form chat ở dưới */

.chat-input-container {
  padding: 0;
}

.chat-input-form {
  width: 100%;
}

.chat-input {
  width: 100%;
  padding: 12px 50px 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 1rem;
  background: white;
}

.chat-input:focus {
  outline: none;
  border-color: #3b82f6;
}

/* Vocabulary specific styles */
.vocabulary-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin: 12px 0;
  transition: all 0.2s;
}

.vocabulary-item:hover {
  background: #f1f5f9;
  border-color: #3b82f6;
}

.vocabulary-word {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
}

.vocabulary-meaning {
  color: #64748b;
  margin-bottom: 8px;
}

.vocabulary-example {
  font-style: italic;
  color: #475569;
  font-size: 0.9rem;
}

.vocabulary-level {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 8px;
}

.vocabulary-level.beginner {
  background: #dcfce7;
  color: #166534;
}

.vocabulary-level.intermediate {
  background: #fef3c7;
  color: #92400e;
}

.vocabulary-level.advanced {
  background: #fecaca;
  color: #991b1b;
}

/* Responsive Design */
@media (max-width: 768px) {
  .vocabulary-form-container {
    padding: 20px 16px;
  }

  .vocabulary-form {
    padding: 24px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .chat-form-container {
    padding: 16px;
  }
}


/* AI English Chatbot Styles */
.ai-english-chatbot-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  background: linear-gradient(135deg, var(--primary-primary-0) 0%, var(--primary-primary-1) 100%);
  min-height: 100vh;
}

.chatbot-container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Header Styles */
.chatbot-header {
  background: linear-gradient(135deg, var(--primary-primary-default) 0%, var(--primary-primary-4) 100%);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ai-avatar {
  position: relative;
}

.avatar-circle {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  backdrop-filter: blur(10px);
}

.status-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
}

.status-indicator.online {
  background: var(--green-500);
}

.header-info h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.status-text {
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.9;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mode-selector .mode-dropdown {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 0.875rem;
  backdrop-filter: blur(10px);
}

.mode-selector .mode-dropdown .p-dropdown-label {
  color: white;
  font-size: 0.875rem;
}

.mode-selector .mode-dropdown .p-dropdown-trigger {
  color: white;
}

.reset-button.p-button {
  background: rgba(255, 255, 255, 0.2) !important;
  border: none !important;
  color: white !important;
  backdrop-filter: blur(10px);
  width: 40px;
  height: 40px;
  transition: all 0.2s ease;
}

.reset-button.p-button:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  transform: rotate(180deg);
}

/* Chat Messages */
.chat-messages {
  height: 400px;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #f8fafc;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.chat-messages::-webkit-scrollbar {
  display: none;
}

.message {
  display: flex;
  margin-bottom: 1rem;
}

.message.user {
  justify-content: flex-end;
}

.message.ai {
  justify-content: flex-start;
}

.message-bubble {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  position: relative;
  font-size: 0.875rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.message.user .message-bubble {
  background: #F8F8F8;
  color: var(--text-default-text);
}

.message.ai .message-bubble {
  background: #F8F8F8;
}

.message.ai .message-bubble.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.message-bubble p {
  margin: 0;
  line-height: 1.5;
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.message-time {
  font-size: 0.75rem;
  opacity: 0.7;
  display: block;
  margin-top: 0.5rem;
}

/* Typing Indicator */
.message-bubble.typing {
  background: white;
  border: 1px solid var(--border-primary-br);
  padding: 1rem 1.25rem;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--gray-gray-500);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }

  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Streaming Indicator */
.streaming-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-fourth_text);
  font-style: italic;
}

.streaming-indicator span {
  position: relative;
}

.streaming-indicator span::after {
  animation: dots 1.5s infinite;
}

/* Typing Dots Animation (ChatGPT style) */
.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: var(--gray-gray-500);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
  animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

@keyframes dots {

  0%,
  20% {
    content: '.';
  }

  40% {
    content: '..';
  }

  60%,
  100% {
    content: '...';
  }
}

/* Quick Actions */
.quick-actions {
  padding: 1rem 1.5rem;
  background: var(--light-white-color);
  border-top: 1px solid var(--border-primary-br);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.quick-action-btn {
  background: white;
  border: 1px solid var(--border-primary-br);
  color: var(--text-default-text);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.quick-action-btn:hover {
  background: var(--solitude-color);
  border-color: var(--gray-gray-500);
}

.quick-action-btn.active {
  background: linear-gradient(135deg, var(--primary-primary-default) 0%, var(--primary-primary-4) 100%);
  color: white;
  border-color: transparent;
}

/* Input Area */

.input-container {
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.input-container:focus-within {
  border-color: var(--primary-primary-default);
  box-shadow: 0 0 0 3px rgba(var(--primary-primary-default), 0.1);
}

.message-input.p-inputtextarea {
  border: none !important;
  background: transparent !important;
  padding: 1rem !important;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.5;
  color: var(--text-default-text);
  width: 100%;
  box-sizing: border-box;
  box-shadow: none !important;
}

.message-input.p-inputtextarea:focus {
  border: none !important;
  box-shadow: none !important;
}

.message-input.p-inputtextarea::placeholder {
  color: #94a3b8;
}

.input-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* .message-input:focus {
    border-color: var(--primary-primary-default);
    box-shadow: 0 0 0 3px var(--primary-primary-opacity);
  } */

.input-footer {
  margin-top: 0.75rem;
  text-align: center;
}

.input-footer p {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
}

/* Features Section */
.features-section {
  background: white;
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.features-section h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-default-text);
  background: linear-gradient(135deg, var(--primary-primary-default) 0%, var(--primary-primary-4) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--light-white-color);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--border-primary-br);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-card h4 {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-default-text);
}

.feature-card p {
  margin: 0;
  color: var(--text-fourth_text);
  line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .ai-english-chatbot-section {
    padding: 1rem;
  }

  .chatbot-header {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .header-content {
    justify-content: center;
  }

  .header-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .chat-messages {
    height: 300px;
    padding: 1rem;
  }

  .quick-actions {
    padding: 1rem;
  }

  .quick-action-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .features-section {
    padding: 1.5rem;
  }

  .features-section h2 {
    font-size: 1.5rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .message-content {
    max-width: 95%;
  }

  .quick-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .quick-action-btn {
    width: 100%;
    text-align: center;
  }

  .input-container {
    flex-direction: column;
    gap: 0.5rem;
  }

  .send-button {
    width: 100%;
    height: 45px;
  }
}

/* Enhanced Chatbot Features Styles */

/* File Attachment Styles */
.attached-files {
  background: #f8fafc;
  border-top: 1px solid var(--border-primary-br);
  padding: 1rem;
}

.attached-files-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-default-text);
}

.attached-files-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.attached-file-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: white;
  border: 1px solid var(--border-primary-br);
  border-radius: 20px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  max-width: 200px;
}

.attached-file-chip .file-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attached-file-chip .file-size {
  color: var(--text-fourth_text);
  font-size: 0.75rem;
}

.attached-file-chip .remove-file {
  background: none;
  border: none;
  color: var(--red-500);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.attached-file-chip .remove-file:hover {
  background: var(--red-100);
}

/* Input Actions */
.input-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.attach-button.p-button {
  background: none !important;
  border: none !important;
  color: #64748b !important;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.attach-button.p-button:hover {
  color: var(--primary-primary-default) !important;
  background: rgba(var(--primary-primary-default), 0.1) !important;
}

/* Branch Question Styles */
.branch-input-container {
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  margin: 1rem;
  overflow: hidden;
  animation: slideDown 0.3s ease-out;
}

.branch-context {
  padding: 1rem;
  background: rgba(245, 158, 11, 0.1);
  border-bottom: 1px solid #f59e0b;
}

.context-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #92400e;
}

.close-branch {
  margin-left: auto;
  background: none;
  border: none;
  color: #92400e;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
}

.close-branch:hover {
  background: rgba(245, 158, 11, 0.2);
}

.context-text {
  font-style: italic;
  color: #78350f;
  background: rgba(255, 255, 255, 0.5);
  padding: 0.75rem;
  border-radius: 8px;
  border-left: 4px solid #f59e0b;
}

.branch-input-area {
  display: flex;
  align-items: center;
  padding: 1rem;
  gap: 0.75rem;
}

.branch-input {
  flex: 1;
  border: 2px solid #f59e0b;
  border-radius: 25px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  outline: none;
  background: white;
}

.branch-input:focus {
  border-color: #d97706;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.branch-send-button {
  background: #f59e0b;
  border: none;
  color: white;
  padding: 0.75rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transition: all 0.2s ease;
}

.branch-send-button:hover:not(:disabled) {
  background: #d97706;
  transform: scale(1.05);
}

.branch-send-button:disabled {
  background: #d1d5db;
  cursor: not-allowed;
}

/* Message Enhancements */
.message.branch {
  position: relative;
}

.message.branch::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: #f59e0b;
  border-radius: 2px;
}

.branch-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: #f59e0b;
  font-weight: 600;
}

.message-text {
  position: relative;
}

.cursor-blink {
  animation: blink 1s infinite;
  color: var(--primary-primary-default);
  font-weight: bold;
}

.message-attachments {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.attachment-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: inherit;
}

.message.user .attachment-chip {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.message.ai .attachment-chip {
  background: var(--border-primary-br);
  border-color: var(--border-secondary-br);
  color: var(--text-fourth_text);
}

/* Streaming Animation */
@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animation for smooth appearance */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chatbot-container,
.features-section {
  animation: fadeInUp 0.6s ease-out;
}

.message {
  animation: fadeInUp 0.3s ease-out;
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
  .branch-input-container {
    margin: 0.5rem;
  }

  .attached-files {
    padding: 0.75rem;
  }

  .attached-file-chip {
    max-width: 150px;
  }

  .input-container {
    padding: 0.5rem 0.75rem;
  }
}



/* Form Styles */
.planner-form {
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.planner-form .form-label {
  color: var(--text-ai-primary-txt);
  display: flex;
  align-items: center;
  font-size: var(--font-size-14);
  font-weight: var(--font-weight-500);
  color: var(--text-default-text);
  margin-bottom: 0.25rem;
}

.form-field {
  position: relative;
}


/* PrimeReact Dropdown Styling */
.form-field .p-dropdown {
  width: 100%;
  border: 1px solid var(--border-primary-br);
  border-radius: 8px;
  background: var(--surfaces-body-bg);
  font-size: var(--font-size-14);
  padding: 0;
}

.planner-form .p-dropdown {
  border-radius: unset !important;
  border: unset;
  border-bottom: 1px solid var(--border-primary-br);
}

.form-field .p-dropdown:not(.p-disabled):hover {
  border-color: var(--surfaces-primary-bg);
  background-color: var(--primary-primary-0);
}

.form-field .p-dropdown:not(.p-disabled).p-focus {
  outline: none;
  border-color: var(--border-accent-br);
  box-shadow: 0 0 0 2px var(--primary-primary-opacity);
}

.form-field .p-dropdown .p-dropdown-label {
  padding: 0.875rem 1rem;
  color: var(--text-default-text);
  font-size: var(--font-size-14);
}

.form-field .p-dropdown .p-dropdown-trigger {
  color: var(--surfaces-primary-bg);
  width: 2.5rem;
}

.form-field .p-dropdown .p-dropdown-trigger .p-dropdown-trigger-icon {
  color: var(--surfaces-primary-bg);
}

/* Dropdown Panel */
.p-dropdown-panel {
  background: var(--surfaces-body-bg);
  border: 1px solid var(--border-primary-br);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow-shadow-8);
}

.p-dropdown-panel .p-dropdown-items .p-dropdown-item {
  padding: 0.75rem 1rem;
  color: var(--text-default-text);
  font-size: var(--font-size-14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
}

.p-dropdown-item.p-focus {
  color: var(--text-primary-txt);
  font-weight: var(--font-weight-500);
  background: unset;
}

.p-dropdown-item.p-focus .p-dropdown-item-label {
  font-weight: var(--font-weight-400);
}

.p-dropdown-panel .p-dropdown-items .p-dropdown-item:not(.p-highlight):not(.p-disabled):hover {
  background-color: #FFF9F3;
}

.p-dropdown-panel .p-dropdown-items .p-dropdown-item.p-highlight {
  background: unset;

  svg {
    color: var(--text-primary-txt);
  }
}

.p-dropdown-panel .p-dropdown-items .p-dropdown-item.p-highlight .p-dropdown-item-label {
  color: var(--text-primary-txt);
}

/* Pill Groups */
.pill-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
}

.pill-button {
  background: #F5F5F5;
  border: 1px solid #F5F5F5;
  color: var(--text-default-text);
  padding: 0.5rem;
  border-radius: 20px;
  font-size: var(--font-size-12);
  font-weight: var(--font-weight-500);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.pill-button:hover {
  background: #FFF2E7;
  border-color: var(--primary-primary-default);
  color: var(--primary-primary-default);
}

.pill-button.active {
  background: #FFF2E7;
  border-color: var(--primary-primary-default);
  color: var(--primary-primary-default);
  box-shadow: unset;
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.form-actions.full-width {
  grid-column: 1 / -1;
}

/* PrimeReact Button Styling */
.generate-plan-btn.p-button {
  background: var(--surfaces-primary-bg);
  border: none;
  color: var(--surfaces-body-bg);
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  font-size: var(--font-size-14);
  font-weight: var(--font-weight-600);
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px var(--shadow-shadow-8);
  justify-content: center;
}

.generate-plan-btn.p-button:not(:disabled):hover {
  background: var(--surfaces-primary-bg-active);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px var(--shadow-shadow-8);
  border-color: var(--surfaces-primary-bg-active);
}

.generate-plan-btn.p-button:not(:disabled):active {
  background: var(--surfaces-primary-bg-active);
  transform: translateY(0);
}

.generate-plan-btn.p-button .p-button-icon {
  font-size: var(--font-size-14);
}

.generate-plan-btn.p-button .p-button-label {
  font-weight: var(--font-weight-600);
}

.generate-plan-btn:active {
  transform: translateY(1px);
}

/* Generated Plan Display */
.generated-plan-section {
  border-top: 1px solid var(--border-primary-br);
  padding-top: 1.5rem;
}

.plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.plan-title {
  font-size: var(--font-size-18);
  font-weight: var(--font-weight-600);
  color: var(--text-default-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.plan-title i {
  color: var(--surfaces-primary-bg);
}

.streaming-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--surfaces-primary-bg);
  font-size: var(--font-size-12);
}

.plan-content {
  background: var(--primary-primary-0);
  border: 1px solid var(--border-primary-br);
  border-radius: 12px;
  padding: 1.5rem;
}

.plan-text {
  font-size: var(--font-size-14);
  line-height: 1.6;
  color: var(--text-default-text);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.cursor-blink {
  animation: blink 1s infinite;
  color: var(--surfaces-primary-bg);
  font-weight: bold;
}

@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .ai-learning-planner-section {
    padding: 1rem 0.5rem;
  }

  .learning-planner-container {
    max-width: 400px;
  }

  .planner-form {
    padding: 1.5rem;
    gap: 1.25rem;
  }

  .pill-group {
    gap: 0.375rem;
  }

  .pill-button {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .learning-planner-container {
    max-width: 350px;
    margin: 0 0.5rem;
  }

  .planner-form {
    padding: 1.25rem;
    gap: 1rem;
  }

  .form-select {
    padding: 0.625rem 0.75rem;
    font-size: 0.85rem;
  }

  .form-label {
    font-size: 0.85rem;
  }

  .pill-button {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
  }

  .generate-plan-btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.85rem;
  }
}


.ai-korean-learning-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 60px;
}

.main-title {
  font-size: 3rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 12px;
  letter-spacing: -0.025em;
}

.subtitle {
  font-size: 1.25rem;
  color: #718096;
  font-weight: 500;
  margin: 0;
}

/* Tools Section */
.tools-section {
  margin-bottom: 80px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(1rem, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.tool-card {
  background: white;
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid #f7fafc;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: #e2e8f0;
}

.tool-icon {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.tool-card h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 12px;
  line-height: 1.4;
}

.tool-card p {
  font-size: 0.95rem;
  color: #718096;
  line-height: 1.6;
  margin: 0;
}

/* Featured Section */
.featured-section {
  text-align: center;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 12px;
  letter-spacing: -0.025em;
}

.section-subtitle {
  font-size: 1.125rem;
  color: #718096;
  margin-bottom: 48px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 32px;
  margin-top: 48px;
}

.featured-card {
  border-radius: 24px;
  padding: 48px 32px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.featured-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.roleplay-card {
  background: linear-gradient(135deg, #ff8a00 0%, #ffa500 100%);
  color: white;
}

.topik-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.featured-content {
  position: relative;
  z-index: 2;
}

.featured-icon {
  margin-bottom: 24px;
  opacity: 0.9;
  background-color: #fff3;
  border-radius: 100%;
  width: fit-content;
  padding: 1rem;
}

.featured-card h3 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.025em;
}

.featured-card p {
  font-size: 1.125rem;
  margin-bottom: 32px;
  opacity: 0.9;
  line-height: 1.6;
}

.cta-button {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.cta-button:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .ai-korean-learning-section {
    padding: 20px 16px;
  }

  .main-title {
    font-size: 2.25rem;
  }

  .subtitle {
    font-size: 1.125rem;
  }

  .tools-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tool-card {
    padding: 24px 20px;
  }

  .featured-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .featured-card {
    padding: 32px 24px;
  }

  .featured-card h3 {
    font-size: 1.75rem;
  }

  .section-title {
    font-size: 1.875rem;
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 2rem;
  }

  .featured-card h3 {
    font-size: 1.5rem;
  }

  .featured-card p {
    font-size: 1rem;
  }
}

/* Animation for cards */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tool-card,
.featured-card {
  animation: fadeInUp 0.6s ease forwards;
}

.tool-card:nth-child(2) {
  animation-delay: 0.1s;
}

.tool-card:nth-child(3) {
  animation-delay: 0.2s;
}

.tool-card:nth-child(4) {
  animation-delay: 0.3s;
}

.featured-card:nth-child(2) {
  animation-delay: 0.4s;
}

/* AI template */
/* Chat Template Styles */
.chat-template-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #6b7280;
}

.loading-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #f7941d;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}


/* Learning Plan Template */
.learning-plan-template {
  color: var(--text-ai-primary-txt);
  min-width: 20rem;
}

.plan-header {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.plan-title-section {
  display: flex;
  gap: 2rem;
  flex-direction: column;
  align-items: start;
  margin-bottom: 2rem;
}

.plan-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.save-button {
  background: #f7941d !important;
  border: none !important;
  color: white !important;
  padding: 12px 24px !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  transition: all 0.3s ease !important;
}

.save-button:hover {
  background: #e8851a !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(247, 148, 29, 0.3) !important;
}

.plan-overview {
  color: var(--text-ai-primary-txt);
  font-size: 1rem;
  line-height: 1.7;
  margin: 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-default-text);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Daily Plan Section */
.daily-plan-section {
  background: #f8f9fa;
  margin-bottom: 1.5rem;
}

.daily-plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.day-card {
  padding: 0px 1rem;
}

.day-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.day-name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.day-time {
  font-weight: 600;
  font-size: 1rem;
  padding: 0.25rem 0.5rem;
}

.day-focus {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.day-activities {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-left: 0.5rem;
}

.activity-item {
  font-size: 1rem;
  line-height: 1.5;
  position: relative;
  padding-left: 16px;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item::before {
  content: "•";
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* Strategies Section */
.strategies-section {
  background: #f8f9fa;
  margin-bottom: 1.5rem;
}

.strategies-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.strategy-card {
  padding: 0px 1rem;
  transition: all 0.3s ease;
}

.strategy-area {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: capitalize;
}

.strategy-text {
  color: #495057;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

/* Resources Section */
.resources-section {
  background: #f8f9fa;
  margin-bottom: 1.5rem;
}

.resources-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 20px;
}

.resource-category {
  padding: 0px 1rem;
  transition: all 0.3s ease;
}

.resource-type {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-transform: capitalize;
}

.resource-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.resource-item {
  padding: 8px 0;
  font-size: 1rem;
  line-height: 1.5;
  position: relative;
  padding-left: 16px;
}

.resource-item:last-child {
  border-bottom: none;
}

.resource-item::before {
  content: "•";
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* Progress Section */
.progress-section {
  background: #f8f9fa;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

.progress-content {
  margin-top: 20px;
}

.progress-goal {
  color: #2c3e50;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.6;
}

.milestones {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid #e9ecef;
}

.milestones-title {
  color: #2c3e50;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.milestones-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.milestone-item {
  padding: 12px 0;
  color: #495057;
  font-size: 0.95rem;
  line-height: 1.5;
  border-bottom: 1px solid #f1f3f4;
  position: relative;
  padding-left: 20px;
}

.milestone-item:last-child {
  border-bottom: none;
}

.milestone-item::before {
  content: "✓";
  color: #f7941d;
  font-weight: bold;
  position: absolute;
  left: 0;
  top: 12px;
}

.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #f7941d;
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f7941d;
  border: 3px solid white;
}

.timeline-phase {
  color: #2c3e50;
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.timeline-objective {
  color: #6c757d;
  margin-bottom: 12px;
  font-style: italic;
}

.timeline-plan {
  list-style: none;
  padding: 0;
}

.timeline-plan li {
  padding: 4px 0;
  color: #495057;
}

.tips-list {
  list-style: none;
  padding: 0;
}

.tip-item {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  color: #856404;
  font-style: italic;
}

/* Vocabulary Template */
.vocabulary-template {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  margin: 10px 0;
}

.vocab-header {
  margin-bottom: 24px;
  text-align: center;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 16px;
}

.vocab-title {
  color: #2c3e50;
  font-size: 1.8rem;
  margin-bottom: 12px;
  font-weight: 600;
}

.vocab-description {
  color: #6c757d;
  font-size: 1.1rem;
  line-height: 1.6;
}

.vocab-section {
  margin-bottom: 32px;
}

.vocab-section h3 {
  color: #2c3e50;
  font-size: 1.4rem;
  margin-bottom: 16px;
  font-weight: 600;
  border-left: 4px solid #f7941d;
  padding-left: 12px;
}

.words-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.word-card {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-left: 4px solid #f7941d;
}

.word-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.word-korean {
  font-size: 1.4rem;
  font-weight: 600;
  color: #2c3e50;
}

.word-romanization {
  color: #6c757d;
  font-style: italic;
  font-size: 0.9rem;
}

.word-meaning {
  color: #495057;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.word-example,
.word-pronunciation {
  color: #6c757d;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.category-card {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-name {
  color: #2c3e50;
  font-size: 1.1rem;
  margin-bottom: 12px;
  text-transform: capitalize;
}

.category-words {
  list-style: none;
  padding: 0;
}

.category-word {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #f1f3f4;
}

.category-word:last-child {
  border-bottom: none;
}

.exercises-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.exercise-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.exercise-title {
  color: #2c3e50;
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.exercise-description {
  color: #6c757d;
  margin-bottom: 16px;
}

.exercise-questions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.question-item {
  padding: 16px;
  background: #f8f9fa;
  border-radius: 6px;
}

.question-text {
  color: #2c3e50;
  font-weight: 600;
  margin-bottom: 12px;
}

.question-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.option-label:hover {
  background: #e9ecef;
}

/* TOPIK Template */
.topik-template {
  padding: 20px;
  background: #f8f9fa;
  border-radius: 12px;
  margin: 10px 0;
}

.topik-header {
  margin-bottom: 24px;
  text-align: center;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 16px;
}

.topik-title {
  color: #2c3e50;
  font-size: 1.8rem;
  margin-bottom: 12px;
  font-weight: 600;
}

.topik-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.topik-level,
.topik-type,
.topik-time {
  background: #f7941d;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.topik-section {
  margin-bottom: 32px;
}

.topik-section h3 {
  color: #2c3e50;
  font-size: 1.4rem;
  margin-bottom: 16px;
  font-weight: 600;
  border-left: 4px solid #f7941d;
  padding-left: 12px;
}

.topik-instructions {
  background: white;
  padding: 16px;
  border-radius: 8px;
  color: #495057;
  line-height: 1.6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.questions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.question-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e9ecef;
}

.question-number {
  color: #2c3e50;
  font-weight: 600;
  font-size: 1.1rem;
}

.question-points {
  background: #f7941d;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

.question-passage {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  border-left: 4px solid #6c757d;
}

.question-passage h4 {
  color: #2c3e50;
  margin-bottom: 8px;
  font-size: 1rem;
}

.question-content {
  margin-bottom: 16px;
}

.question-text {
  color: #2c3e50;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.question-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 12px;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  transition: all 0.2s;
}

.option-label:hover {
  background: #f8f9fa;
  border-color: #f7941d;
}

.option-text {
  color: #495057;
  font-size: 1rem;
}

.question-answer {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 12px;
  border-radius: 6px;
  margin-top: 12px;
  font-weight: 600;
}

.question-explanation {
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
  padding: 12px;
  border-radius: 6px;
  margin-top: 8px;
  line-height: 1.6;
}

.scoring-info {
  background: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.scoring-info p {
  margin-bottom: 8px;
  color: #495057;
  font-weight: 600;
}

.scoring-info p:last-child {
  margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .learning-plan-template {
    padding: 16px;
    margin: 5px 0;
  }

  .plan-title-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .plan-title {
    font-size: 1.5rem;
  }

  .save-button {
    align-self: flex-end;
    padding: 10px 20px !important;
    font-size: 0.9rem !important;
  }

  .daily-plan-grid,
  .strategies-grid,
  .resources-grid,
  .words-grid,
  .categories-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .day-card,
  .strategy-card,
  .resource-category {
    padding: 16px;
  }

  .day-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .day-time {
    align-self: flex-start;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .topik-meta {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .question-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .timeline {
    padding-left: 20px;
  }

  .timeline::before {
    left: 10px;
  }

  .timeline-item::before {
    left: -17px;
  }
}

@media (max-width: 480px) {
  .learning-plan-template {
    padding: 12px;
  }

  .plan-title {
    font-size: 1.3rem;
  }

  .plan-overview {
    font-size: 1rem;
  }

  .section-title {
    font-size: 1.2rem;
    padding-left: 12px;
  }

  .day-card,
  .strategy-card,
  .resource-category,
  .milestones {
    padding: 12px;
  }

  .daily-plan-section,
  .strategies-section,
  .resources-section,
  .progress-section {
    padding: 16px;
  }
}

/* AI CHATBOT */
/* AI Chatbot App Styles */
.ai-chatbot-app {
  height: calc(100vh - var(--header-height));
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.chatbot-layout {
  height: 100%;
  width: 100%;
  border-left: none;
}

/* Sidebar Styles */
.chatbot-sidebar {
  width: 22.5rem;
  background: #ffffff;
  border-right: 0.0625rem solid #e5e7eb;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-header {
  padding: 1rem;
  height: 5rem;
  border-bottom: 0.0625rem solid #e5e7eb;
}

.new-conversation-btn {
  width: 100%;
  justify-content: center;
  padding: 0.625rem 1rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: 0.0625rem solid #d1d5db;
  background: #ffffff;
  color: #374151;
  transition: all 0.2s ease;
}

.new-conversation-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.conversations-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.conversations-header {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.conversations {
  padding: 0 0.5rem;
}

.conversation-item {
  padding: 0.75rem 0.75rem;
  margin: 0.125rem 0;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.conversation-item:hover {
  background: #f3f4f6;
}

.conversation-item:hover .conversation-actions {
  opacity: 1;
  visibility: visible;
}

.conversation-item.active {
  background: #eff6ff;
  border-left: 0.1875rem solid var(--primary-primary-default);
}

.conversation-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.conversation-actions {
  display: flex;
  gap: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

.conversation-action-btn {
  width: 1.75rem !important;
  height: 1.75rem !important;
  min-width: 1.75rem !important;
  padding: 0 !important;
}

.conversation-action-btn.delete-btn:hover {
  background: #fee2e2 !important;
  color: #dc2626 !important;
}

.conversation-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-time {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Main Chat Area */
.chatbot-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

/* Chat Header */
.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  height: 5rem;
  border-bottom: 0.0625rem solid #e5e7eb;
  background: #ffffff;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ai-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.125rem;
}

.ai-info h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
}

.ai-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: #6b7280;
  margin-top: 0.125rem;
}

.status-online {
  color: #10b981;
  font-size: 0.5rem;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: transparent;
  width: 100%;
  scroll-behavior: unset;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
}

.message-container {
  max-width: 45rem;
  width: 100%;
  margin: 0 auto;
}

.message.user {
  align-self: flex-end;
  flex-direction: row;
  justify-content: flex-end;
  gap: 0.75rem;
}

.message.user .message-wrapper {
  justify-content: flex-end;
}

.message.ai .message-wrapper {
  justify-content: flex-start;
}

.message.user .message-container {
  justify-content: flex-end;
}

.message.ai .message-container {
  justify-content: flex-start;
}

.message.user .message-content {
  order: 1;
}

.message.user .message-avatar {
  order: 2;
}

.message-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.message-avatar.user {
  background: #ff6b35;
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
}

.message-content {
  max-width: 100%;
}

.message-bubble.error {
  background: #fef2f2;
  border: 0.0625rem solid #fecaca;
  color: #dc2626;
}

.message-text {
  white-space: pre-wrap;
}



@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.typing-indicator span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #6b7280;
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
  animation-delay: -0.16s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0s;
}

@keyframes typing-bounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }

  30% {
    transform: translateY(-0.5rem);
    opacity: 1;
  }
}

/* Branch Input */
.branch-input-container {
  margin: 1rem 1.5rem;
  background: #fff7ed;
  border: 0.0625rem solid #fed7aa;
  border-radius: 0.75rem;
  padding: 1rem;
}

.branch-context {
  margin-bottom: 0.75rem;
}

.context-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 0.5rem;
}

.context-text {
  background: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: #374151;
  border: 0.0625rem solid #e5e7eb;
}

.branch-input-area {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.branch-input {
  flex: 1;
}


/* Chat Input Area */
.chat-input-area {
  width: 100%;
  max-width: 45rem;
  margin-bottom: 1rem;
  position: relative;
  border-radius: var(--border-radius-8);
  border: 1px solid var(--form-third-border);
}

.chat-input-area::before {
  content: "";
  position: absolute;
  inset: 0px;
  border-radius: 12px;
  background: white;
  z-index: 0;
}

.chat-input-area>* {
  position: relative;
  z-index: 1;
}

.initial-input-area {
  width: 100%;
  position: relative;
  border-radius: var(--border-radius-8);
  border: 1px solid var(--form-third-border);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.10);
}

.initial-input-area:focus-within {
  background:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(137.75deg, #FFF5D7 -9.41%, #FF8110 96.14%) border-box;
  color: var(--text-dark-text);
  border: 1px solid transparent;
  border-radius: var(--border-radius-8);
  display: inline-block;
}

.initial-input-area>* {
  position: relative;
  z-index: 1;
}

.input-top-section {
  border-radius: var(--border-radius-8);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.input-bottom-section {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-top: 1px solid var(--form-third-border)
}

.input-actions-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.input-actions-left {
  display: flex;
  align-items: center;
}

.input-actions-right {
  display: flex;
  align-items: center;
}

.message-input {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 0.875rem;
  line-height: 1.5;
  min-height: 1.25rem;
  max-height: 7.5rem;
}

.message-input::placeholder {
  color: #9ca3af;
}

.attach-btn {
  color: #6b7280 !important;
  transition: all 0.2s ease;
}

.attach-btn:hover {
  color: #374151 !important;
  background: #f3f4f6 !important;
}

.input-footer {
  margin-top: 0.5rem;
  text-align: center;
}

.input-footer span {
  font-size: 0.75rem;
  color: #6b7280;
}

.file-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.file-counter {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
}

.file-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5e7eb;
  background: #fafafa;
  border-radius: 10px;
  padding: 6px 8px;
}

.file-icon {
  font-size: 12px;
}

.file-name {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-remove {
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
  .chatbot-sidebar {
    width: 100%;
    position: absolute;
    left: -100%;
    z-index: 1000;
    transition: left 0.3s ease;
  }

  .chatbot-sidebar.open {
    left: 0;
  }

  .message {
    max-width: 90%;
  }

  .chat-messages {
    padding: 1rem;
  }

  .chat-input-area {
    padding: 0.75rem 1rem;
  }
}

/* PrimeReact Component Overrides */
.p-button {
  transition: all 0.2s ease;
}

.p-inputtextarea {
  font-family: inherit;
}

.p-inputtextarea:focus {
  box-shadow: none;
  border-color: transparent;
}


/* Define Popup Styles */
.define-popup {
  background: #ffffff;
  border: 0.0625rem solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 0.625rem 1.5625rem rgba(0, 0, 0, 0.15);
  max-width: 23.75rem;
  min-width: 20rem;
  overflow: hidden;
}

.define-popup-header {
  background: #f8fafc;
  border-bottom: 0.0625rem solid #e5e7eb;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.define-popup-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

.define-status-icon {
  color: #10b981;
  font-size: 0.5rem;
}

.define-close-btn-custom {
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.define-close-btn-custom:hover {
  background: #f3f4f6;
  color: #374151;
}

.define-close-btn-custom:active {
  transform: scale(0.95);
}

.define-popup-content {
  padding: 1rem;
}

.selected-text-display {
  margin-bottom: 0.75rem;
}

.selected-text-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  display: block;
  margin-bottom: 0.375rem;
}

.selected-text-value {
  background: #eff6ff;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  color: #1e40af;
  font-style: italic;
  border: 0.0625rem solid #dbeafe;
  line-height: 1.4;
}

.define-btn {
  width: 100%;
  background: #ff6b35 !important;
  border: none !important;
  border-radius: 0.5rem !important;
  padding: 0.625rem 1rem !important;
  font-weight: 600 !important;
  margin-bottom: 1rem;
  transition: all 0.2s ease !important;
  font-size: 0.875rem !important;
}

.define-btn:hover {
  background: #e55a2b !important;
  transform: translateY(-0.0625rem);
  box-shadow: 0 0.25rem 0.75rem rgba(255, 107, 53, 0.3) !important;
}

.define-input-section {
  border-top: 0.0625rem solid #f1f5f9;
  padding-top: 1rem;
}

.define-question-label {
  font-size: 0.75rem;
  color: #64748b;
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.define-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #f8fafc;
  border: 0.0625rem solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
}

.define-input-wrapper:focus-within {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.define-question-input {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 0.875rem;
  line-height: 1.4;
  min-height: 1.125rem;
  color: #374151;
}

.define-question-input::placeholder {
  color: #9ca3af;
}

.define-send-btn {
  background: #3b82f6 !important;
  border: none !important;
  width: 2rem !important;
  height: 2rem !important;
  min-width: 2rem !important;
  flex-shrink: 0;
}

.define-send-btn:hover:not(:disabled) {
  background: #2563eb !important;
  transform: scale(1.05);
}

.define-send-btn:disabled {
  background: #d1d5db !important;
  cursor: not-allowed;
}

.define-result {
  margin-top: 0.75rem;
}

.define-result-box {
  margin-top: 0.375rem;
  background: #ecfdf5;
  border: 0.0625rem solid #a7f3d0;
  color: #065f46;
  padding: 0.75rem;
  border-radius: 0.5rem;
  max-height: 13.75rem;
  overflow: auto;
}

.define-result-box .markdown-content {
  color: #065f46;
}

.define-result-box .markdown-content h1,
.define-result-box .markdown-content h2,
.define-result-box .markdown-content h3,
.define-result-box .markdown-content h4,
.define-result-box .markdown-content h5,
.define-result-box .markdown-content h6 {
  color: #065f46;
  border-bottom-color: #a7f3d0;
}

.define-result-box .markdown-content blockquote {
  background: #d1fae5;
  border-left-color: #10b981;
  color: #047857;
}

.define-result-box .markdown-content code {
  background: #d1fae5;
  color: #047857;
}

.define-result-box .markdown-content pre {
  background: #065f46;
  color: #ecfdf5;
}

.define-result-box.streaming::after {
  content: '▊';
  animation: blink 1s infinite;
}

/* Markdown Content Styles */
.markdown-content {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  line-height: 1.6;
  color: #374151;
}

/* Headings */
.markdown-h1,
.markdown-h2,
.markdown-h3,
.markdown-h4,
.markdown-h5,
.markdown-h6 {
  margin: 1rem 0 0.5rem 0;
  font-weight: 600;
  color: #1f2937;
}

.markdown-h1 {
  font-size: 1.5rem;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 0.5rem;
}

.markdown-h2 {
  font-size: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.25rem;
}

.markdown-h3 {
  font-size: 1.125rem;
}

.markdown-h4,
.markdown-h5,
.markdown-h6 {
  font-size: 1rem;
}

/* Paragraphs and Lists */
.markdown-p {
  margin: 0.75rem 0;
  line-height: 1.7;
}

.markdown-ul,
.markdown-ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}

.markdown-li {
  margin: 0.25rem 0;
  line-height: 1.6;
}

/* Blockquotes */
.markdown-blockquote {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid #3b82f6;
  background: #f8fafc;
  border-radius: 0.25rem;
  font-style: italic;
  color: #4b5563;
}

/* Code blocks */
.markdown-content pre {
  margin: 1rem 0;
  padding: 1rem;
  background: #1f2937;
  border-radius: 0.5rem;
  overflow-x: auto;
}

.markdown-content code {
  background: #f3f4f6;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  color: #dc2626;
}

/* Inline code */
.markdown-content p code,
.markdown-content li code {
  background: #f3f4f6;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  color: #dc2626;
}

/* Links */
.markdown-link {
  color: #3b82f6;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.markdown-link:hover {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

/* Tables */
.markdown-table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
}

.markdown-thead {
  background: #f9fafb;
}

.markdown-th,
.markdown-td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
}

.markdown-th {
  font-weight: 600;
  background: #f3f4f6;
  color: #374151;
}

.markdown-td:last-child,
.markdown-th:last-child {
  border-right: none;
}

.markdown-tr:last-child .markdown-td {
  border-bottom: none;
}

/* Strong and Emphasis */
.markdown-strong {
  font-weight: 600;
  color: #1f2937;
}

.markdown-em {
  font-style: italic;
  color: #4b5563;
}

/* Horizontal Rule */
.markdown-content hr {
  margin: 2rem 0;
  border: none;
  border-top: 1px solid #e5e7eb;
}

/* Responsive Markdown */
@media (max-width: 768px) {
  .markdown-h1 {
    font-size: 1.25rem;
  }

  .markdown-h2 {
    font-size: 1.125rem;
  }

  .markdown-h3 {
    font-size: 1rem;
  }

  .markdown-content pre {
    padding: 0.75rem;
    font-size: 0.8rem;
  }

  .markdown-content code {
    font-size: 0.8rem;
  }

  .markdown-blockquote {
    padding: 0.5rem 0.75rem;
  }

  .markdown-th,
  .markdown-td {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
}

/* Chat Header Styles */
.chat-header {
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.new-chat-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--orange-color);
  color: white;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.new-chat-button:hover {
  background: #ea580c;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.new-chat-button i {
  font-size: 0.875rem;
}

/* Initial Chat Interface Styles */
.initial-chat-interface {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  max-width: 45rem;
  text-align: center;
}

.welcome-message {
  margin-bottom: 3rem;
  width: 100%;
}

.welcome-message h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.welcome-message p {
  font-size: 1.125rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
}

.initial-input-container {
  width: 100%;
  max-width: 600px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 1rem;
  padding: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.attach-button {
  background: none;
  border: none;
  color: #9ca3af;
  padding: 0.5rem;
  margin-right: 0.75rem;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attach-button:hover {
  color: #6b7280;
  background: #f3f4f6;
}

.attach-button i {
  font-size: 1.1rem;
}

.initial-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: #1f2937;
  background: transparent;
  padding: 0.5rem 0;
}

.initial-input::placeholder {
  color: #9ca3af;
}


/* Responsive styles for initial chat interface */
@media (max-width: 768px) {
  .chatbot-layout {
    width: 95%;
  }

  .chat-header {
    padding: 0.75rem;
  }

  .new-chat-button {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
  }

  .initial-chat-interface {
    padding: 1rem;
    height: calc(100% - 3rem);
  }

  .welcome-message h2 {
    font-size: 2rem;
  }

  .welcome-message p {
    font-size: 1rem;
  }

  .initial-input-container {
    max-width: 100%;
  }

  .input-wrapper {
    padding: 0.5rem;
  }

  .send-button {
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem;
  }
}

/* Planner First Chat Styles */
.learning-plan-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topik-progression {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.learning-plan-summary .plan-details {
  display: flex;
  gap: 0.5rem;
}

.learning-plan-summary .learning-areas {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.learning-plan-summary .learning-areas .areas-section .areas-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.shimmer-text{
  --c1:#ff2d55;   
  --c2:#ff7a00;   
  --c3:#ffd166;   

  background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3), var(--c2), var(--c1));
  background-size: 300% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent; 
  font-weight: 700;

  animation: stepShimmer 2.2s linear infinite;
}

.shimmer-text.done{
  animation: none;
  background-position: 100% 50%;
}

@keyframes stepShimmer{
  0%   { background-position:   0% 50%; }
  100% { background-position: 100% 50%; }
}

.vocab-wrap {
  margin: 0 auto;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Apple Color Emoji, Segoe UI Emoji;
  color: #0f172a
}

.vocab-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px
}

.v-top-left {
  display: flex;
  align-items: center;
  gap: 8px
}

.v-hint {
  font-size: 12px;
  color: #64748b
}

.v-btn {
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer
}

.v-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 14px
}

.v-title {
  font-size: 28px;
  line-height: 1.1;
  margin: 0;
  font-weight: 700
}

.v-roman {
  font-size: 14px;
  color: #64748b
}

.v-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  font-size: 12px
}

.v-chip.ghost {
  background: #f8fafc
}

.v-chip.outline {
  background: transparent;
  border: 1px solid #e2e8f0
}

.v-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px
}

.v-section {
  margin: 18px 0
}

.v-sec-title {
  font-size: 16px;
  margin: 0 0 10px;
  font-weight: 700
}

.v-sub {
  font-size: 15px;
  margin: 0 0 8px;
  font-weight: 600
}

.v-def-list {
  display: grid;
  gap: 8px
}

.v-def {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start
}

.v-def-lang {
  font-weight: 700;
  color: #475569
}

.v-def-text {
  color: #0f172a
}

.v-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0
}

@media (max-width:700px) {
  .v-two-col {
    grid-template-columns: 1fr
  }
}

.v-ex-list {
  display: grid;
  gap: 12px
}

.v-ex {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px
}

.v-ex-label {
  font-weight: 700;
  color: #475569
}

.v-ex-ko {
  margin: 0 0 2px
}

.v-ex-tr {
  margin: 0;
  color: #64748b
}

.v-para {
  margin: 0;
  color: #0f172a
}

/* LeftNavAiTutor Styles */
.side-nav {
  padding: 1.625rem 1rem;
  height: 100%;
  border-right: 1px solid #e5e5e5;
  background: var(--white-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  max-width: 280px;
  position: relative;
  max-height: calc(100vh - var(--header-height));
  overflow: auto;
}

.side-nav.collapsed {
  width: 5rem;
}


.side-nav {
  --reveal-delay: 500ms;
  --fade-ms: 200ms;
  --slide-px: 6px;
  --history-max-h: 480px;
}

.nav-chat-grid {
  display: grid;
  grid-template-rows: 1fr;
  /* expanded */
  transition: grid-template-rows 300ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: grid-template-rows;
}

.side-nav.collapsed .nav-chat-grid {
  grid-template-rows: 0fr;
}

.nav-chat-inner {
  overflow: hidden;
  min-height: 0;
}

.reveal-on-expand {
  opacity: 1;
  transform: translateX(0);
  transition: opacity var(--fade-ms) ease, transform var(--fade-ms) ease;
}

.side-nav.collapsed .reveal-on-expand {
  opacity: 0;
  transform: translateX(-6px);
  transition-delay: 0ms;
  pointer-events: none;
  visibility: hidden;
}

.side-nav.expanded .reveal-on-expand {
  transition-delay: var(--reveal-delay);
  visibility: visible;
}

.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
  transition: opacity 0.3s ease;
}

.side-nav.collapsed .nav-title {
  display: none;
  pointer-events: none;
}

.nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-toggle:hover {
  background-color: #f0f0f0;
}

.nav-menu-ai {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-item-ai {
  margin: 0;
}

.nav-link-ai {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  color: #1a1a1a;
  text-decoration: none !important;
  transition: background-color 0.2s ease;
  gap: 0.75rem;
  white-space: nowrap;
}

.nav-link-ai:hover {
  font-weight: bold;
  color: var(--text-default-text) !important;
}

.nav-link-ai:hover .nav-icon svg {
  stroke: var(--primary-primary-default);
}

.side-nav {
  --title-max: 220px;
}

/* Container tiêu đề: animate bằng max-width (auto ↔ 0 không animate được) */
.nav-title-wrap {
  max-width: var(--title-max);
  overflow: hidden;
  transition: max-width 300ms cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
}

.side-nav.collapsed .nav-title-wrap {
  max-width: 0;
}

.nav-title {
  margin: 0;
  white-space: nowrap;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 180ms ease, transform 180ms ease;
}

.side-nav.collapsed .nav-title {
  opacity: 0;
  transform: translateX(-6px);
  transition-delay: 0ms;
  pointer-events: none;
}


.side-nav.expanded .nav-title {
  transition-delay: 500ms;
}

.new-chat-label {
  margin: 0;
  white-space: nowrap;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 180ms ease, transform 180ms ease;
}

.side-nav.collapsed .new-chat-label {
  opacity: 0;
  transform: translateX(-6px);
  transition-delay: 0ms;
  pointer-events: none;
  width: 0px;
}

.side-nav.collapsed .chat-history-new span {
  margin: 0 !important;
}

.side-nav.expanded .new-chat-label {
  transition-delay: 500ms;
}

.side-nav.expanded .chat-history-header {
  justify-content: flex-start !important;
}

.side-nav.collapsed .chat-history-header {
  justify-content: center !important;
}

.nav-link-ai:hover {
  background-color: #fff9f3;
  color: var(--text-ai-secondary-txt);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1a1a;
}

.nav-text {
  flex: 1;
  font-size: 16px;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.side-nav.collapsed .nav-text {
  opacity: 0;
  pointer-events: none;
}

.nav-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1a1a;
  transition: opacity 0.3s ease;
}

.side-nav.collapsed .nav-arrow {
  opacity: 0;
  pointer-events: none;
}

/* Tooltip cho collapsed state */
.side-nav.collapsed .nav-link-ai {
  position: relative;
}

.side-nav.collapsed .nav-link-ai::before {
  content: "";
  display: none;
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: var(--primary-primary-default);
  margin-left: 5px;
  z-index: 1000;
}

/* Submenu styles */
.has-submenu {
  position: relative;
}

/* Active state for menu items with active submenu */
.active>.nav-link-ai {
  color: var(--text-default-text);
}

.active>.nav-link-ai.collapsed {
  border-radius: var(--border-radius-8);
}

.active>.nav-link-ai .nav-icon svg path {
  stroke: var(--primary-primary-default);
}

.submenu {
  list-style: none;
  padding: 0;
  margin: 0;
  margin-left: 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.submenu.expanded {
  max-height: 300px;
}

.submenu-item {
  margin: 0;
  margin-top: 4px;
}

.submenu-link {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  color: #6c757d;
  text-decoration: none;
  transition: all 0.2s ease;
  gap: 10px;
  font-size: 14px;
  white-space: nowrap;
}

.submenu-link:hover {
  background-color: #FFF9F3;
  color: #424242;
  border-radius: var(--border-radius-8);
  text-decoration: none;
}

/* Active state for submenu links */
.submenu-link.active {
  background-color: var(--primary-primary-0);
  color: var(--text-primary-text);
  font-weight: 500;
  border-radius: var(--border-radius-8);
}

.submenu-link.active:hover {
  background-color: var(--primary-primary-0);
  color: var(--text-primary-text);
  text-decoration: none;
}

.submenu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  min-width: 16px;
}

.submenu-text {
  flex: 1;
  font-weight: 400;
}

/* Submenu arrow rotation */
.submenu-arrow {
  transition: transform 0.3s ease;
}

.has-submenu.expanded .submenu-arrow {
  transform: rotate(90deg);
}

.has-submenu.active .nav-arrow.submenu-arrow svg {
  color: var(--orange-color);
}

/* Collapsed state submenu handling */
.side-nav.collapsed .submenu {
  position: absolute;
  left: 100%;
  top: 0;
  width: 200px;
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  margin-left: 0;
  border-left: none;
}

.side-nav.collapsed .submenu-link {
  padding: 12px 16px;
}

.side-nav.collapsed .submenu-text {
  opacity: 1;
  pointer-events: auto;
}

/* Active state for collapsed submenu */
.side-nav.collapsed .submenu-link.active {
  background-color: var(--primary-primary-default);
  color: var(--text-white-txt);
}

.side-nav.collapsed .submenu-link.active:hover {
  background-color: var(--primary-primary-default);
  color: var(--text-white-txt);
}

/* Hide submenu when collapsed and not hovered */
.side-nav.collapsed .submenu {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.side-nav.collapsed .has-submenu:hover .submenu {
  opacity: 0;
  visibility: hidden;
}

/* chat history */
.chat-history {
  padding: 0.75rem;
}

.chat-history-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0rem;
}

.chat-history-new {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #f7941d;
  font-weight: 600;
}

.chat-history-title {
  color: #6b7280;
  font-weight: 600;
  margin: 2rem 0rem;
}

.chat-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-history-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 10px;
  transition: background-color 0.2s ease;
}

.chat-history-item:hover {
  background: #f5f5f5;
}

.chat-history-item.editing:hover {
  background: none !important;
}

.chat-history-item.active {
  background: #e9e9e9;
}

.chat-history-item.active:hover {
  background: #e0e0e0;
}

.chat-history-button {
  flex: 1;
  text-align: left;
  background: none;
  border: none;
  padding: 0.75rem;
  border-radius: var(--border-radius-8);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.chat-history-text {
  font-weight: 600;
  color: #111827;

  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* Rename container */
.chat-history-rename-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.chat-history-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  font-size: 14px;
  font-weight: 600;
  width: inherit;
}

.chat-history-input:focus {
  outline: none;
  border-color: #f7941d;
  box-shadow: 0 0 0 2px rgba(247, 148, 29, 0.2);
}

.chat-history-rename-actions {
  display: flex;
  gap: 4px;
}

.chat-history-confirm,
.chat-history-cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-history-confirm {
  color: white;
}

.chat-history-confirm:hover {
  background: #E0E0E0;
}

.chat-history-cancel {
  color: white;
}

.chat-history-cancel:hover {
  background: #E0E0E0;
}

/* Menu trigger button */
.chat-history-menu-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.75rem;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s ease;
}

.chat-history-menu-trigger:hover {
  background: rgba(0, 0, 0, 0.1);
  color: #374151;
}

/* Menu dropdown */
.chat-history-menu {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  min-width: 140px;
  overflow: hidden;
  animation: menuSlideIn 0.2s ease;
}

@keyframes menuSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-history-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  color: #374151;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.chat-history-menu-item.delete {
  color: #EF5350;
}

.chat-history-menu-item:hover {
  background: #f3f4f6;
}

.chat-history-menu-item.delete:hover {
  background: #fef2f2;
  color: #dc2626;
}

.chat-history-empty {
  text-align: center;
  color: #6b7280;
  padding: 20px;
}

/* Animation khi title thay đổi (fade + slide + color) */
@keyframes titleChange {
  0% {
    opacity: 0;
    transform: translateY(4px);
    color: #f7941d;
  }

  50% {
    opacity: 1;
    transform: translateY(0);
    color: #f7941d;
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    color: #111827;
  }
}

.title-updated {
  animation: titleChange 1.2s ease;
}

/* TOPIK Writing */
:root {
  --twp-gap: 16px;
  --twp-sidebar-w: 400px;
  --twp-result-w: 600px;
  --twp-bg: #f6f6f8;
  --twp-panel-bg: #fff;
  --twp-radius: 12px;
  --twp-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .06);
}

.twp-root {
  height: calc(100vh - var(--header-height));
  inline-size: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.twp-container {
  display: grid;
  grid-template-columns: var(--twp-sidebar-w) 1fr;
  grid-template-areas: "sidebar main";
  block-size: 100%;
}

.twp-root--with-result .twp-container {
  grid-template-columns: var(--twp-sidebar-w) 1fr var(--twp-result-w);
  grid-template-areas: "sidebar main result";
}

.twp-sidebar {
  grid-area: sidebar;
  border-right: 1px solid var(--form-third-border);
  overflow: auto;
  position: relative;
  padding: 1.5rem;
}

.twp-main {
  grid-area: main;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: #FAFAFA;
}

.twp-main>.twp-editor-scroll {
  overflow: auto;
  block-size: 100%;
  padding: 20px;
}

.twp-result {
  grid-area: result;
  background: var(--twp-panel-bg);
  border-left: 1px solid var(--form-third-border);
  overflow: auto;
  padding: 1.5rem;
}

.twp-sticky-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--twp-panel-bg);
  border-bottom: 1px solid var(--form-third-border);
  padding: 12px 16px;
}

@media (max-width: 1200px) {
  .twp-root--with-result .twp-container {
    grid-template-columns: var(--twp-sidebar-w) 1fr;
  }

  .twp-result {
    display: none;
  }
}

@media (max-width: 992px) {
  .twp-container {
    grid-template-columns: 1fr;
    grid-template-areas:
      "sidebar"
      "main";
  }

  .twp-sidebar {
    inline-size: 100%;
    block-size: 280px;
  }
}

@media print {
  .twp-root {
    padding: 0;
    block-size: auto;
  }

  .twp-sidebar,
  .twp-result {
    display: none !important;
  }

  .twp-container {
    display: block;
  }

  .twp-main {
    border: none;
    box-shadow: none;
    border-radius: 0;
  }
}


/* TOPIK Writing Editor */
.topik-manuscript-editor {
  font-family: 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Nanum Gothic', 'Dotum', sans-serif;
  max-width: 1200px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}

/* Toolbar Styles */
.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom: 1px solid #e2e8f0;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.toolbar-btn:active {
  transform: translateY(0);
}

.toolbar-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.toolbar-btn.active {
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.save-btn {
  background: #10b981;
  font-weight: 600;
}

.save-btn:hover {
  background: #059669;
}

.dirty-indicator {
  color: #f59e0b;
  font-weight: bold;
  font-size: 18px;
  margin-left: 8px;
}

.spinner-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.spinner-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 8px solid #FFF5D7;
  border-top-color: #FF8110;
  animation: spin 1.5s linear infinite;
}

.spinner-wrap img {
  width: 48px;
  height: 48px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Editor Container */
.editor-container {
  display: flex;
  min-height: 600px;
  width: fit-content;
}

.simple-editor {
  flex: 1;
}

.simple-textarea {
  width: 100%;
  min-height: 560px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  outline: none;
  resize: vertical;
  font-family: 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Nanum Gothic', 'Dotum', sans-serif;
}

.simple-textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Manuscript Grid */
.manuscript-grid {
  flex: 1;
  background: white;
  border: 1px solid #f1f5f9;
  overflow: hidden;
  width: fit-content;
}

.manuscript-row {
  display: grid;
  grid-template-columns: repeat(20, minmax(35px, 40px));
  border-bottom: 1px solid #f1f5f9;
}

.manuscript-row:last-child {
  border-bottom: none;
}

.manuscript-cell {
  width: 100%;
  aspect-ratio: 1/1;
  max-width: 40px;
  border-right: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Nanum Gothic', 'Dotum', sans-serif;
  transition: all 0.15s ease;
  position: relative;
  background: white;
  user-select: text;
  text-align: center;
  line-height: 1;
  overflow: hidden;
  white-space: nowrap;
}

.manuscript-cell:last-child {
  border-right: none;
}

.manuscript-cell:hover {
  background: #f8fafc;
  transform: scale(1.05);
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.manuscript-cell.cursor {
  background: rgba(59, 130, 246, 0.15);
  font-weight: bold;
  z-index: 2;
}

.manuscript-cell.new-paragraph {
  background: #fef3c7;
  border: 2px dashed #f59e0b;
}

.manuscript-cell:focus {
  outline: none;
}

.manuscript-cell[contenteditable="true"] {
  outline: none;
  background: #f8fafc;
  border: 2px solid #3b82f6;
}

.manuscript-cell[contenteditable="true"]:focus {
  background: #eff6ff;
  border-color: #1d4ed8;
}

/* Ensure Korean text renders properly */
.manuscript-cell {
  unicode-bidi: plaintext;
  direction: ltr;
}

/* Input method support for Korean */
.manuscript-cell[contenteditable="true"] {
  ime-mode: active;
  -webkit-ime-mode: active;
  /* Hide blinking caret and disable selection while editing */
  caret-color: transparent;
  user-select: none;
}

/* Ensure Korean characters are preserved */
.manuscript-cell[contenteditable="true"]:focus {
  text-transform: none;
  font-variant: normal;
}

/* Prevent text transformation */
.manuscript-cell {
  text-transform: none;
  font-variant: normal;
  font-feature-settings: "liga" 0;
}

/* Spell Check Panel */
.spell-check-panel {
  width: 200px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  overflow-y: auto;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.spell-check-panel h4 {
  margin: 0 0 16px 0;
  color: #1e293b;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
}

.spell-check-item {
  margin-bottom: 16px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 4px solid #ef4444;
}

.error-word {
  word-break: break-word;
  display: block;
  font-weight: 600;
  color: #dc2626;
  margin-bottom: 4px;
  font-size: 14px;
}

.error-type {
  display: block;
  color: #6b7280;
  font-size: 12px;
  margin-bottom: 8px;
  font-style: italic;
}

.suggestions {
  margin-top: 8px;
}

.suggestions::before {
  content: "Suggestions: ";
  font-weight: 500;
  color: #374151;
  font-size: 12px;
}

.suggestion-btn {
  margin: 4px 4px 4px 0;
  padding: 4px 8px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.suggestion-btn:hover {
  background: #2563eb;
}

/* Editor Info */
.editor-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  font-size: 14px;
  color: #64748b;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-item span {
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .editor-container {
    flex-direction: column;
  }

  .spell-check-panel {
    width: 100%;
    max-height: 200px;
  }

  .manuscript-cell {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  .topik-manuscript-editor {
    margin: 0 8px;
  }

  .editor-toolbar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .toolbar-left,
  .toolbar-right {
    justify-content: center;
  }

  .manuscript-cell {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .editor-info {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .editor-container {
    padding: 12px;
  }

  .manuscript-cell {
    width: 18px;
    height: 18px;
    font-size: 9px;
  }

  .toolbar-btn {
    padding: 6px 8px;
    font-size: 12px;
  }
}

/* Print Styles */
@media print {

  .editor-toolbar,
  .spell-check-panel,
  .editor-info {
    display: none;
  }

  .manuscript-grid {
    border: 1px solid #000;
    box-shadow: none;
  }

  .manuscript-cell {
    border: 1px solid #ccc;
    background: white;
  }

  .manuscript-cell.cursor {
    background: white;
    color: black;
    box-shadow: none;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

  .manuscript-cell,
  .toolbar-btn {
    transition: none;
  }
}

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

  .manuscript-cell.cursor {
    background: #000;
    color: #fff;
  }

  .toolbar-btn {
    border: 2px solid #fff;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .topik-manuscript-editor {
    background: #1e293b;
    color: #e2e8f0;
  }

  .editor-container {
    background: #334155;
  }

  .manuscript-grid {
    background: #475569;
    border-color: #64748b;
  }

  .manuscript-cell {
    background: #475569;
    border-color: #64748b;
    color: #e2e8f0;
  }

  .manuscript-cell:hover {
    background: #64748b;
  }

  .spell-check-panel {
    background: #475569;
    border-color: #64748b;
  }

  .spell-check-item {
    background: #334155;
  }

  .editor-info {
    background: #334155;
    border-color: #64748b;
  }
}

/* Font loading optimization for Korean */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');

/* Ensure proper text rendering for Korean characters */
.manuscript-cell {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-display: swap;
}

/* AI ROLEPLAY SESSION */
.roleplay-chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: white;
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  background: transparent;
  scroll-behavior: smooth;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.roleplay-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-left h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.2;
}

.info-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.2s ease;
}

.info-icon:hover {
  color: #374151;
}

.info-icon i {
  font-size: 16px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-btn,
.close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.settings-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.header-right .close-btn:hover {
  background: #EF5350;
  color: white;
}


.settings-btn i,
.close-btn i {
  font-size: 16px;
}

.chat-messages-header {
  padding: 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.chat-messages-header h2 {
  margin: 0 0 8px 0;
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
}

.chat-messages-header p {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 768px) {
  .chat-messages-container {
    max-width: 100%;
    padding: 0 0.75rem;
  }

  .roleplay-chat-header {
    padding: 12px 16px;
  }

  .header-left h2 {
    font-size: 16px;
  }

  .info-icon {
    width: 18px;
    height: 18px;
  }

  .info-icon i {
    font-size: 14px;
  }

  .settings-btn,
  .close-btn {
    width: 28px;
    height: 28px;
  }

  .settings-btn i,
  .close-btn i {
    font-size: 14px;
  }

  .chat-messages-header {
    padding: 16px;
  }

  .chat-messages-header h2 {
    font-size: 18px;
  }

  .chat-messages-header p {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .chat-messages-container {
    padding: 0 0.5rem;
  }

  .roleplay-chat-header {
    padding: 10px 12px;
  }

  .header-left h2 {
    font-size: 15px;
  }

  .header-right {
    gap: 4px;
  }

  .settings-btn,
  .close-btn {
    width: 24px;
    height: 24px;
  }

  .settings-btn i,
  .close-btn i {
    font-size: 12px;
  }
}


.preview-roleplay-overlay-content {
  min-width: 250px;
  background: white;
  border-radius: var(--border-radius-12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 70vh;
}

/* Make overlay content responsive on smaller screens */
@media (max-width: 768px) {
  .preview-roleplay-overlay-content {
    min-width: auto;
    width: 100%;
    padding: 1rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .preview-roleplay-overlay-content {
    padding: 0.75rem 0.5rem;
  }
}


.roleplay-preview {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  border-radius: var(--border-radius-12);
  border: 1px solid var(--forms-third-border);
  min-width: 45rem;
}

.preview-card {
  background: white;
  max-width: 45rem;
  width: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.preview-loading {
  text-align: center;
  padding: 60px 20px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.preview-wrapper {
  display: flex;
  gap: 1.5rem;
}

.preview-wrapper-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 40%;
}

.preview-wrapper-left img {
  width: 280px;
  height: 280px;
  border-radius: var(--border-radius-8);
  object-fit: cover;
}

.preview-wrapper-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.preview-wrapper-right {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 60%;
}

.preview-wrapper-right-title {
  font-size: 2rem;
  font-weight: 400;
  color: #212121;
  line-height: 125%;
}

.preview-wrapper-right-subtitle {
  font-size: 0.75rem;
  font-weight: 400;
  color: #757575;
}

.preview-wrapper-right-goal {
  padding: 0.5rem;
  font-size: 1rem;
  color: #212121;
  background: #FAFAFA;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-radius: var(--border-radius-8);
  line-height: 150%;
}

.preview-wrapper-right-goal .label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preview-wrapper-right-key {
  padding: 0.5rem;
  font-size: 1rem;
  color: #212121;
  background: #FAFAFA;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-radius: var(--border-radius-8);
  line-height: 150%;
}

.preview-wrapper-right-key .label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preview-wrapper-right-key ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preview-actions {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr;
}

.btn-back {
  flex: 1;
  padding: 0.5rem 1rem;
  background: var(--white-color);
  color: #212121;
  border-radius: 100px;
  font-size: var(--font-size-14);
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #757575;
}

.btn-back:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e0;
}

.btn-start-roleplay {
  flex: 1;
  padding: 0.5rem 1rem;
  background: var(--primary-primary-default);
  color: var(--white-color);
  border: none;
  border-radius: 100px;
  font-size: var(--font-size-14);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 150%;
}

.btn-start-roleplay:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-back:disabled,
.btn-start-roleplay:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .roleplay-preview {
    min-width: 40rem;
  }

  .preview-card {
    max-width: 40rem;
  }

  .preview-wrapper-left img {
    width: 250px;
    height: 250px;
  }
}

@media (max-width: 768px) {
  .roleplay-preview {
    padding: 1rem;
    min-width: auto;
    min-height: 100vh;
  }

  .preview-card {
    max-width: 100%;
    gap: 1.5rem;
  }

  .preview-wrapper {
    flex-direction: column;
    gap: 1rem;
  }

  .preview-wrapper-left {
    width: 100%;
    align-items: center;
  }

  .preview-wrapper-left img {
    width: 200px;
    height: 200px;
  }

  .preview-wrapper-right {
    width: 100%;
  }

  .preview-wrapper-right-title {
    font-size: 1.5rem;
    text-align: center;
  }

  .preview-wrapper-right-subtitle {
    font-size: 0.875rem;
    text-align: center;
  }

  .preview-wrapper-right-goal,
  .preview-wrapper-right-key {
    padding: 0.75rem;
    font-size: 0.875rem;
  }

  .preview-actions {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .btn-back,
  .btn-start-roleplay {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .roleplay-preview {
    padding: 0.75rem;
  }

  .preview-card {
    gap: 1rem;
  }

  .preview-wrapper-left img {
    width: 150px;
    height: 150px;
  }

  .preview-wrapper-right-title {
    font-size: 1.25rem;
  }

  .preview-wrapper-right-subtitle {
    font-size: 0.75rem;
  }

  .preview-wrapper-right-goal,
  .preview-wrapper-right-key {
    padding: 0.5rem;
    font-size: 0.75rem;
  }

  .preview-wrapper-right-key ul {
    gap: 0.25rem;
  }

  .btn-back,
  .btn-start-roleplay {
    padding: 0.625rem 0.875rem;
    font-size: 0.75rem;
  }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .roleplay-preview {
    min-height: auto;
    padding: 0.5rem;
  }

  .preview-wrapper {
    flex-direction: row;
  }

  .preview-wrapper-left {
    width: 40%;
  }

  .preview-wrapper-left img {
    width: 120px;
    height: 120px;
  }

  .preview-wrapper-right {
    width: 60%;
  }

  .preview-wrapper-right-title {
    font-size: 1.25rem;
    text-align: left;
  }

  .preview-wrapper-right-subtitle {
    text-align: left;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .roleplay-preview {
    padding: 0.5rem;
  }

  .preview-wrapper-left img {
    width: 120px;
    height: 120px;
  }

  .preview-wrapper-right-title {
    font-size: 1.125rem;
  }

  .preview-wrapper-right-goal,
  .preview-wrapper-right-key {
    padding: 0.375rem;
    font-size: 0.625rem;
  }

  .btn-back,
  .btn-start-roleplay {
    padding: 0.5rem 0.75rem;
    font-size: 0.625rem;
  }
}

/* Library */
#library-section {
  max-height: calc(100vh - var(--header-height));
  overflow: auto;
}

.library-section .library-header {
  padding: 1.5rem 3.5rem;
  border-bottom: 1px solid var(--forms-third-border);
}

.library-section .library-content {
  padding: 1.5rem 3.5rem;
  overflow-y: auto;
}

.library-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media screen and (max-width: 1200px) {
  .library-items {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .library-items {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* AI LEVEL TEST */
#ai-level-test-section {
  height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-level-test-overview {
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.overview-container {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 400px;
  width: 100%;
  text-align: left;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid #f0f0f0;
}

.brain-icon {
  position: relative;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: flex-start;
}

.brain-icon-inner {
  position: relative;
  z-index: 2;
}

.overview-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 1rem 0;
  line-height: 1.3;
}

.overview-description {
  font-size: 0.95rem;
  color: #666;
  margin: 0 0 1.5rem 0;
  line-height: 1.5;
}

.test-details {
  margin-bottom: 2rem;
}

.detail-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #555;
}

.detail-item:last-child {
  margin-bottom: 0;
}

.detail-icon {
  margin-right: 0.5rem;
  font-size: 1rem;
}

.detail-text {
  font-weight: 500;
}

.start-test-btn {
  background: #FF6B35;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.start-test-btn:hover:not(:disabled) {
  background: #E55A2B;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.start-test-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.disclaimer {
  font-size: 0.75rem;
  color: #999;
  margin: 0;
  line-height: 1.4;
  text-align: center;
}

@media (max-width: 768px) {
  .overview-container {
    padding: 2rem;
    margin: 1rem;
    max-width: 350px;
  }

  .overview-title {
    font-size: 1.3rem;
  }

  .overview-description {
    font-size: 0.9rem;
  }

  .start-test-btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
  }
}

/* AI LEVEL TEST QUESTION */
.ai-level-test-question {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.question-container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  padding: 3rem;
  max-width: 700px;
  width: 100%;
}

.progress-section {
  margin-bottom: 2rem;
}

.question-content {
  margin-bottom: 2rem;
}

.question-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.question-description {
  font-size: 1.1rem;
  color: #7f8c8d;
  line-height: 1.6;
  margin: 0;
}

.answer-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.answer-option {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  gap: 0.5rem;
  cursor: pointer;
}

.option-radio {
  margin-right: 1rem;
  position: relative;
}

.option-radio input[type="radio"] {
  opacity: 0;
  position: absolute;
}

.radio-checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid #bdc3c7;
  border-radius: 50%;
  display: block;
  position: relative;
  transition: all 0.3s ease;
}

.answer-option.selected .radio-checkmark {
  border-color: #667eea;
  background: #667eea;
}

.answer-option.selected .radio-checkmark:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

.option-content {
  flex: 1;
}

.option-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  display: block;
  margin-bottom: 0.25rem;
}

.option-description {
  font-size: 0.95rem;
  color: #7f8c8d;
  line-height: 1.5;
}

.question-actions {
  margin-top: 2rem;
}

.action-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-primary,
.btn-secondary {
  padding: 1rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-secondary {
  background: #ecf0f1;
  color: #7f8c8d;
}

.btn-secondary:hover:not(:disabled) {
  background: #d5dbdb;
  transform: translateY(-2px);
}

.question-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: white;
}

.loading-spinner {
  font-size: 2rem;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .question-container {
    padding: 2rem;
    margin: 1rem;
  }

  .question-title {
    font-size: 1.5rem;
  }

  .answer-option {
    padding: 1rem;
  }

  .action-buttons {
    flex-direction: column;
    gap: 1rem;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

.ai-level-test-result {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #fff;
}

.result-card-minimal {
  width: 100%;
  max-width: 560px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  padding: 40px 32px;
  text-align: center;
  border: 1px solid #f0f0f0;
}

.rs-title {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 8px 0;
}

.rs-sub {
  font-size: 14px;
  color: #6b7280;
  margin: 0 0 28px 0;
}

.rs-level {
  margin: 0 0 16px 0;
}

.rs-level-text {
  font-size: 40px;
  font-weight: 700;
  color: #111827;
}

.rs-desc-line {
  margin: 0 0 4px 0;
  color: #6b7280;
  font-size: 14px;
}

.rs-desc {
  margin: 0 0 28px 0;
  color: #6b7280;
  font-size: 14px;
}

.rs-action {
  display: flex;
  justify-content: center;
}

.rs-btn-gradient {
  border: 0;
  border-radius: 9999px;
  padding: 14px 28px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, #ff9800, #ff2d8c);
}

.rs-btn-gradient:disabled {
  opacity: .7;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .result-card-minimal {
    margin: 0 16px;
    padding: 32px 24px;
  }

  .rs-level-text {
    font-size: 34px;
  }
}

/* Ai Voice Chat Styles */

.voice-chat-caller {
  background: var(--white-color);
  border-radius: var(--border-radius-12);
  padding: 1rem;
  box-shadow: 0 20px 40px -15px rgba(181, 69, 21, 0.10);
  height: 100%;
  width: 100%;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.glow-wrap {
  overflow: visible;
}

.glow-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 130%;
  height: 130%;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  background: radial-gradient(circle,
      rgba(255, 145, 0, 0.9) 0%,
      rgba(255, 145, 0, 0.5) 35%,
      rgba(255, 145, 0, 0.2) 70%);
  filter: blur(10px);
  animation: glowPulse 2.2s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

.glow-wrap img {
  position: relative;
  z-index: 1;
}

@keyframes glowPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: .9;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: .9;
  }
}

.glow-wrap-avatar::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 110%;
  height: 110%;
  transform: translate(-50%, -50%);
  border-radius: 9999px;
  background: linear-gradient(90deg, #FFE6C9 0%, #FFECDA 100%);
  filter: blur(12px);
}

.glow-wrap-avatar img {
  position: relative;
  z-index: 1;
}