:root {
  --navbar-height: 70px; /* Bootstrap default */
}

/* If you changed navbar size later, update only this */

body {
  font-family: sans-serif;
  margin: 0;
  padding-top: var(--navbar-height);
}

.btn.dropdown-toggle::after {
    display: none !important;
}

/* Reduce padding of each dropdown item (optional, but makes it cleaner) */
.dropdown-item {
    padding-top: 0rem !important;
    padding-bottom: 0rem !important;
}

.nav-link.active-tab {
    border-bottom: 2px solid white;
    padding-bottom: 2px;
}

form { 
    margin-bottom: 2rem; 
}

form.row {
    flex-wrap: wrap;
}

input, select, button { 
    padding: 6px; font-size: 1rem; 
}
                        
iframe { 
    width: 320px; height: 180px; border: none; 
}

/* add a smooth transition for hover */
a.badge {
    transition: background-color 150ms ease, color 150ms ease;
}

/* override Bootstrap bg-secondary on hover/focus */
a.badge.bg-secondary:hover,
a.badge.bg-secondary:focus {
    background-color: #0d6efd !important; /* Bootstrap primary blue */
    color: #ffffff !important;
    text-decoration: none !important;
}

.position-sticky {
  top: calc(var(--navbar-height) + 20px);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.list-group-item a:hover {
  background-color: #6c757d; /* Bootstrap secondary */
  color: white !important;
  text-decoration: none;
}

.list-group-item a.fw-bold {
  box-shadow: inset 0 0 5px rgba(255,255,255,0.2);
}

.video-item {
  align-items: flex-start;
  max-width: 100%;
  word-wrap: break-word;
}

.video-embed iframe {
  display: block;
  border-radius: 8px;
}

.video-info {
  flex: 1;
  min-width: 250px;
}

.video-title {
  font-size: 2rem; /* larger title */
  margin-bottom: 0.25rem;
  color: #000;
  overflow-wrap: anywhere;
}

.video-channel {
  font-size: 1.1rem;
  color: #ccc;
  margin-bottom: 0.5rem;
  overflow-wrap: anywhere;
}

.video-duration {
  font-size: 1rem;
  color: #ccc;
  margin-bottom: 0.5rem;
  overflow-wrap: anywhere;
}

.video-item p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

html, body {
  overflow-x: hidden; /* Hide horizontal scrollbar */
}

iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Sidebar wrapper: relative positioning context --- */
.sidebar-wrapper {
  position: relative;
  margin-right: 0rem;
  padding-right: 0rem;
}

/* --- Preferred sticky behavior (works in most layouts) --- */
.sidebar-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: calc(var(--navbar-height) + 20px);    /* space under navbar */
  max-height: calc(100vh - 110px);           /* fit into viewport */
  overflow-y: auto;                          /* scroll inside sidebar if long */
  z-index: 1020;
  width: 100%;                               /* fill the column */
}

.sidebar-fixed {
  position: fixed;
  top: 80px;
  right: 0;
  width: 25%; /* for col-md-3 in a 12-col grid */
  max-width: 300px; /* optional */
}

/* ensure ancestors don't clip sticky */
.container, .row, .page-content {
  overflow: visible !important;
  transform: none !important; /* transforms create new stacking context & break sticky */
  padding-left: 0;
  padding-right: 0;
  margin-left: 0.5rem;
  overflow: visible !important;
}

.container-list-group {
  overflow: visible !important;
  transform: none !important; /* transforms create new stacking context & break sticky */
  padding-left: 0;
  padding-right: 0;
  overflow: visible !important;
}

#collapseGlobal > div {
  padding: 0.5rem 0.75rem;
}

/* 🎵 Playlist link styling */
.playlist-link {
    transition: color 0.25s ease, background-color 0.25s ease;
}

/* Default (non-active) hover effect */
.playlist-link:hover {
    color: #0d6efd !important; /* Bootstrap primary blue */
    background-color: rgba(13, 110, 253, 0.08); /* subtle blue tint background */
}

/* Active (green) playlist hover */
.playlist-link.bg-success:hover {
    background-color: #2ecc71 !important; /* a fresh green */
    color: #ffffff !important;
}

.monster {
  transition: transform 0.3s ease, filter 0.3s ease;
  display: inline-block;
  background: transparent;
  border-radius: 50%;
  border: none;
  outline: none;
  text-align: center;
  padding: 0;
}

.monster:hover {
  transform: scale(1.05);
}

.monster.evolving {
  animation: evolve 0.6s ease-in-out;
  filter: brightness(1.4) drop-shadow(0 0 14px gold);
}

@keyframes evolve {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.monster.gold-glow {
  filter:
    brightness(1.4)
    drop-shadow(0 0 8px gold)
    drop-shadow(0 0 16px gold);
}

@keyframes shake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-3px); }
  50%  { transform: translateX(3px); }
  75%  { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

.monster.shake {
  animation: shake 0.25s ease;
}

.monster-slot {
  height: 120px;            /* slightly bigger than image */
  display: flex;
  align-items: center;      /* vertical centering */
  justify-content: center;  /* horizontal centering */
}

.student-card {
  width: 140px;
  height: 160px;
}

.student-name {
  font-size: 0.9rem;
  line-height: 1.1;
  max-height: 2.4em; /* two lines */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.my-class-page {
  overflow: visible !important;
}

.my-class-page .card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.my-class-page .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 12px 20px;
  border-radius: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-10px);
}

.message-wrapper {
  margin-bottom: 0.75rem;
}

/* responsive: when narrow viewport, sidebar becomes normal flow below content */
@media (max-width: 991.98px) { /* md breakpoint */
  .sidebar-sticky {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .video-item {
    flex-direction: column;
  }

  .video-embed {
    margin-bottom: 0.75rem;
  }

  .video-info {
    text-align: left;
  }

  .video-title {
    font-size: 1.25rem;
  }
}