/* --- ARCHIVE HERO --- */
.archive-hero-overlay {
    background: linear-gradient(180deg, rgba(13, 71, 161, 0.45) 0%, rgba(13, 71, 161, 0.85) 100%);
    padding: 45px 24px 35px;
  }
  
  /* --- FILTER BAR & LEVEL DROPDOWN --- */
  .archive-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
  }
  
  .level-select {
    background-color: #1565c0;
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
  }
  
  /* --- 2x2 VIDEO RECORDINGS GRID --- */
  .recordings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 20px;
    direction: rtl;
  }

  /* Fallback for smaller screens */
@media screen and (max-width: 992px) {
  .recordings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 600px) {
  .recordings-grid {
    grid-template-columns: 1fr;
  }
}
  
.recording-card {
  background-color: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.recording-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

  /* THUMBNAIL WRAPPER (Positions play icon correctly) */
  .recording-thumb-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #f1f5f9;
    overflow: hidden;
  }
  
  .recording-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .video-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  }
  
  .video-thumbnail-box {
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #020617;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  
  .video-thumbnail-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .play-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
  
    /* Glassmorphic lens effect strictly inside the button circle */
    background: rgba(15, 23, 42, 0.35); /* Dark semi-transparent tint */
    backdrop-filter: blur(6px);         /* Blurs only what is directly under the button */
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.3); /* Thin light glass border */
    
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
  }
  
  .play-icon-overlay svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.25s ease;
  }
  
  .video-thumbnail-box:hover .play-icon-overlay {
    transform: scale(1.1);
  }
  
  .cat-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #e8f0fe;
    background-color: #ffffff;
    color: #3b82f6;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
  }


  .cat-btn:hover {
    background-color: #f4f8ff;
    border-color: #d0e1fd;
  }
  
  .cat-btn.active {
    background-color: #0056b3;
    color: #ffffff;
    border-color: #0056b3;
    box-shadow: none;
  }

  
  /* HOVER EFFECT: Reveal Solid Brand Blue */
  .recording-card:hover .play-icon-overlay {
    background: #1565c0;              /* Fills solid blue on hover */
    border-color: #1565c0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 8px 24px rgba(21, 101, 192, 0.45);
  }

.recording-card:hover .play-icon-overlay svg {
  transform: scale(1.05);
}

  .video-card-details {
    padding: 12px 14px;
    text-align: right;
  }
  
  /* CARD DETAILS */
  .recording-details {
    padding: 14px 16px;
    text-align: right;
    direction: rtl;
  }
  
  .recording-details h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .recording-details p {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
  }

  /* --- COMING SOON PLACEHOLDER STYLES --- */
.coming-soon-placeholder {
  grid-column: 1 / -1;
  background: #ffffff;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
}

.coming-soon-badge {
  display: inline-block;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
  padding: 6px 20px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  margin-bottom: 10px;
}

.coming-soon-text {
  color: #64748b;
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0;
}

  /* --- WHITEBOARD & PHOTO GALLERY GRID --- */
  .gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 14px;
  }
  
  .photo-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px;
    text-align: center;
  }
  
  .photo-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
  }
  
  .photo-date {
    font-weight: 800;
    font-size: 0.9rem;
    color: #0f172a;
    margin: 8px 0 2px 0;
  }
  
  .photo-meta {
    font-size: 0.76rem;
    color: #64748b;
  }
  
  /* --- VIDEO MODAL RESPONSIVE OVERRIDES --- */

/* Desktop Expansion */
.upload-modal-card.video-modal-card {
  max-width: 900px !important;
  width: 90% !important;
  padding: 40px 20px 20px 20px !important; /* Top padding leaves space for close button */
  background-color: #ffffff !important; /* Matches site theme */
  border-radius: 20px !important;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25) !important;
  border: 1px solid #e2e8f0 !important;
  position: relative;
  box-sizing: border-box;
}

.upload-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.55); /* Dark semi-transparent overlay */
  backdrop-filter: blur(6px);              /* Full screen blur */
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;                          /* Covers navbar & all page elements */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.upload-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Modal Close Button Adjustment */
.video-modal-card .modal-close-x {
  position: absolute;
  top: 12px;
  left: 16px;
  color: #64748b;
  font-size: 1.6rem;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 20;
  transition: color 0.2s ease;
}

.video-modal-card .modal-close-x:hover {
  color: #dc2626;
}

/* Responsive 16:9 Video Container */
.iframe-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* Perfect 16:9 ratio */
  height: 0 !important;
  overflow: hidden;
  border-radius: 12px;
  background-color: #000000;
  margin: 0 !important; /* Removes clipping margins */
}

.iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Mobile Screen Optimization */
@media screen and (max-width: 600px) {
  .upload-modal-card.video-modal-card {
    width: 94% !important;
    padding: 36px 12px 12px 12px !important;
    border-radius: 14px !important;
  }


  .video-modal-card .modal-close-x {
    top: 6px;
    left: 10px;
    font-size: 1.4rem;
  }

  .iframe-container {
    margin-top: 20px;
    border-radius: 8px;
  }
}

  @media screen and (max-width: 600px) {
    .recordings-grid, .gallery-grid {
      grid-template-columns: 1fr;
    }
  }
  
  /* --- ASSIGNMENT BLUE ACTIVE BANNERS & WHITE ARCHIVED CARDS --- */

.assignment-card {
  display: flex;
  justify-content: space-between; /* Pushes Title (Right) & Actions (Left) */
  align-items: center;
  border-radius: 16px;
  padding: 18px 24px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  direction: rtl;
}

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

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 998; /* Directly underneath sidebar */
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto; /* Enables touch/tap capture */
}

.sidebar {
  position: fixed;
  top: 0;
  left: -300px; /* Hidden off to the left */
  right: auto;  /* Override default right positioning */
  width: 280px;
  height: 100vh;
  z-index: 999;
  transition: left 0.3s ease;
}

.sidebar.open {
  left: 0;      /* Slides in from left */
}
/* 1. ACTIVE BLUE BANNER CARD */
.assignment-card.active-blue-card {
  display: flex;
  justify-content: space-between;
  align-items: stretch; /* Makes left and right sides equal height */
  background-color: #ffffff; /* White background for the outer card */
  border: 1px solid #e2e8f0; /* Thin subtle border around the whole card */
  border-radius: 16px;
  overflow: hidden; /* Clips the blue inner block to the rounded corners */
  padding: 0; /* Important: padding is handled by inner elements */
  margin-bottom: 14px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  cursor: pointer;
  direction: rtl;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.assignment-card.active-blue-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

/* 2. ARCHIVED WHITE CARD */
.assignment-card.archived-white-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}


/* RIGHT SIDE (Solid Blue Area) */
.assignment-right-wrapper {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  color: #ffffff;
  flex-grow: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-radius: 14px 0 0 14px; /* Rounded corners on left inner edge */
}

.assignment-right-info {
  text-align: right;
}

.assignment-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 4px 0;
  color: #ffffff;
}

.assignment-title.dark-text {
  color: #0f172a;
}

.assignment-meta {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.assignment-meta.muted-text {
  color: #64748b;
  opacity: 1;
}

/* LEFT SIDE: ACTIONS & TIMER */
.assignment-left-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* COUNTDOWN WHITE BOX CONTAINER */
.assignment-left-whitebox {
  width: 110px; /* Expanded slightly to fit DD:HH:MM:SS comfortably */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background-color: #ffffff;
  padding: 12px 8px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.assignment-left-whitebox:hover {
  background-color: #f8fafc;
}

.assignment-left-whitebox .stopwatch-icon {
  color: #1d4ed8; /* Blue stopwatch icon */
}

.assignment-left-whitebox .stopwatch-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
  transition: transform 0.25s ease;
}

.assignment-left-whitebox:hover .stopwatch-img {
  transform: scale(1.1);
}

.assignment-left-whitebox .timer-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1d4ed8; /* Blue text for [7 أيام] */
}

/* WHITEBOARD UPLOAD BUTTON (Matches level-select color & rounded shape) */
.btn-upload-whiteboard {
  background-color: #1565c0; /* Exact solid brand blue matching level-select */
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px; /* Matches level-select border radius */
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn-upload-whiteboard:hover {
  background-color: #0d47a1; /* Slightly darker shade on hover */
  transform: translateY(-1px);
}

@media screen and (max-width: 600px) {
  .btn-upload-whiteboard {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
}

/* TEXT WRAPPER FOR SMOOTH SWAP */
.timer-text-wrapper {
  position: relative;
  width: 100%;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* DEFAULT SIMPLE TIMER (Visible by default) */
.timer-text-simple {
  position: absolute;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1d4ed8;
  white-space: nowrap;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* --- MOBILE-OPTIMIZED PHOTO & COMMENTS MODAL --- */

/* Flexible responsive grid wrapper */
#photoModalFlexContainer {
  display: flex;
  gap: 20px;
  flex-direction: row;
}

/* Modal Card Sizing */
#photoPreviewModal .upload-modal-card {
  max-width: 850px;
  width: 92%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Contains inner scrolling */
  padding: 24px;
}

/* Comment Section Container */
.comments-column-wrapper {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e2e8f0;
  padding-right: 16px;
}

/* --- MOBILE BREAKPOINT (<= 768px) --- */
@media (max-width: 768px) {
  #photoPreviewModal .upload-modal-card {
    padding: 16px;
    width: 95%;
    max-height: 88vh;
    overflow-y: auto; /* Enable smooth scrolling on small screens */
  }

  #photoModalFlexContainer {
    flex-direction: column; /* Stack image on top, comments below */
    gap: 16px;
  }

  /* Adjust image frame for mobile */
  .photo-display-column {
    flex: none !important;
    width: 100%;
  }

  #photoModalImg {
    max-height: 35vh !important; /* Prevents image from taking up entire mobile screen */
  }

  /* Comments Column Adjustment on Mobile */
  .comments-column-wrapper {
    border-right: none !important;
    border-top: 1px solid #e2e8f0;
    padding-right: 0 !important;
    padding-top: 14px;
    min-width: 100%;
  }

  #photoCommentsContainer {
    max-height: 220px !important; /* Compact comment feed for mobile thumb scrolling */
  }

  /* Sticky bottom input for easy mobile typing */
  #photoCommentForm {
    position: sticky;
    bottom: 0;
    background: #ffffff;
    padding-top: 6px;
  }

  #photoCommentInput {
    font-size: 16px !important; /* Prevents automatic iOS Safari zoom-in on focus */
  }
}

/* HOVER DETAILED TIMER (Hidden by default) */
.timer-text-detailed {
  position: absolute;
  font-size: 0.72rem;
  font-weight: 800;
  font-family: 'Work Sans', monospace, sans-serif; /* Monospace prevents numbers from jittering */
  color: #1d4ed8;
  white-space: nowrap;
  letter-spacing: 0.5px;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* HOVER STATES */
.assignment-left-whitebox:hover .timer-text-simple {
  opacity: 0;
  transform: scale(0.85);
}

.assignment-left-whitebox:hover .timer-text-detailed {
  opacity: 1;
  transform: scale(1);
}

/* SOLID WHITE CIRCLE FOR 'i' ICON */
/* INFO ICON BUTTON CONTAINER */
.btn-info-icon {
  background: none;
  border: none;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.btn-info-icon:hover {
  transform: scale(1.1);
}

.info-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.btn-info-icon.dark {
  background-color: #f1f5f9;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

/* COUNTDOWN BADGE WITH WHITESPACE */
.assignment-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.18); /* Semi-transparent white pill */
  backdrop-filter: blur(4px);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  min-width: 65px;
}

.stopwatch-icon {
  flex-shrink: 0;
}

.archived-date-stamp {
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: 10px;
}

/* --- PRESENTATIONS CARD LAYOUT --- */
.presentation-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 14px;
  direction: rtl;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.presentation-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

/* RIGHT SIDE: THUMBNAIL & TEXT INFO */
.presentation-right-group {
  display: flex;
  align-items: center;
  gap: 18px;
}

.presentation-thumb {
  width: 140px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  flex-shrink: 0;
}

.presentation-info {
  text-align: right;
}

.presentation-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 4px 0;
}

.presentation-subtitle {
  font-size: 0.88rem;
  font-weight: 600;
  color: #3b82f6;
  margin: 0 0 2px 0;
}

.presentation-subject {
  font-size: 0.78rem;
  color: #94a3b8;
  margin: 0;
}

/* LEFT SIDE: ACTION CIRCLE BUTTONS */
.presentation-left-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding-right: 16px;
  border-right: 1px solid #e2e8f0; /* Divider line matching mockup */
}

.btn-circle-action {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #0f172a; /* Dark navy circle buttons */
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-circle-action:hover {
  transform: scale(1.08);
  background-color: #1d4ed8; /* Highlight blue on hover */
}

/* Custom Hover States for Admin Action Buttons */
.btn-circle-action.btn-action-edit:hover {
  background-color: #1d4ed8 !important; /* Brand Blue */
  transform: scale(1.08);
}

.btn-circle-action.btn-action-delete:hover {
  background-color: #dc2626 !important; /* Danger Red */
  transform: scale(1.08);
}

/* --- MOBILE RESPONSIVE FIX FOR PRESENTATIONS (< 600px) --- */
@media screen and (max-width: 600px) {
  .presentation-card {
    padding: 12px;
    gap: 10px;
  }

  .presentation-right-group {
    gap: 10px;
    flex: 1; /* Allows text to expand dynamically */
    min-width: 0; /* Prevents flex children from pushing bounds */
  }

  /* Shrink slide preview thumbnail for mobile screens */
  .presentation-thumb {
    width: 85px;
    height: 55px;
    border-radius: 6px;
  }

  /* Text adjustments to prevent awkward word wrapping */
  .presentation-title {
    font-size: 0.95rem;
    white-space: nowrap; /* Keeps 'مجموعة ٢ [الطلاب]' on 1 line */
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .presentation-subtitle {
    font-size: 0.8rem;
  }

  .presentation-subject {
    font-size: 0.72rem;
  }

  /* Compact button actions section */
  .presentation-left-actions {
    gap: 6px;
    padding-right: 8px;
  }

  .btn-circle-action {
    width: 32px;
    height: 32px;
  }

  .btn-circle-action svg {
    width: 15px;
    height: 15px;
  }
}

/* Mobile Optimization for Presentation Cards & Header */
@media screen and (max-width: 600px) {
  
  /* 1. Stack Section Header Elements Cleanly */
  #presentations .section-header {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 12px;
  }

  #presentations .section-header-right {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  #presentations .section-header-left {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  #presentations .btn-add-presentation {
    width: 100%;
    justify-content: center;
  }

  /* 2. Re-orient Cards for Mobile Vertical Flow */
  .presentation-card {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 14px;
  }

  .presentation-right-group {
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
  }

  .presentation-thumb {
    width: 90px;
    height: 60px;
    object-fit: cover;
    flex-shrink: 0;
    border-radius: 8px;
  }

  .presentation-info {
    flex: 1;
    min-width: 0; /* Prevents text overflow */
  }

  .presentation-title {
    font-size: 0.98rem;
    line-height: 1.4;
    word-break: break-word;
  }

  /* 3. Separate Action Buttons Row at the Bottom */
  .presentation-left-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0; /* Divider line */
  }

  .btn-circle-action {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
}

/* --- COMPACT MOBILE TIMER FIX (< 600px) --- */
@media screen and (max-width: 600px) {
  .assignment-left-whitebox {
    width: 60px !important;
    min-width: 60px !important;
    padding: 6px 2px !important;
    overflow: hidden !important; /* Prevents any overflow text from leaking */
  }

  .assignment-left-whitebox .stopwatch-img {
    width: 15px !important;
    height: 15px !important;
  }

  .timer-text-wrapper {
    width: 100% !important;
    height: 18px !important;
  }

  /* Simple text ([X أيام]) */
  .timer-text-simple {
    font-size: 0.65rem !important;
    letter-spacing: -0.2px !important;
  }

  /* Detailed text (00d:00h:00m:00s) */
  .timer-text-detailed {
    font-size: 0.48rem !important; /* Scaled down to prevent horizontal overflow */
    letter-spacing: -0.5px !important; /* Tightened letter spacing */
    font-weight: 700 !important;
    width: 100% !important;
    text-align: center !important;
  }
}

/* --- RECORDINGS 2x2 MOBILE GRID (< 600px) --- */
@media screen and (max-width: 600px) {
  .recordings-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; /* Forces 2 columns */
    gap: 10px !important;
  }

  .recording-card {
    display: flex;
    flex-direction: column;
    border-radius: 10px !important;
    overflow: hidden;
  }

  .recording-thumb-wrapper {
    width: 100% !important;
    aspect-ratio: 16 / 9; /* Maintains video thumbnail ratio */
  }

  .recording-details {
    padding: 6px 4px !important;
  }

  .recording-details h3 {
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    margin-bottom: 2px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limits title to 2 lines with ellipsis */
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .recording-details p {
    font-size: 0.65rem !important;
  }
}

/* ==========================================
   ASSIGNMENTS DUAL-BOX SYSTEM
   ========================================== */

/* Shared Box Base */
.assignment-box {
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 28px;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  cursor: pointer;
}

.box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.box-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.box-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

.comment-bubble {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px;
  text-align: right;
}

.comment-author-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.comment-author-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: #1e293b;
}

.comment-time {
  font-size: 0.72rem;
  color: #94a3b8;
}

.comment-text {
  font-size: 0.88rem;
  color: #334155;
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
}

/* --- BOX 1: ACTIVE ASSIGNMENTS (BLUE) --- */
.active-assignments-box {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 12px 28px -6px rgba(29, 78, 216, 0.3);
}

.active-assignments-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -8px rgba(29, 78, 216, 0.4);
}

.active-assignments-box .active-count-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* Pulsing Status Dot */
.status-indicator-dot {
  width: 10px;
  height: 10px;
  background-color: #38bdf8;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator-dot.pulse {
  box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
  animation: pulse-animation 1.8s infinite;
}

@keyframes pulse-animation {
  0% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(56, 189, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0); }
}

/* --- BOX 2: ARCHIVED ASSIGNMENTS (WHITE) --- */
.archived-assignments-box {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.04);
}

.archived-assignments-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
}

.archived-assignments-box .archived-count-badge {
  background: #f1f5f9;
  color: #64748b;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Inner Item Cards */
.assignment-item-card {
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Active Inner Cards */
.active-assignments-box .assignment-item-card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.active-assignments-box .assignment-item-card:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateX(-4px);
}

/* Archived Inner Cards */
.archived-assignments-box .assignment-item-card {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  color: #0f172a;
}

.archived-assignments-box .assignment-item-card:hover {
  background: #f1f5f9;
  transform: translateX(-4px);
}

/* --- EXPANDED ARCHIVE SUBMISSION SECTION --- */
.expanded-submissions-wrapper {
  width: 100%;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed #cbd5e1;
  animation: fadeInExpand 0.25s ease-in-out;
}

@keyframes fadeInExpand {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Gender Filter Chips Bar */
.submission-filter-chips {
  display: flex;
  gap: 8px;
  justify-content: flex-end; /* Align chips to the right (RTL layout) */
  margin-bottom: 16px;
}

.submission-filter-chips .chip-btn {
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
}

.submission-filter-chips .chip-btn.active {
  background: #1d4ed8 !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
}

.submission-filter-chips .chip-btn:not(.active) {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.submission-filter-chips .chip-btn:hover:not(.active) {
  background: #f1f5f9;
  color: #1e293b;
}

/* Student Row Card */
.student-submission-row {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.student-submission-row:hover {
  border-color: #1d4ed8;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.08);
}

/* Left Action Circles (View & Download) */
.student-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-circle-btn {
  width: 38px;
  height: 38px;
  background: #0f172a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.2s ease;
}

.action-circle-btn:hover {
  background: #1d4ed8;
  transform: scale(1.06);
}

/* Right Name Styling */
.student-row-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #334155;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  text-align: right;
  direction: ltr; /* Keeps English capitalized names properly oriented */
}

/* --- FULL-WIDTH EXPANDED SUBMISSIONS BELOW ARCHIVE CARD --- */
.assignment-card.archived-white-card {
  flex-direction: column !important;
  align-items: stretch !important;
}

.archived-card-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.expanded-submissions-wrapper {
  width: 100% !important;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #cbd5e1;
  box-sizing: border-box;
}

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  direction: rtl;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  font-size: 1.1rem;
}

.toast-success {
  border-right: 4px solid #22c55e;
}

.toast-error {
  border-right: 4px solid #ef4444;
}

.toast-info {
  border-right: 4px solid #3b82f6;
}

@media screen and (max-width: 600px) {
  .toast-container {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }
  .toast {
    font-size: 0.82rem;
    padding: 10px 14px;
  }
}

