:root {
  --app-bg-color: #f8f9fa;
  --app-text-color: #1c1c1c;
  --app-green-color: #1aab4b;
  --app-red-color: #e93827;
  --app-blue-color: #168dcf;
  --app-bg-white-color: #ffffff;
  --app-transition: all 0.3s ease-in-out;
  --app-filter-bg-color: #f0f0f0;
}
* {
  box-sizing: border-box;
}
html,
body {
  font-family: "Inter", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
  font-size: 14px;
  background: var(--app-bg-color);
  color: var(--app-text-color);
  scroll-behavior: smooth;
  min-height: 100vh;
  margin: 0;
}
.antialiased {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Header Styles */
header {
  background: var(--app-bg-white-color);
  color: var(--app-text-color);
  padding: 0.8rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
}

/* Content Styles */
/* Animation for card entrance */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-section {
  background-color: #0d6efd;
  color: white;
  padding: 2rem 1rem;
  text-align: center;
  overflow: hidden;
}

.hero-section h1 {
  font-weight: 600;
  font-size: 1.5rem;
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
  margin-bottom: 1rem;
}

.hero-section p {
  font-size: 1.25rem;
  opacity: 0.8;
  margin: 0;
}

.card-custom {
  border-radius: 1rem;
  border: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-custom:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.icon-container {
  width: 80px;
  height: 80px;
  background-color: #0d6efd;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
  font-size: 2.5rem;
  animation: none;
}

.card-title {
  font-weight: bold;
  min-height: 3rem;
}

/* Animation for View Course button */
.view-course-animate {
  animation: bounceIn 0.7s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  transition: transform 0.2s, box-shadow 0.2s;
}
.view-course-animate:hover,
.view-course-animate:focus {
  transform: translateY(-4px) scale(1.07) rotate(-2deg);
  box-shadow: 0 8px 24px rgba(13, 110, 253, 0.15);
  background: var(--app-green-color);
  color: #fff;
}
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(30px);
  }
  60% {
    opacity: 1;
    transform: scale(1.05) translateY(-8px);
  }
  80% {
    transform: scale(0.98) translateY(2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.animate-card {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

/* Staggered animation delays */
.animate-card:nth-child(1) {
  animation-delay: 0.2s;
}
.animate-card:nth-child(2) {
  animation-delay: 0.4s;
}
.animate-card:nth-child(3) {
  animation-delay: 0.6s;
}
.animate-card:nth-child(4) {
  animation-delay: 0.8s;
}

/* New styles for the redesigned search input */
.custom-search-container {
  border: 1px solid #ced4da;
  border-radius: 25px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease-in-out;
  display: flex;
  align-items: center;
}

.custom-search-container:focus-within {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-color: #0d6efd;
}

.custom-search-input {
  border: none;
  box-shadow: none;
  flex-grow: 1;
  padding: 0.75rem 1rem;
  font-size: 16px;
}

.custom-search-input:focus {
  outline: none;
  box-shadow: none;
}

.custom-search-icon-wrapper {
  position: relative;
  width: 44px; /* Adjust width to fit the icon/spinner */
  height: 44px; /* Adjust height to fit the icon/spinner */
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--app-filter-bg-color);
}

.custom-search-icon,
.custom-search-loader {
  position: absolute;
  color: #0d6efd;
}

/* New styling for subject list */
.subject-list-item {
  background-color: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.subject-list-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}
.subject-list-item a i {
  margin-right: 5px;
}

.subject-icon {
  font-size: 1.5rem;
  color: #0d6efd;
  margin-right: 1.5rem;
  background: #f8f9fa;
  border-radius: 4rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.subject-text {
  display: flex;
  align-items: center;
}

.subject-text h5 {
  margin-bottom: 0;
  font-weight: 500;
}

.subject-info h5 small {
  font-weight: 400;
  color: #6c757d;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.subject-list-item .btn {
  white-space: nowrap;
  font-weight: 800;
}

.common-badge {
  background-color: #e2ffec;
  color: var(--app-green-color);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  border: 1px solid var(--app-green-color);
}
.first-year-badge {
  background-color: #e2f0ff;
  color: var(--app-blue-color);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  border: 1px solid var(--app-blue-color);
}
.second-year-badge {
  background-color: #ffcdcd;
  color: var(--app-red-color);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  border: 1px solid var(--app-red-color);
}

/* New CSS for the spinning loading icon */
.spinning-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Footer Styles */
footer {
  background: var(--app-bg-white-color);
  color: var(--app-text-color);
  padding: 0.8rem 0;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.01);
}
/* Footer mail link hover animation */
.footer a {
  padding-bottom: 3px;
  background-size: 100% 1px;
  background-position-x: 0%;
  background-position-y: calc(100% - 1px);
  background-repeat: no-repeat;
  padding-left: 0px;
  padding-right: 0px;
  text-decoration: none;
  transition: var(--app-transition);
  color: var(--app-blue-color);
}
.footer a:hover,
.footer a:focus {
  background: linear-gradient(
    90deg,
    var(--app-blue-color),
    var(--app-blue-color)
  );
  background-size: 100% 1px;
  background-position-x: 0%;
  background-position-y: calc(100% - 1px);
  background-repeat: no-repeat;
  animation-name: underlineHover;
  animation-duration: 0.6s;
  animation-timing-function: ease-in-out;
}
@keyframes underlineHover {
  0% {
    background-position-x: 100%;
    background-size: 100% 1px;
  }
  50% {
    background-position-x: 100%;
    background-size: 0% 1px;
  }
  51% {
    background-position-x: 0%;
    background-size: 0% 1px;
  }
  100% {
    background-position-x: 0%;
    background-size: 100% 1px;
  }
}

.form-select {
  border-radius: 4rem;
  border: 1px solid #ced4da;
  font-size: 1rem;
  padding: 0 2.5rem 0 1rem;
  height: 47px;
}
.form-select:hover,
.form-select:focus {
  border: 1px solid #0d6efd;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.subject-list.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.grid-view .subject-list-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.grid-view .subject-list-item .subject-text {
  flex-grow: 1;
  min-height: 4.5rem;
  flex-direction: column;
  width: 100%;
}
.grid-view .subject-list-item .subject-icon {
  margin-right: 0;
  margin-bottom: 1rem;
}
/* New styles for the view toggle to match the screenshot */
.view-toggle-btn {
  border-radius: 2rem;
  border: 1px solid #ced4da;
  overflow: hidden;
  background-color: #fff;
  min-height: 47px;
}
.view-toggle-btn .btn-check + .btn {
  background-color: transparent;
  color: #000;
  border: none;
  padding: 0.75rem 1.5rem;
  position: relative;
  transition: all 0.3s ease;
}
.view-toggle-btn i {
  font-size: 16px;
}
.view-toggle-btn .btn-check:checked + .btn {
  background-color: var(--app-filter-bg-color); /* Light blue background */
  color: #0d6efd;
  font-weight: 600;
}
.view-toggle-btn .btn-check + .btn .check-icon {
  position: absolute;
  left: 0.5rem; /* Start hidden */
  opacity: 0;
  top: 50%;
  transform: translateY(-50%) scale(0); /* Initially hidden and scaled down */
  transition: all 0.3s ease;
}
.view-toggle-btn .btn-check:checked + .btn .check-icon {
  left: 0.5rem; /* Slide into view */
  transform: translateY(-50%) scale(1); /* Scale up to full size */
  opacity: 1;
}
.view-toggle-btn .btn-check + .btn i {
  transition: left 0.3s ease;
  position: relative;
}
.view-toggle-btn .btn-check:checked + .btn i,
.view-toggle-btn .btn-check:checked + .btn span {
  left: 0.5rem; /* Slide into view */
}

.view-toggle-btn .btn-check + .btn i:not(.check-icon) {
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease, left 0.3s ease;
}
.view-toggle-btn .btn-check:checked + .btn i:not(.check-icon) {
  transform: translateX(0.5rem);
  transition: transform 0.3s ease, left 0.3s ease;
}

/* Responsive styles */
@media (max-width: 576px) {
  .subject-icon {
    display: none;
  }
  .subject-list-item {
    gap: 1rem;
    padding: 1rem;
  }
}
@media (max-width: 768px) {
}
