:root {
  --sidebar-width: 240px;
  --brand-gradient: linear-gradient(90deg, #5838f7 0%, #c538cc 100%);
  --muted: #6b7280;
  --bg: #f6f7fb;
}

body {
  background: var(--bg);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial;
  overflow-x: hidden;
}

:root {
  --sidebar-width: 250px;
  --primary: linear-gradient(to right, #ff6600, #fb3233);
}

/* ✅ NAVBAR */
.navbar {
  background: #fff;
  padding: 10px 25px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1050;
}

.dropbtn {
  background-color: #fff;
  font-size: 16px;
  border: none;
  cursor: pointer;
  font-weight: 500;
}

.dropbtn:hover {
  color: #e65a29;
}

.dropdown {
  position: relative;
  font-weight: 500;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 200px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  font-weight: 500;
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-weight: 500;
}

.dropdown-content a:hover {
  background-color: #f1f1f1;
  color: #f26434;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.custom-nav {
  border: 2px solid #ccc;
  border-radius: 15px;
  padding: 2px 10px;
  margin: 2px;
}

.custom-nav .nav-link {
  font-weight: 500;
  color: #333;
  padding: 6px 12px;
  transition: 0.3s;
}

.custom-nav .nav-link:hover {
  color: #f26434;
}

.custom-nav .divider {
  color: #f26434;
  font-size: 20px;
  margin: 0 6px;
}

.btn-login {
  border: 1px solid #f36f45;
  color: #f36f45;
  border-radius: 10px;
  padding: 6px 18px;
  font-weight: 500;
  transition: 0.3s;
}

.btn-login:hover {
  background: #f36f45;
  color: #fff;
}

/* ✅ SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: #fff;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  padding-top: 90px;
  border-right: 1px solid #ddd;
  transition: all 0.3s ease;
  z-index: 1040;
}

.sidebar .brand {
  text-align: center;
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.sidebar .nav-link {
  color: #333;
  display: flex;
  align-items: center;
  padding: 0.9rem 1rem;
  border-radius: 8px;
  transition: 0.3s;
  margin: 4px 8px;
}

.sidebar .nav-link i {
  font-size: 18px;
  width: 22px;
  text-align: center;
  color: #333;
}

.sidebar .nav-link:hover {
  background: var(--primary);
  color: #fff;
}

.sidebar .nav-link:hover i {
  color: #fff;
}

.sidebar .nav-link.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 4px 0px 0px #fff;
}

.sidebar .nav-link.active i {
  color: #fff;
}

/* ✅ COLLAPSE MODE */
.sidebar.collapsed {
  width: 80px;
}

.sidebar.collapsed .nav-link span,
.sidebar.collapsed .brand span {
  display: none;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
}

.sidebar.collapsed .nav-link:hover::after {
  content: attr(data-title);
  position: absolute;
  left: 75px;
  background: #333;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
}

/* ✅ MAIN CONTENT */
.main {
  margin-left: var(--sidebar-width);
  transition: all 0.3s ease;
}

.sidebar.collapsed ~ .main {
  margin-left: 80px;
}

/* ✅ SIDEBAR TOGGLE BUTTON */
.sidebar-toggle-btn {
  border: none;
  background: transparent;
  font-size: 22px;
  color: #333;
  cursor: pointer;
}

@media (max-width: 992px) {
  .sidebar {
    left: -250px;
  }
  .sidebar.show {
    left: 0;
  }
  .main {
    margin-left: 0;
  }
}

@media (max-width: 992px) {
  .custom-nav {
    border: none;
    border-radius: 0;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0;
  }

  .custom-nav .divider {
    display: none;
  }

  .custom-nav .nav-link {
    padding: 10px;
    width: 100%;
    border-bottom: 1px solid #eee;
  }

  .btn-login {
    margin-top: 10px;
    width: 100%;
    text-align: center;
  }
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  flex-wrap: wrap;
}

.profile-hero {
  background: var(--brand-gradient);
  color: #fff;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.08);
  flex-wrap: wrap;
}
.profile-left {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
}

.section-title {
  font-weight: 600;
  font-size: 1.6rem;
  margin-bottom: 10px;
  color: #2d2d2d;
}

.section-subtitle {
  color: #6c757d;
  margin-bottom: 25px;
}

.search-box {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 30px;
  padding: 6px 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.search-box:focus-within {
  border-color: #4a56e2;
  box-shadow: 0 4px 14px rgba(74, 86, 226, 0.2);
}

.search-box input {
  border: none;
  outline: none;
  width: 100%;
  background: transparent;
  font-size: 0.95rem;
}

.search-box i {
  color: #4a56e2;
  font-size: 1.2rem;
  margin-right: 8px;
}

.course-card {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  background: #fff;
}

.course-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.course-img img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.course-body {
  padding: 18px;
}

.course-title {
  font-size: 1rem;
  font-weight: 600;
  color: #212529;
  margin-bottom: 8px;
}

.course-meta {
  font-size: 0.9rem;
  color: #6c757d;
  margin-bottom: 12px;
}

.course-meta i {
  color: #4a56e2;
  margin-right: 5px;
}

.progress {
  height: 7px;
  border-radius: 6px;
  background: #e9ecef;
}

.progress-bar {
  background: linear-gradient(90deg, #4a56e2, #7b6ef6);
}

.btn-custom {
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 16px;
  transition: all 0.3s ease;
}

.btn-start {
  background-color: #ff7a00;
  color: #fff;
}

.btn-continue {
  background-color: #4a56e2;
  color: #fff;
}

.btn-start:hover,
.btn-continue:hover {
  opacity: 0.9;
  transform: scale(1.05);
  border: 2px solid black;
}

@media (max-width: 991px) {
  .main {
    margin-left: 0;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
}

@media (max-width: 576px) {
  .sidebar-toggle-btn {
    width: 36px;
    height: 36px;
    top: 10px;
    left: 10px;
  }
  .topbar input {
    width: 100% !important;
  }
  .profile-hero button {
    flex: 1 1 100%;
  }
}

/* Background Blur */
.blur-bg {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  z-index: 1040;
  display: none;
}

/* Modal Box */
.custom-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 70%;
  max-height: 70vh;
  z-index: 1050;
  padding: 25px;
  opacity: 0;
  transition: all 0.35s ease;
  display: none;
  overflow: hidden; /* fix border-radius cut issue */
}

.custom-modal.active {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  animation: slideUp 0.4s ease forwards;
}

@keyframes slideUp {
  from {
    transform: translate(-50%, -40%) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  color: #333;
  cursor: pointer;
  transition: 0.3s;
  font-weight: bold;
}

.close-btn:hover {
  color: #e90f0f;
}

.custom-modal h4 {
  font-weight: 700;
  color: #6c2bd9;
}

.course-progress {
  height: 8px;
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
}

.progress-bar {
  height: 8px;
  background: linear-gradient(90deg, #6c2bd9, #a855f7);
  width: 42%;
}

/* Scrollable Content */
.modal-body-content {
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 8px;
  margin-top: 10px;
  border-radius: 0 0 14px 14px;
}

.modal-body-content::-webkit-scrollbar {
  width: 6px;
}

.modal-body-content::-webkit-scrollbar-thumb {
  background: #c7b6fa;
  border-radius: 10px;
}

.modal-body-content::-webkit-scrollbar-thumb:hover {
  background: #a78bfa;
}

/* Course Item */
.modal-body-content .course-item {
  border: 1px solid #eaeaea;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  background: #f8f9fa;
  transition: 0.3s;
}

.modal-body-content .course-item:hover {
  background: #eef2ff;
}

.modal-body-content .course-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-body-content .thumb {
  width: 60px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.modal-body-content .course-item h6 {
  font-size: 14px;
  margin: 0;
  line-height: 1.3;
}

.modal-body-content .course-item small {
  font-size: 12px;
}

.modal-body-content .completed small {
  color: #28a745;
}

.modal-body-content .pending small {
  color: #dc3545;
}

.modal-body-content .play-btn {
  background: #fff;
  border: 1px solid #6c2bd9;
  color: #6c2bd9;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 13px;
  transition: 0.3s;
}

.modal-body-content .play-btn:hover {
  background: #6c2bd9;
  color: #fff;
}

@media (max-width: 576px) {
  .custom-modal {
    padding: 20px;
    max-width: 95%;
  }
  .thumb {
    width: 50px;
    height: 35px;
  }
}

.register-section {
  background: linear-gradient(135deg, #5c2dab, #7d4ed1);
  color: #fff;
  border-radius: 15px;
  text-align: center;
  padding: 40px 20px;
  margin: 30px auto;
  max-width: 90%;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.register-section h2 {
  font-size: 45px;
  font-weight: bold;
  margin-bottom: 10px;
}

.register-section p {
  font-size: 16px;
  margin-bottom: 25px;
  text-align: center;
}

.register-section .btn {
  background: linear-gradient(90deg, #ff6600, #ff0000);
  border: none;
  padding: 12px 30px;
  font-size: 18px;
  border-radius: 8px;
  color: #fff;
  transition: all 0.3s ease;
}

.register-section .btn:hover {
  opacity: 0.85;
}

footer {
  background: linear-gradient(to bottom, #ffffff, #ffbbac);
  color: #333;
  font-family: "Poppins", sans-serif;
}

footer .footer-main {
  max-width: 90%;
  margin: auto;
}

.footer-logo img {
  width: 200px;
  margin-bottom: 10px;
}

.footer-logo p {
  font-size: 14px;
  margin: 4px 0;
  color: #444;
}

.footer-logo a {
  color: #e65a29;
  text-decoration: none;
  margin: 0 4px;
  font-size: 14px;
}

.footer-logo a:hover {
  color: #ff5722;
}

.footer-column {
  background: #ffe9e1;
  border-radius: 15px;
  padding: 25px 20px;
  margin-right: 10px;
}

.footer-column h3 {
  background: #f6d5c4;
  text-align: center;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 16px;
  font-weight: bold;
}

.footer-column ul {
  list-style: none;

  border-radius: 12px;
  padding: 20px;
}

.footer-column ul li {
  margin: 8px 0;
}

.footer-column ul li a {
  text-decoration: none;
  color: #333;
  font-size: 14px;
  transition: 0.3s;
  text-align: center;
}

.footer-column ul li a:hover {
  color: #ff5722;
}

.footer-bottom {
  background: #222;
  color: #fff;
  text-align: center;
  padding: 10px;
  font-size: 14px;
  margin-top: 30px;
  width: 100%;
}

.footer-contacts {
  background: #ff5722;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 80px;
  font-size: 14px;
}

.footer-bottom p {
  text-align: center;
}

.footer-contacts p {
  margin: 0;
  text-align: center;
}

@media (max-width: 991px) {
  .details .dashboard-row {
    flex-direction: column;
  }
}

@media (max-width: 991px) {
  .main {
    margin-left: 0;
  }
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
  }
}

@media (max-width: 576px) {
  .sidebar-toggle-btn {
    width: 36px;
    height: 36px;
    top: 10px;
    left: 10px;
  }
  .topbar input {
    width: 100% !important;
  }
  .profile-hero button {
    flex: 1 1 100%;
  }
}
