body {
  background-color: #fffaff;
  background-image: radial-gradient(#ddd 1px, transparent 1px);
  background-size: 20px 20px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h2 {
  margin: 6px;
  color: #575458;
  font-size: 1rem;
  font-style: italic;
}

h4 {
  color: #666;
  font-size: 14px;
  margin: 5px 0;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #7b6b7d;
  padding: 10px 20px;
  height: 60px;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  cursor: pointer;
  color: #d935a0;
  margin: 0;
}

header menu {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

header li {
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  color: #332a35;
  transition: ease-in 0.3s;
}

header li:hover {
  transform: scale(0.88);
}

header li a {
  color: #7b6b7d;
  text-decoration: none;
  transition: color 0.3s ease;
}

header li a:hover {
  color: #d935a0;
}
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 9px;
  flex: 1;
}

.hero-text {
  font-size: 1.1rem;
  line-height: 1.4;
  font-weight: 600;
  text-align: center;
  max-width: 850px;
  margin: 27px auto 3px;
  color: #574758;
}

.hero-text strong {
  color: #d935a0;
  font-weight: 700;
}


#features {
  display: flex;
  gap: 15px;
  margin: 40px 0;
  justify-content: space-between;
}

#feature-item {
  flex: 1;
  background: transparent;
  color: #7b6b7d;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  border: 2px solid #7b6b7d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 100px;
  transition: all 0.3s ease;
  cursor: pointer;
}

#feature-item:hover {
  background: #ffffff;
  color: #d935a0;
  border-color: #d935a0;
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(217, 53, 160, 0.3);
}

#inputArea {
  position: relative;
  display: flex;
  align-items: center;
  margin: 5px auto;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  gap: 6px;
  border: 2px solid #d935a0;
}

#userInput {
  width: 100%;
  margin: 12px;
  padding: 15px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  outline: none;
}

#urlInput:focus {
  outline: none;
  border: none;
}

#userInput:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
  opacity: 0.6;
}

.upload-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border-radius: 8px;
  margin-right: 5px;
}

.upload-btn:hover {
  background: rgba(217, 53, 160, 0.1);
  transform: scale(1.1);
}

.upload-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.upload-btn svg {
  stroke: #d935a0;
}

#liveStaus {
  text-align: left;
  margin: 12px 0px;
  font-weight: 600;
  color: #5b525c;
}

.btns-wrapper {
  display: flex;
  gap: 15px;
  margin: 20px 0;
  justify-content: center;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(150deg, #ff8cad, #d935a0);
  color: white;
  margin: 12px;
  padding: 12px 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  transition: ease-in 0.3s;
}

.action-btn:hover {
  transform: scale(0.88);
}

.action-btn:disabled {
  cursor: not-allowed;
  transform: scale(1);
}

.output-section {
  background: #ffffff;
  border-radius: 6px;
  padding: 18px;
  margin: 18px 0;
  box-shadow: 0 1px 4px rgba(54, 50, 54, 0.3);
}

.output-section.error {
  background: #ffe6e6;
  border-left: 4px solid #ff4444;
}

.gen-title {
  color: #311d30;
  margin: 6px;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
  font-style: normal;
}

/* AI summary section */

.ai-summary ul {
  list-style: none;
  padding-left: 0;
  margin: 15px 0;
}

.ai-summary li {
  padding: 8px 0 8px 25px;
  position: relative;
  line-height: 1.6;
}

.ai-summary li::before {
  content: "•";
  position: absolute;
  left: 8px;
  color: #d935a0;
  font-weight: bold;
  font-size: 18px;
}

.ai-summary p {
  line-height: 1.6;
  margin: 10px 0;
}

.ai-summary strong {
  font-weight: 700;
}

.ai-summary code {
  background-color: rgba(183, 174, 187, 0.795);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.9em;
}

.summary-stats {
  display: flex;
  gap: 20px;
  padding: 9px;
  border-top: 1px solid #ddd;
  font-size: 13px;
  color: #666;
}

/* Flashcard Sections */

.flashcard-carousel-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 30px 0;
}

.flashcard-track-container {
  overflow: hidden;
  width: 100%;
  position: relative;
}

.flashcard-track {
  display: flex;
  gap: 20px;
  transition: transform 0.4s ease-in-out;
  padding: 10px 0;
}

.flashcard {
  min-width: 320px;
  width: 320px;
  height: 480px;
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  position: relative;
  overflow: hidden;
}

.flashcard:hover {
  transform: translateY(-5px);
}

.flashcard-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  max-height: 400px;
  padding-bottom: 60px;
}

.flashcard-title {
  font-size: 17px;
  font-weight: 700;
  color: #311d30;
  margin-bottom: 20px;
  text-align: left;
  line-height: 1.3;
}

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

.flashcard-points li {
  padding: 12px 15px;
  margin: 8px 0;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  font-size: 15.5px;
  line-height: 1.4;
  color: #463949;
  position: relative;
  padding-left: 35px;
  font-weight: 500;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.flashcard-points li:has(+ li) {
  font-size: 14.5px;
}

.flashcard-points li:only-child {
  font-size: 15px;
}

.flashcard-points li::before {
  content: "•";
  position: absolute;
  left: 12px;
  font-weight: bold;
  font-size: 16px;
}

.flashcard-footer {
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: 24px;
  text-align: center;
  padding-top: 12px;
  border-top: 2px solid rgba(0, 0, 0, 0.1);
  color: #d935a0;
  font-weight: 600;
  font-size: 1.2rem;
}

.flashcard-number {
  background: rgba(0, 0, 0, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-left: 6px;
}

.carousel-btn {
  background: white;
  border: 2px solid #d935a0;
  border-radius: 50%;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  padding: 0;
  margin: 0;
}

.carousel-btn:disabled {
  cursor: not-allowed;
  opacity: 0.3;
  border-color: #ddd;
}

.carousel-btn:not(:disabled):hover {
  background: #d935a0;
  border-color: #d935a0;
  transform: scale(1.05);
}

.carousel-btn:not(:disabled):hover svg {
  stroke: white;
}

.carousel-btn svg {
  stroke: #d935a0;
  transition: stroke 0.3s ease;
}

.carousel-btn:not(:disabled):hover svg {
  stroke: white;
}

.carousel-indicators {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
  font-size: 14px;
  font-weight: 600;
  color: #666;
}

#carouselPosition {
  background: #f0f0f0;
  padding: 8px 16px;
  border-radius: 20px;
}

/* Quiz Secttion */

.quiz-carousel-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 30px 0;
}

.quiz-track-container {
  overflow: hidden;
  width: 100%;
  position: relative;
}

.quiz-track {
  display: flex;
  transition: transform 0.4s ease-in-out;
}

.quiz-card {
  min-width: 100%;
  width: 100%;
  padding: 30px;
  box-sizing: border-box;
}

.quiz-question-number {
  background: #f0f0f0;
  padding: 8px 16px;
  border-radius: 20px;
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  margin-bottom: 20px;
}

.quiz-question {
  font-size: 20px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 25px;
  line-height: 1.5;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.quiz-option {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  background: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quiz-option:hover {
  background: #e8f4f8;
  border-color: #667eea;
}

.quiz-option input[type="radio"] {
  margin-right: 15px;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.quiz-option .option-text {
  flex: 1;
  font-size: 16px;
  color: #34495e;
}

.quiz-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}

#quizPosition {
  background: #f0f0f0;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: #666;
}

.quiz-results {
  margin-top: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 10px;
}

.quiz-results.hidden {
  display: none;
}

.quiz-score {
  text-align: center;
  margin-bottom: 30px;
}

.quiz-score h3 {
  font-size: 28px;
  color: #2c3e50;
  margin-bottom: 15px;
}

.score-bar {
  width: 100%;
  height: 30px;
  background: #e0e0e0;
  border-radius: 15px;
  overflow: hidden;
  margin: 15px 0;
}

.score-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff8cad, #d935a0);
  transition: width 0.5s ease;
}

.quiz-answers {
  margin-top: 20px;
}

.quiz-answers h4 {
  font-size: 20px;
  color: #2c3e50;
  margin-bottom: 15px;
}

.answer-item {
  padding: 15px;
  margin: 10px 0;
  border-radius: 8px;
  border-left: 4px solid #ddd;
}

.answer-item.correct {
  background: #e8f5e9;
  border-left-color: #27ae60;
}

.answer-item.incorrect {
  background: #ffebee;
  border-left-color: #e74c3c;
}

.answer-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
  font-size: 14px;
}

.user-answer {
  color: #666;
}

.correct-answer {
  color: #27ae60;
  font-weight: 600;
}

.quiz-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.quiz-modal {
  background: white;
  border-radius: 12px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

.quiz-modal h3 {
  margin: 0 0 15px 0;
  font-size: 22px;
  color: #2c3e50;
}

.quiz-modal p {
  margin: 0 0 25px 0;
  color: #666;
  line-height: 1.5;
  font-size: 15px;
}

.quiz-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.quiz-modal-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quiz-modal-btn.cancel {
  background: #f0f0f0;
  color: #666;
}

.quiz-modal-btn.cancel:hover {
  background: #e0e0e0;
}

.quiz-modal-btn.submit {
  background: linear-gradient(150deg, #ff8cad, #d935a0);
  color: white;
}

.quiz-modal-btn.submit:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(217, 53, 160, 0.3);
}

/* footer section */
footer {
  text-align: center;
  font-weight: 600;
  color: #7b6b7d;
  padding: 9px 0;
  margin-top: auto;
  font-size: 0.9rem;
  border-top: 1px solid #e0e0e0;
}

/* Animations */

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* == RESPONSIVE DESIGN == */
@media (max-width: 768px) {
  .flashcard-track-container {
    width: 340px;
  }

  .flashcard {
    min-width: 280px;
    width: 280px;
    height: 420px;
    padding: 20px;
  }

  .flashcard-title {
    font-size: 18px;
  }

  .flashcard-points li {
    font-size: 13px;
    padding: 10px 12px 10px 32px;
  }

  .carousel-btn {
    width: 40px;
    height: 40px;
  }
}