.subject-wrapper {
  display: flex;
  gap: 2rem;
  padding: 1rem 2rem;
  flex-wrap: nowrap;
  width: 100%;
}

.filter-sidebar {
  flex: 0 0 240px;
  padding: 1rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.filter-sidebar form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-sidebar select,
.filter-sidebar input,
.filter-sidebar button {
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: inherit;
}

.filter-sidebar button {
  background-color: #2563eb;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  border: none;
  transition: background-color 0.3s;
}

.filter-sidebar button:hover {
  background-color: #1e40af;
}

.subject-content-area {
  flex-grow: 1;
  padding: 1rem 0;
}

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

.content-card {
  background-color: #fff;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  position: relative;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.content-card:hover {
  transform: translateY(-2px);
}

.badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background-color: #facc15;
  color: #111;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: bold;
  border-radius: 6px;
}

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

.inline-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.type-chip {
  background-color: #eef2ff;
  color: #1e3a8a;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  display: inline-block;
  margin-left: 0.5rem;
}

.video-container {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background-color: #000;
}

.video-container iframe {
  border: none;
  display: block;
}

.video-container .btn {
  display: inline-block;
  margin-top: 1rem;
}


#filterSidebar {
  display: block; /* default for desktop */
  transition: all 0.3s ease-in-out;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  font-size: 1rem;
  border-radius: 6px;
  background-color: #f3f4f6;
  color: #1f2937;
  text-decoration: none;
  transition: background-color 0.2s;
}

.icon-btn:hover {
  background-color: #e5e7eb;
}

.tooltip[title] {
  position: relative;
}

.tooltip[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 1001;
  opacity: 0.95;
}


/* Mobile modal style */
@media (max-width: 1024px) {

  .filter-sidebar select,
  .filter-sidebar input[type="text"],
  .filter-sidebar button {
    width: auto;
    display: block;
    margin-bottom: 1rem;
    font-size: 1rem;
    padding: 0.7rem 1rem;
  }

  .filter-sidebar form {
    display: inline-block;
    text-align: left;
    width: 90%;
  }

  .subject-wrapper {
    flex-direction: column;
  }

  #filterSidebar {
    display: block;
    position: relative; /* or fixed, if needed */
  }

  #filterSidebar {
    display: block !important; /* ✅ Show by default on mobile */
    position: relative; /* ✅ Let it stay in flow */
    width: 100%;
    display: none;
    border: 1px solid #ccc;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1;
  }

  .subject-content-area {
    display: block;
    width: 100%;
  }

  .toggle {
    display: none; 
  }

  .inline-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .inline-actions a {
    flex: 1 1 auto;
    text-align: center;
  }

  .inline-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .icon-btn {
    font-size: 1.1rem;
    padding: 0.75rem;
  }
}
