* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Poppins", Tahoma, Geneva, sans-serif;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 50%, #16213e 100%);
  color: white;
  min-height: 100vh;
}
@keyframes bounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  30% {
    transform: translateY(-20px) scale(1.05);
  }
  50% {
    transform: translateY(0) scale(0.98);
  }
  65% {
    transform: translateY(-10px) scale(1.02);
  }
  80% {
    transform: translateY(0) scale(1);
  }
}

@keyframes smoothEntry {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

p {
  font-weight: thin;
  color: rgba(255, 255, 255, 0.7);
}

header {
  padding: 20px 40px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header a {
  text-decoration: none;
}

.header img {
  width: 9rem;
  height: 3rem;
}
.header h1 {
  font-size: 2.5rem;
  background: linear-gradient(45deg, #4caf50, #2196f3, #9c27b0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hamburger Menu Styles */
.hamburger {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  z-index: 101;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: #4caf50;
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile menu styles */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    transition: left 0.3s ease;
    padding: 20px;
    z-index: 99;
  }

  .nav-menu.active {
    left: 0;
  }

  .header {
    position: relative;
  }

  .user-stats {
    margin-left: auto;
  }
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-menu ul {
  list-style: none;
  display: flex;
  gap: 20px;
}

.nav-menu a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 1.1rem;
  position: relative;
  transition:
    color 0.3s ease,
    transform 0.3s ease;
  padding-bottom: 5px;
}

.nav-menu a:hover {
  color: #4caf50;
  transform: translateY(-2px);
}

.nav-menu a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: #4caf50;
  transition: width 0.3s ease;
}

.nav-menu a:hover::after {
  width: 100%;
}

.nav-menu a.active {
  color: #4caf50;
  font-weight: 600;
  background: rgba(76, 175, 80, 0.2);
  border-radius: 5px;
  padding: 5px 10px;
}

.nav-menu a.active::after {
  width: 100%;
  background-color: #4caf50;
}

.nav-menu a:focus {
  outline: 2px solid #4caf50;
  outline-offset: 2px;
  border-radius: 5px;
}

.search-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

#video-search,
#story-search,
#therapist-search,
#about-search {
  width: 200px;
  padding: 8px 12px;
  border: none;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
  outline: none;
  transition: background 0.3s ease;
}

#video-search::placeholder,
#story-search::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

#video-search:focus,
#story-search:focus {
  background: rgba(255, 255, 255, 0.2);
}

.search-button {
  background: #4caf50;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s ease;
}

.search-button:hover {
  background: #45a049;
}

.no-results {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.2rem;
  padding: 20px;
}

.user-stats {
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 20px;
  border-radius: 25px;
  backdrop-filter: blur(10px);
}

.video-player-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 0;
  display: flex;
  flex-direction: row;
  gap: 10px;
  min-height: calc(100vh - 80px);
  position: relative;
  align-items: flex-start;
}

.video-stats-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky; /* Changed from relative */
  top: 100px; /* Add spacing from top */
  align-self: flex-start; /* Add this */
}

.video-content {
  position: relative;
  min-width: 0;
  width: 100%;
}

.video-title-wrap {
  background: rgba(255, 255, 255, 0.1);
  padding: 5px;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  color: #4caf50;
  display: flex;
}

.video-title-wrap h2 {
  font-size: 1rem;
  font-weight: 200;
  margin-bottom: 25px;
  color: #fff;
}

.story-reader {
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  max-height: 60vh;
  overflow-y: auto;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

.story-reader::-webkit-scrollbar {
  width: 8px;
}

.story-reader::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.story-reader::-webkit-scrollbar-thumb {
  background: #4caf50;
  border-radius: 4px;
}

.story-reader::-webkit-scrollbar-thumb:hover {
  background: #45a049;
}

.thumbnail-grid {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: auto;
  overflow-y: auto;
  min-height: 0;
  align-items: center;
}

.thumbnail-grid::-webkit-scrollbar {
  width: 8px;
}

.thumbnail-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.thumbnail-grid::-webkit-scrollbar-thumb {
  background: #4caf50;
  border-radius: 4px;
}

.thumbnail-grid::-webkit-scrollbar-thumb:hover {
  background: #45a049;
}

.points-display {
  position: absolute;
  top: 30px;
  right: 50vh;
  background: rgba(0, 0, 0, 0.8);
  padding: 10px;
  border-radius: 5px;
  font-size: 18px;
  font-weight: bold;
  color: #4caf50;
}

.nav-buttons {
  margin: 10px 0;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.nav-button {
  background: #4caf50;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s ease;
}

.nav-button:hover {
  background: #45a049;
}

#next-story {
  position: relative;
  bottom: 75px;
  left: 150px;
}
.story-content {
  position: relative;
  width: 100%;
  min-height: 400px;
}

.quiz-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 20%;
  box-sizing: border-box;
}

#text-overlay {
  max-width: 50%;
  text-align: center;
  font-size: 1.2em;
  z-index: 10;
  position: absolute;
  top: 80%;
  left: 10%;
  right: 10%;
  padding: 10px;
  border-radius: 20px;
  animation: bounce 1s ease-in-out;
  display: none;
  background: linear-gradient(45deg, #4caf50, #2196f3, #9c27b0);
  color: white;
  padding: 10px;
  text-align: center;
}

.prompt-overlay {
  z-index: 20;
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
}

.prompt-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 20px;
  border-radius: 5px;
}

#prompt-question {
  font-size: 18px;
  margin-bottom: 10px;
  color: #333;
  font-weight: bold;
}

#prompt-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#prompt-feedback {
  margin-top: 10px;
  color: green;
}

.prompt-button {
  padding: 10px;
  background: #581a95;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.prompt-button:hover {
  background: #632e97;
}

.quiz-button {
  background: #4caf50;
  color: white;
  border: none;
  padding: 10px;
  font-size: 1em;
  cursor: pointer;
  border-radius: 5px;
  transition: background 0.3s;
}

.quiz-button:hover {
  background: #45a049;
}

#quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 500px;
}

.quiz-feedback {
  margin-top: 15px;
  font-size: 18px;
  font-weight: bold;
}

.quiz-feedback.correct {
  color: #4caf50;
}

.quiz-feedback.wrong {
  color: #ff4444;
}

.story-segment {
  margin-bottom: 20px;
}
.initial-segment {
  font-weight: normal;
}
.continuation-segment {
  font-style: italic; /* Optional: to differentiate visually */
}
.story-divider {
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin: 20px 0;
}

.hidden-text {
  opacity: 0;
  transition: opacity 0.5s ease;
}
#text-overlay {
  opacity: 1;
  transition: opacity 0.5s ease;
}

.stats-panel {
  background: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 10px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #333;
  border-radius: 5px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #2196f3);
  width: 0%;
  transition: width 0.3s ease;
}

.main-content {
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 30px;
  color: #fff;
  font-weight: 300;
}

.video-grid {
  margin-bottom: 60px;
}

.card-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.video-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  cursor: pointer;
  min-width: 250px;
  overflow: hidden;
  margin-top: 5px;
}

.story-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  cursor: pointer;
  min-width: 250px;
  overflow: hidden;
  margin-top: 5px;
}

.video-card:hover,
.story-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(76, 175, 80, 0.5);
}

.thumbnail-card {
  max-width: 300px;
  display: flex;
  flex-direction: column;
  margin-left: 0;
  min-height: 0;
  height: auto;
}

.story-thumbnail {
  max-width: 300px;
  display: flex;
  flex-direction: column;
  margin-left: 0;
  min-height: 0;
  height: auto;
}

.thumbnail-card:hover,
.story-thumbnail:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(76, 175, 80, 0.5);
}

.video-thumbnail {
  position: relative;
  width: 100%;
  height: 225px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumbnail-card .video-thumbnail,
.story-thumbnail .video-thumbnail {
  height: 150px;
  background-size: cover;
  background-position: center;
}

.video-thumbnail::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.video-card:hover .video-thumbnail::before,
.story-card:hover .video-thumbnail::before,
.thumbnail-card:hover .video-thumbnail::before,
.story-thumbnail:hover .video-thumbnail::before {
  opacity: 1;
}

.play-button {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.video-card .play-button::after,
.thumbnail-card .play-button::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 25px solid #333;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  margin-left: 5px;
}

.story-card .play-button,
.story-thumbnail .play-button {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.story-card .play-button::after,
.story-thumbnail .play-button::after {
  content: "📖";
  font-size: 40px;
  color: #333;
  margin: 0;
  width: auto;
  height: auto;
  border: none;
}

.thumbnail-card .play-button,
.story-thumbnail .play-button {
  width: 40px;
  height: 40px;
}

.thumbnail-card .play-button::after {
  border-left: 12px solid #333;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  margin-left: 2px;
}

.story-thumbnail .play-button::after {
  font-size: 20px;
}

.video-card:hover .play-button,
.story-card:hover .play-button,
.thumbnail-card:hover .play-button,
.story-thumbnail:hover .play-button {
  background: #4caf50;
  transform: scale(1.1);
}

.video-card:hover .play-button::after,
.thumbnail-card:hover .play-button::after {
  border-left-color: white;
}

.story-card:hover .play-button::after,
.story-thumbnail:hover .play-button::after {
  color: white;
}

.video-info {
  padding: 20px;
}

.thumbnail-card .video-info,
.story-thumbnail .video-info {
  padding: 10px;
  text-align: center;
}

.video-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 10px;
  color: #fff;
}

.thumbnail-card .video-title,
.story-thumbnail .video-title {
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.video-description {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  font-size: 0.8rem;
  max-height: 3em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: inherit;
  -webkit-box-orient: vertical;
}

.video-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #2196f3);
  transition: width 0.3s ease;
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 40%;
  height: 70%;
  z-index: 1000;
  backdrop-filter: blur(5px);
  margin-left: 60%;
  margin-top: 30vh;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 800px;
  height: 80vh;
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px;
  background: rgba(0, 0, 0, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}

.close-button {
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-button:hover {
  color: #ff4444;
}

.modal-body {
  flex: 1;
  padding: 0;
  overflow: hidden;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.fullscreen-button {
  background: #4caf50;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  margin: 20px;
  transition: background 0.3s ease;
}

.fullscreen-button:hover {
  background: #45a049;
}

.error-message {
  color: #ff4444;
  text-align: center;
  padding: 20px;
  font-size: 18px;
  font-weight: bold;
}

.chatbot-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: #4caf50;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition:
    background 0.3s ease,
    transform 0.3s ease;
  z-index: 999;
}

.chatbot-icon:hover {
  background: #45a049;
  transform: scale(1.1);
}

.chatbot-icon-symbol {
  font-size: 24px;
}

@media (max-width: 1200px) {
  .card-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header {
    padding: 15px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .nav-menu {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .nav-menu ul {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .nav-menu a {
    font-size: 1rem;
  }

  .search-container {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  #video-search,
  #story-search,
  #therapist-search,
  #about-search {
    width: 100%;
  }

  .search-button {
    width: 100%;
    padding: 10px;
  }

  .user-stats {
    margin-top: 10px;
    align-self: center;
  }

  .video-player-wrapper,
  .story-reader-container {
    flex-direction: column;
    padding: 10px; /* Reduced padding for more space */
  }

  .video-stats-container {
    flex: none;
    width: 100%;
  }

  .video-content {
    width: 100%;
    padding: 0; /* Remove any padding */
  }

  /* Make video take full width */
  #interactive-video,
  .video-js {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9; /* Maintain proper video proportions */
  }

  /* Adjust thumbnail grid for mobile */
  .thumbnail-grid {
    flex: none;
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    overflow-x: hidden;
  }

  /* Hide or minimize points display on mobile */
  .points-display {
    position: static; /* Changed from absolute */
    text-align: center;
    margin: 10px 0;
    right: auto;
  }

  .main-content {
    padding: 20px;
  }

  .card-container {
    grid-template-columns: 1fr;
  }

  .video-player-wrapper,
  .story-reader-container {
    flex-direction: column;
  }

  .thumbnail-grid {
    flex: none;
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
    overflow-x: hidden;
  }

  .thumbnail-card,
  .story-thumbnail {
    flex: 0 1 calc(50% - 15px);
    max-width: 180px;
    min-width: 140px;
    margin: 0;
  }

  .thumbnail-card .video-thumbnail,
  .story-thumbnail .video-thumbnail {
    height: 100px;
  }

  .thumbnail-card .play-button,
  .story-thumbnail .play-button {
    width: 32px;
    height: 32px;
  }

  .thumbnail-card .play-button::after {
    border-left: 12px solid #333;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    margin-left: 3px;
  }

  .story-thumbnail .play-button::after {
    font-size: 18px;
  }

  .thumbnail-card .video-title,
  .story-thumbnail .video-title {
    font-size: 0.85rem;
  }

  .thumbnail-card .video-description,
  .story-thumbnail .video-description {
    font-size: 0.75rem;
    max-height: 2.25em;
  }
}

/* Responsive chatbot modal for mobile */
@media (max-width: 768px) {
  .modal {
    width: 80%;
    height: 70%;
    margin-left: 10%;
    margin-top: 15vh;
  }

  .modal-content {
    width: 100%;
    max-width: 100%;
    height: 80vh;
  }
}

@media (max-width: 480px) {
  .modal {
    width: 90%;
    height: 75%;
    margin-left: 5%;
    margin-top: 12.5vh;
  }

  .modal-content {
    width: 100%;
    max-width: 100%;
    height: 85vh;
  }
  .thumbnail-grid {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0 10px;
  }

  .thumbnail-card,
  .story-thumbnail {
    flex: 0 1 100%;
    max-width: 100%;
    min-width: 0;
  }

  .thumbnail-card .video-thumbnail,
  .story-thumbnail .video-thumbnail {
    height: 120px;
  }

  .thumbnail-card .play-button,
  .story-thumbnail .play-button {
    width: 28px;
    height: 28px;
  }

  .thumbnail-card .play-button::after {
    border-left: 10px solid #333;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    margin-left: 2px;
  }

  .story-thumbnail .play-button::after {
    font-size: 16px;
  }

  .thumbnail-card .video-title,
  .story-thumbnail .video-title {
    font-size: 0.9rem;
  }

  .thumbnail-card .video-description,
  .story-thumbnail .video-description {
    font-size: 0.8rem;
    max-height: 2.4em;
  }

  .video-content,
  .story-reader {
    width: 100%;
    padding: 0 2px;
  }
}
