
  /* === Common Course Styles === */
  .course-thumb {
    width: 100%;
    height: 220px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem 0.5rem 0 0;
    overflow: hidden;
    transition: transform 0.3s ease;
  }
  .course-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .course-card {
    cursor: pointer;
    background: #fff;
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    overflow: hidden;
  }
  .course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  }

  /* === Title (1 line only) === */
  .course-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 8px 0;
    color: black;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* === Description (max 3 lines) === */
  .course-description {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
    /* Fallback for non-webkit browsers */
    display: block;
    max-height: 4.2em; /* 3 lines * 1.4 line-height */
    overflow: hidden;
    position: relative;
  }
  
  /* Modern browser support for line clamping */
  .course-description.truncate-3-lines {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* === Grid View === */
  .courses-grid-view .course-item {
    text-align: center;
    transition: 0.3s;
  }
  .course-item.hide {
    display: none !important;
  }
  .courses-grid-view .course-description {
    display: none; /* Hide desc in grid */
  }

  /* === List View === */
  .courses-list-view .course-item {
    width: 100%;
    margin-bottom: 20px;
  }
  .courses-list-view .course-card {
    display: flex;
    flex-direction: row;
    height: auto;
  }
  .courses-list-view .course-thumb {
    width: 280px;
    height: 180px;
    border-radius: 0.5rem 0 0 0.5rem;
    flex-shrink: 0;
  }
  .courses-list-view .course-content {
    flex: 1;
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    min-width: 0; /* Important for text truncation in flexbox */
  }
  .courses-list-view .course-title {
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .courses-list-view .course-description {
    display: block !important;
  }
  .courses-list-view .course-description.truncate-3-lines {
    display: -webkit-box !important;
  }

  /* === Grid/List Toggle === */
  .view-toggle {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
  }
  .view-toggle-btn {
    background: white;
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .view-toggle-btn:first-child {
    border-radius: 4px 0 0 4px;
    border-right: none;
  }
  .view-toggle-btn:last-child {
    border-radius: 0 4px 4px 0;
  }
  .view-toggle-btn.active {
    background: #154980;
    color: white;
    border-color: #154980;
  }
  .view-toggle-btn:hover:not(.active) {
    background: #f8f9fa;
  }

  /* Fallback for older browsers - adds ellipsis manually */
  .course-description.fallback-ellipsis:after {
    content: '...';
    position: absolute;
    bottom: 0;
    right: 0;
    background: white;
    padding-left: 5px;
  }

  /* Responsive */
  @media (max-width: 768px) {
    .courses-list-view .course-card {
      flex-direction: column;
    }
    .courses-list-view .course-thumb {
      width: 100%;
      height: 200px;
      border-radius: 0.5rem 0.5rem 0 0;
    }
    .view-toggle {
      justify-content: center;
    }
    
    /* Mobile: Show description in grid view with 2 lines */
    .courses-grid-view .course-description {
      display: block;
      max-height: 2.8em; /* 2 lines * 1.4 line-height */
      overflow: hidden;
    }
    .courses-grid-view .course-description.truncate-2-lines {
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
  }

  /* Compact Rate button */
  .rate-btn {
    padding: 0.25rem 0.5rem !important; /* small & compact */
    font-size: 0.8rem;
    line-height: 1.2;
    border-radius: 4px;
  }

    /* Default Grid View: keep spacing */
  .courses-grid-view .rate-btn {
    margin-bottom: 0.75rem; /* same as mb-3 */
    border-radius: 5px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.2;
  }

  /* List View: remove bottom margin, align neatly */
  .courses-list-view .rate-btn {
    margin-bottom: 0; /* remove space */
    margin-top: 0.75rem; /* small top spacing for balance */
  }

  /* === Modal Styling === */
  .modal {
    overflow: hidden !important;
  }
  .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  }
  .modal-header {
    /*background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);*/
    background-color: #154980;
    color: white;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    padding: 1rem 1.5rem;
  }
  .btn-close-white {
    filter: invert(1);
  }

  .course-info-modal {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #154980;
    /*border-left: 4px solid #6a11cb;*/
  }
  .price-tag {
    /*background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);*/
    background-color: #154980;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
  }

  /* === Rating Stars === */
  .rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 5px;
  }
  .rating i {
    color: #e2e8f0;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
  }
  .rating i.active {
    color: #ffc107;
  }
  .rating i:hover {
    transform: scale(1.2);
  }

  /* === Review Section === */
  .rating-summary {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
  }
  .average-rating {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
  }
  .rating-distribution {
    margin: 15px 0;
  }
  .rating-bar {
    display: flex;
    align-items: center;
    margin: 6px 0;
  }
  .rating-level {
    width: 60px;
    font-size: 0.9rem;
  }
  .rating-progress {
    flex-grow: 1;
    height: 6px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 10px;
  }
  .rating-progress-fill {
    height: 100%;
    /*background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);*/
    background-color: #154980;
  }
  .review-item {
    border-bottom: 1px solid #e9ecef;
    padding: 15px 0;
  }
  .review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  .reviewer-name {
    font-weight: 600;
  }
  .review-date {
    color: #6c757d;
    font-size: 0.9rem;
  }

  /* === Buttons === */
  .btn-add-feedback,
  .btn-submit {
    /*background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);*/
    background-color: #154980;
    border: none;
    border-radius: 8px;
    padding: 10px 25px;
    font-weight: 600;
    transition: all 0.3s;
    color: white;
  }
  .btn-add-feedback:hover,
  .btn-submit:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px #2F6B78;
  }
  .btn-outline-secondary {
    border-radius: 8px;
  }

  /* 🔹 Category filter styles */
  .filter-tabs-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 30px;
    display: flex;               /* wrapper is a flex container */
    /* justify-content controlled by JS */
  }

  .filter-tabs {
    display: inline-flex;       /* shrinkwrap to content so wrapper can center it */
    gap: 10px;
    white-space: nowrap;
    min-width: max-content;
  }

  /* Optional: Hide scrollbar but allow scroll */
  .filter-tabs::-webkit-scrollbar {
    height: 6px;
  }
  .filter-tabs::-webkit-scrollbar-thumb {
    background-color: #154980;
    border-radius: 3px;
  }
  .filter-tabs::-webkit-scrollbar-track {
    background-color: #f1f1f1;
  }

  .filter-tab {
    border: 1px solid #154980;
    background-color: white;
    color: #154980;
    padding: 8px 16px;
    font-weight: 500;
    border-radius: 3px;
    cursor: pointer;
    transition: 0.2s ease-in-out;
  }
  .filter-tab:hover {
    background-color: #154980;
    color: white;
  }
  .filter-tab.active {
    background-color: #154980;
    color: white;
    border: 1px solid #154980;
  }

  .btn-course {
    color: white;
    background-color: #154980;
  }

  .btn-course:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px #2F6B78;
  }

  .btn-course-completed {
    color: white;
    background-color: #198754;
  }

  .btn-course-completed:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px #198754;
  }

  /* Course Details Modal Styles */
  .course-detail-thumbnail {
      border-radius: 0.5rem 0.5rem 0 0;
      overflow: hidden;
  }
  
  .info-card .card {
      transition: transform 0.2s ease, box-shadow 0.2s ease;
      border: 1px solid #e9ecef !important;
  }
  
  .info-card .card:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
  }
  
  .course-description-full {
      line-height: 1.6;
      font-size: 0.95rem;
  }
  
  .assigned-users-container {
      max-height: 200px;
      overflow-y: auto;
  }
  
  .user-avatar {
      font-weight: 600;
  }
  
  /* Custom scrollbar for assigned users */
  .assigned-users-container::-webkit-scrollbar {
      width: 6px;
  }
  
  .assigned-users-container::-webkit-scrollbar-track {
      background: #f1f1f1;
      border-radius: 3px;
  }
  
  .assigned-users-container::-webkit-scrollbar-thumb {
      background: #154980;
      border-radius: 3px;
  }
  
  .assigned-users-container::-webkit-scrollbar-thumb:hover {
      background: #0d3a6b;
  }
  
  /* Badge styling */
  .badge {
      font-size: 0.8rem;
      padding: 0.5rem 0.75rem;
  }
  
  /* Responsive adjustments */
  @media (max-width: 768px) {
      .modal-dialog {
          margin: 1rem;
      }
      
      .course-detail-thumbnail img {
          height: 200px !important;
      }
      
      .modal-body .p-4 {
          padding: 1.5rem !important;
      }
      
      .info-card .card-body {
          padding: 1rem !important;
      }
  }
  
  /* Animation for modal entry */
  .modal.fade .modal-dialog {
      transform: translateY(-50px);
      transition: transform 0.3s ease-out;
  }
  
  .modal.show .modal-dialog {
      transform: translateY(0);
  }

  .modal-dialog {
    max-height: 100vh;
    overflow-y: auto;
  }

  .modal-body {
    overflow-y: auto;
    max-height: calc(100vh - 200px);
  }

  /* Progress bar animations */
  .progress-bar {
      transition: width 0.6s ease;
  }
  
  /* Circular progress animation */
  .circular-progress circle {
      transition: stroke-dashoffset 0.6s ease;
  }
  
  /* Progress states */
  .progress-container .progress-percentage {
      font-family: 'Courier New', monospace;
  }
  
  /* Success state for completed courses */
  .progress-bar.bg-success {
      background-color: #28a745 !important;
  }
  /* Add these styles to your CSS file */
  .success-animation {
      animation: bounceIn 0.6s ease;
  }
  
  .error-animation {
      animation: shake 0.5s ease;
  }
  
  @keyframes bounceIn {
      0% {
          opacity: 0;
          transform: scale(0.3);
      }
      50% {
          opacity: 1;
          transform: scale(1.05);
      }
      70% {
          transform: scale(0.9);
      }
      100% {
          opacity: 1;
          transform: scale(1);
      }
  }
  
  @keyframes shake {
      0%, 100% {
          transform: translateX(0);
      }
      10%, 30%, 50%, 70%, 90% {
          transform: translateX(-5px);
      }
      20%, 40%, 60%, 80% {
          transform: translateX(5px);
      }
  }
  
  /* Toast notification styles */
  .toast {
      background-color: #28a745 !important;
  }
  
  /* Modal Styles */
  .user-details .detail-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
  }

  .user-details .detail-item:last-child {
    border-bottom: none;
  }

  #modal-user-bio {
    min-height: 80px;
    font-style: italic;
    color: #555;
  }

  .badge {
    font-size: 0.8rem;
    padding: 0.4em 0.8em;
  }

  /* Modal Gradient Background */
  .gradient-bg {
    background: linear-gradient(135deg, #2F6B78 0%, #154980 100%);
    border-bottom: none;
    padding: 1.5rem 1.5rem;
  }

  /* Modal Header Styles */
  .modal-header {
    border-radius: 12px 12px 0 0;
  }

  .modal-user-avatar img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .modal-title {
    font-weight: 700;
    font-size: 1.4rem;
    color: white;
  }

  /* Info Sections */
  .info-section {
    padding: 1rem 0;
  }

  .section-title {
    color: #2F6B78;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
  }

  /* Info Items */
  .info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #f8f9fa;
  }

  .info-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
  }

  .info-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2F6B78, #154980);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
  }

  .info-icon i {
    color: white;
    font-size: 1rem;
  }

  .info-content label {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
  }

  .info-value {
    margin: 0;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95rem;
  }

  /* Bio Section */
  .bio-section {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #2F6B78;
  }

  .bio-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2F6B78, #154980);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
  }

  .bio-icon i {
    color: white;
    font-size: 1.2rem;
  }

  .bio-content {
    flex: 1;
  }

  .bio-text {
    color: #495057;
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0;
    font-style: normal;
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    min-height: 120px;
    max-height: 200px;
    overflow-y: auto;
  }

  /* Modal Content */
  .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
  }

  .modal-body {
    padding: 2rem;
  }

  /* Footer */
  .modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 2rem;
  }

  .btn-outline-secondary {
    border-color: #6c757d;
    color: #6c757d;
    border-radius: 6px;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
  }

  .btn-outline-secondary:hover {
    background-color: #6c757d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }

  /* Responsive Design */
  @media (max-width: 768px) {
    .modal-dialog {
      margin: 1rem;
    }

    .modal-body {
      padding: 1rem;
    }

    .info-item {
      flex-direction: column;
      text-align: center;
    }

    .info-icon {
      margin-right: 0;
      margin-bottom: 0.5rem;
    }

    .bio-section {
      flex-direction: column;
      text-align: center;
    }

    .bio-icon {
      margin-right: 0;
      margin-bottom: 0.5rem;
    }
  }

  /* Scrollbar styling for bio */
  .bio-text::-webkit-scrollbar {
    width: 6px;
  }

  .bio-text::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }

  .bio-text::-webkit-scrollbar-thumb {
    background: #2F6B78;
    border-radius: 3px;
  }

  .bio-text::-webkit-scrollbar-thumb:hover {
    background: #154980;
  }