/* ========== HEADER ========== */
.text-center h1 {
  margin-top: 10px;
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #154980 0%, #154980 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

.course-search-bar {
  display: flex;
  justify-content: center;
}

.search-wrapper {
  display: flex;
  align-items: center;
  background: #f3f4f6;
  border-radius: 50px;
  padding: 6px;
  gap: 10px;
  width: 100%;
  max-width: 700px;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 15px;
  background: transparent;
  font-size: 16px;
}

.search-dropdown {
  border: none;
  outline: none;
  background: #ffffff;
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 14px;
}

.search-btn {
  background: #154980;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  color: white;
}

.search-btn:hover {
  background-color: #2F6B78;
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(0,0,0,0.2);
}

/* ========== ENHANCED COURSE CARD STYLES ========== */
.course-card {
  background: #ffffff;
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  height: 100%;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.course-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 35px rgba(21, 73, 128, 0.12);
}

/* Thumbnail Styles */
.course-thumb {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
  border-radius: 0;
}

.course-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.course-card:hover .course-thumb img {
  transform: scale(1.05);
}

/* Hover Overlay */
.thumb-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(21, 73, 128, 0.2) 0%, rgba(47, 107, 120, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.course-card:hover .thumb-overlay {
  opacity: 1;
}

/* Rate Button */
.rate-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #154980, #2F6B78);
  color: white;
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.rate-btn i {
  font-size: 0.8rem;
}

.rate-btn:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #1a5a9e, #3a7f8e);
  color: white;
  box-shadow: 0 4px 12px rgba(21, 73, 128, 0.3);
}

/* Card Content */
.course-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Course Title */
.course-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 0.75rem 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8rem;
}

/* Course Description */
.course-description {
  font-size: 0.85rem;
  color: #6c757d;
  line-height: 1.5;
  margin: 0 0 1rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Fallback for older browsers */
.course-description.truncate-3-lines {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Course Actions */
.course-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding-top: 0.5rem;
}

.action-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 40px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.action-btn i {
  font-size: 0.8rem;
}

/* Details Button */
.details-btn {
  background: rgba(21, 73, 128, 0.08);
  color: #154980;
}

.details-btn:hover {
  background: rgba(21, 73, 128, 0.15);
  transform: translateY(-2px);
}

/* Continue Button */
.continue-btn {
  background: linear-gradient(135deg, #154980, #2F6B78);
  color: white;
  box-shadow: 0 2px 6px rgba(21, 73, 128, 0.2);
}

.continue-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(21, 73, 128, 0.3);
}

/* Completed Button */
.completed-btn {
  background: #28a745;
  color: white;
  box-shadow: 0 2px 6px rgba(40, 167, 69, 0.2);
}

.completed-btn:hover {
  background: #218838;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Enroll Button */
.enroll-btn {
  background: linear-gradient(135deg, #154980, #2F6B78);
  color: white;
  box-shadow: 0 2px 6px rgba(21, 73, 128, 0.2);
}

.enroll-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(21, 73, 128, 0.3);
}

/* Legacy button styles (backward compatibility) */
.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;
}

/* ========== GRID VIEW ========== */
.courses-grid-view .course-item {
  transition: 0.3s;
}
.course-item.hide {
  display: none !important;
}
.courses-grid-view .course-description {
  display: -webkit-box !important;
}

/* ========== LIST VIEW ========== */
.courses-list-view .course-item {
  width: 100%;
  margin-bottom: 20px;
}
.courses-list-view .course-card {
  flex-direction: row;
  height: auto;
}
.courses-list-view .course-thumb {
  width: 240px;
  height: 160px;
  flex-shrink: 0;
  border-radius: 20px 0 0 20px;
}
.courses-list-view .course-content {
  flex: 1;
  padding: 15px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  min-width: 0;
}
.courses-list-view .course-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.courses-list-view .course-description {
  display: block !important;
}
.courses-list-view .course-actions {
  flex-direction: row;
  justify-content: flex-start;
}
.courses-list-view .action-btn {
  max-width: 120px;
}

/* ========== VIEW TOGGLE ========== */
.view-toggle {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 30px;
}

.view-toggle-btn {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: #374151;
}

.view-toggle-btn:first-child {
  border-radius: 8px 0 0 8px;
  border-right: none;
}
.view-toggle-btn:last-child {
  border-radius: 0 8px 8px 0;
}
.view-toggle-btn.active {
  background: #154980;
  color: #ffffff;
  border-color: #154980;
}
.view-toggle-btn:hover:not(.active) {
  background: #f9fafb;
  transform: translateY(-1px);
}

/* ========== 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-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;
}
.price-tag {
  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-color: #154980;
}
.review-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid #ddd;
  padding: 20px 0;
  gap: 20px;
}
.review-left {
  flex: 1;
}
.review-right {
  width: 220px;
  text-align: right;
}
.review-title {
  font-weight: 700;
  font-size: 16px;
  color: #222;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.review-description {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}
.rating-stars {
  margin-bottom: 6px;
}
.rating-stars i {
  color: #ccc;
  font-size: 18px;
  margin-left: 2px;
}
.rating-stars i.active {
  color: #f7941d;
}
.review-user {
  font-weight: 600;
  font-size: 14px;
  color: #333;
}
.review-date {
  font-size: 13px;
  color: #777;
}

/* ========== BUTTONS ========== */
.btn-add-feedback,
.btn-submit {
  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;
  border-color: #6c757d;
  color: #6c757d;
}
.btn-outline-secondary:hover {
  background-color: #6c757d;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ========== FILTER TABS ========== */
.filter-tabs-wrapper {
  padding-top: 5px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
  scrollbar-width: thin;
  display: flex;
  justify-content: center;
}
.filter-tabs-wrapper::-webkit-scrollbar {
  height: 4px;
}
.filter-tabs-wrapper::-webkit-scrollbar-track {
  background: #e5e7eb;
  border-radius: 10px;
}
.filter-tabs-wrapper::-webkit-scrollbar-thumb {
  background: #154980;
  border-radius: 10px;
}
.filter-tabs {
  display: inline-flex;
  gap: 10px;
  white-space: nowrap;
  min-width: max-content;
}
.filter-tab {
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  color: #374151;
  padding: 8px 20px;
  font-weight: 600;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.filter-tab:hover {
  background-color: #e6f0fa;
  border-color: #154980;
  color: #154980;
  transform: translateY(-2px);
}
.filter-tab.active {
  background-color: #154980;
  color: #ffffff;
  border-color: #154980;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* ========== COURSE DETAILS MODAL ========== */
.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;
}
.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;
}

/* ========== BADGES ========== */
.badge {
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
}

/* ========== MODAL ANIMATIONS ========== */
.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 & SUCCESS/ERROR ========== */
.progress-bar {
  transition: width 0.6s ease;
}
.circular-progress circle {
  transition: stroke-dashoffset 0.6s ease;
}
.progress-container .progress-percentage {
  font-family: 'Courier New', monospace;
}
.progress-bar.bg-success {
  background-color: #28a745 !important;
}
.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 {
  background-color: #28a745 !important;
}

/* ========== USER PROFILE MODAL ========== */
.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;
}
.gradient-bg {
  background: linear-gradient(135deg, #2F6B78 0%, #154980 100%);
  border-bottom: none;
  padding: 1.5rem 1.5rem;
}
.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-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-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 {
  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;
}
.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;
}

/* ========== DOCUMENTS & ADVISORY SECTION ========== */
.material-section {
  margin-top: 25px;
}
.doc-item {
  background: #f1f1f1;
  padding: 20px;
  margin-bottom: 18px;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
  transition: all 0.25s ease;
  cursor: pointer;
}
.doc-item:hover {
  background: #ffffff;
  border-color: #ccc;
  transform: translateY(-4px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}
.doc-title {
  color: #163a8a;
  font-weight: 700;
  margin-bottom: 8px;
}
.doc-divider {
  margin: 8px 0 12px;
  border-top: 1px solid #686868;
}
.doc-item p {
  margin-bottom: 6px;
  font-size: 14px;
}
.doc-download {
  display: inline-block;
  background: #ffc107;
  color: #000;
  padding: 6px 14px;
  border-radius: 4px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 8px;
}
.doc-download:hover {
  color: white;
}
.doc-desc {
  margin-top: 10px;
  color: #444;
}
.doc-label {
  font-weight: 600;
}

/* ========== VIDEO MODAL ========== */
.video-modal {
  border-radius: 6px;
  overflow: hidden;
}
.video-modal-title {
  font-weight: 700;
  font-size: 1.4rem;
  color: black;
}
.video-header {
  background: linear-gradient(135deg, #ffffff 0%, #ffffff 100%);
  border-bottom: 1px solid #e5e5e5;
}
.video-modal .ratio-16x9 {
  background-color: #000;
}
.video-modal iframe {
  background-color: #000;
}
.video-modal .modal-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
}
.video-btn {
  background: linear-gradient(135deg, #ffc107 0%, #ffc107 100%);
  color: black;
  border: none;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
}
.video-btn:hover {
  background: linear-gradient(135deg, #ffc107 0%, #ffc107 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
  color: white;
}

/* ========== RESPONSIVE OVERRIDES ========== */
@media (max-width: 768px) {
  .courses-list-view .course-card {
    flex-direction: column;
  }
  .courses-list-view .course-thumb {
    width: 100%;
    height: 200px;
    border-radius: 20px 20px 0 0;
  }
  .courses-list-view .action-btn span {
    display: inline;
  }
  .view-toggle {
    justify-content: center;
  }
  .courses-grid-view .course-description {
    display: block;
    max-height: 2.8em;
    overflow: hidden;
  }
  .courses-grid-view .course-description.truncate-2-lines {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .course-thumb {
    height: 180px;
  }
  .course-content {
    padding: 1rem;
  }
  .course-title {
    font-size: 1rem;
    min-height: 2.6rem;
  }
  .action-btn span {
    display: none;
  }
  .action-btn i {
    margin: 0;
    font-size: 1rem;
  }
  .action-btn {
    padding: 8px;
  }
  .rate-btn span {
    display: none;
  }
  .rate-btn {
    padding: 6px 10px;
  }
  .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;
  }
  .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;
  }
}