.tiles-container {
  max-width: 100% !important;
  width: 100% !important;
  padding: 15px 0 0 0 !important; /* top padding 15px, others 0 */
  margin: 0 !important;
  box-sizing: border-box;
}

.container {
  width: 100% !important;       /* fills full width of parent */
  max-width: none !important;   /* no max width restrictions */
  padding: 0 30px !important;   /* keep your horizontal padding */
  box-sizing: border-box;       /* include padding in width */
}

.topic-box {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background-color: #f9f9f9; /* light grey background */
  border-radius: 5px;
  margin-bottom: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.toggle-button {
  border: none !important;
  outline: none !important;
  color: black;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: #f0f0f0;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 5px; /* applies to all four corners */
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.toggle-button:hover,
.toggle-button.active {
  background-color: #28a745;
  color: #fff;
}

.toggle-button .stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #555;
}

.toggle-button:hover .stats,
.toggle-button.active .stats {
  color: #fff;
}

/* Make .video-count white when .toggle-button is hovered */
.toggle-button:hover .video-count,
.toggle-button.active .video-count {
  color: #fff;
}

.chevron {
  transition: transform 0.3s;
}

.rotate-180 {
  transform: rotate(180deg);
}

.topic-content {
  padding: 1rem;
  display: none;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* exactly 4 per row on desktop */
  gap: 1rem;
}

.video-card {
  background: white;
  padding: 0.5rem 0.5rem 0.1rem 0.5rem; /* reduce top padding to shrink height */
  border-radius: 5px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 180px;  /* limit iframe height to make it shorter */
  border-radius: 5px;
  object-fit: cover;  /* ensures video scales nicely within constrained height */
}

.video-title {
  margin-top: 0.4rem;
  margin-bottom: 0;
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 1.2rem; 
  font-weight: 550;
  font-family: Arial, sans-serif;
  color: #0f0f0f; /* YouTube's title color */
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.no-videos {
  color: #888;
  font-style: italic;
}

.video-count {
  font-weight: bold;
  font-size: 1rem;
  color: #333;
}

.lazy-iframe {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
  cursor: pointer;
}

.lazy-iframe .iframe-placeholder {
  position: absolute;
  top: 0; left: 0;
  right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  background: rgba(0,0,0,0.6);
  transition: background 0.3s;
}

.lazy-iframe:hover .iframe-placeholder {
  background: rgba(0,0,0,0.8);
}

.video-title-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding-top: 5px;  /* your padding from before */
  padding-bottom: 5px;
}

.menu-button {
  background: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  color: #0f0f0f; /* match your title color */
  padding: 0 5px;
  user-select: none;
}

@media (max-width: 768px) {
  .menu-button {
    font-size: 2.2rem; /* or whatever size you want */
  }
}

.menu-button:hover {
  color: #555;
}

/* Menu popup styling */
.menu-popup {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  border-radius: 4px;
  z-index: 100;
  width: 250px;
  font-family: sans-serif;
}

/* Remove default list styles */
.menu-popup ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Popup list items */
.menu-popup ul li.rate-option {
  display: flex;
  justify-content: space-between; /* pushes text left, emoji right */
  align-items: center;
  padding: 8px 12px;
  font-size: 16px;
  line-height: 1.4;
  cursor: pointer;
  color: #333;
  white-space: nowrap;
  border-bottom: 1px solid #ddd;
}

/* Remove border from last item */
.menu-popup ul li.rate-option:last-child {
  border-bottom: none;
}

/* Emoji placement — far right */
.menu-popup .rate-option::after {
  margin-left: auto;      /* push emoji to far right */
  text-align: right;
}

/* Rating-specific icons */
.menu-popup .rate-option[data-rating="unsure"]::after {
  content: "😞";
  color: #d9534f;
}
.menu-popup .rate-option[data-rating="okay"]::after {
  content: "😐";
  color: #f0ad4e;
}
.menu-popup .rate-option[data-rating="confident"]::after {
  content: "🙂";
  color: #5cb85c;
}

/* Hover effects — lighter shades */
.menu-popup .rate-option[data-rating="unsure"]:hover {
  background-color: #f8d7da; /* light red/pink */
}
.menu-popup .rate-option[data-rating="okay"]:hover {
  background-color: #fff3cd; /* light yellow */
}
.menu-popup .rate-option[data-rating="confident"]:hover {
  background-color: #d4edda; /* light green */
}

@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: 1fr;
  }

  .container {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
    box-sizing: border-box;
  }
}


/* Modal backdrop covers entire viewport and centers modal content */
#signupModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5); /* semi-transparent black */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000; /* Ensure it sits above other content */
  padding: 1rem; /* Add padding so modal doesn't touch edges on very small screens */
  box-sizing: border-box;
}

/* Modal content box */
#signupModal .modal-content {
  background-color: white;
  padding: 2rem;
  border-radius: 12px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  text-align: center;
  width: 100%; /* allow modal content to shrink/grow inside the padding */
  box-sizing: border-box;
}

/* Modal logo styling with fixed pixel size */
#signupModal .modal-logo {
  display: block;
  margin: 0 auto 1.5rem auto;
  width: 250px;   /* fixed width */
  height: 80px;   /* fixed height - adjust as needed */
  object-fit: contain; /* preserve aspect ratio */
}

@media (max-width: 480px) {
  #signupModal .modal-logo {
    width: 170px;  /* smaller width on mobile */
    height: 50px;  /* proportional smaller height */
  }
}

/* Increase paragraph text size except on mobile */
#signupModal p {
  font-size: 1.25rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 480px) {
  #signupModal {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  /* Reset paragraph text size on mobile */
  #signupModal p {
    font-size: 1rem;
  }
}

/* Modal buttons container - stack vertically */
#signupModal .modal-buttons {
  display: flex;
  flex-direction: column; /* stack vertically */
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Buttons take full width and have padding */
#signupModal .signup-button,
#signupModal .maybe-later-button {
  width: 100%;
  padding: 1rem 1.5rem; /* increased vertical padding for better tap targets */
  box-sizing: border-box;
  font-size: 1.25rem;
  border-radius: 0.5rem;
}

/* Sign Up button styling */
#signupModal .signup-button {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #DAA520;
  color: white;
  border: none;
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

#signupModal .signup-button:hover {
  background-color: #B8860B;
}

/* Maybe Later button styling */
#signupModal .maybe-later-button {
  border: 1px solid grey;
  background-color: white;
  color: black; /* black text */
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.3s ease;
  border-radius: 0.5rem; /* match sign up button */
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Make the text inside span black */
#signupModal .maybe-later-button span {
  color: black;
}

/* On hover/click: only border changes color, text stays black, background stays white */
#signupModal .maybe-later-button:hover,
#signupModal .maybe-later-button:focus {
  border-color: #DAA520;
  color: black;
  background-color: white; /* ensure background stays white */
}

#signupModal .maybe-later-button:hover span,
#signupModal .maybe-later-button:focus span {
  color: black;
}


.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}

.red-dot {
  background-color: red;
}

.yellow-dot {
  background-color: yellow;
  border: 1px solid #aaa; /* optional for contrast */
}
