@import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap");

.universities,
.howitwork {
  margin: 1.5rem auto 2rem;
  max-width: 1180px;
  padding: 0 1rem;
}
/*university*/
.searchCont {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.search {
  display: flex;
  align-items: center;
  max-width: 560px;
  width: 100%;
  background-color: var(--card-surface);
  padding: 0.75rem 1rem;
  border-radius: 18px;
  box-shadow: 0 18px 45px -35px var(--shadow-cl);
}
.search img {
  width: 24px;
  margin-right: 0.75rem;
}
.search input {
  border: none;
  width: 100%;
  font-size: 1rem;
  background-color: transparent;
  color: var(--text-color);
}
.search ::placeholder {
  font-size: 0.95rem;
  font-weight: 400;
  color: #7a7a7ae7;
}
.search input:focus {
  border: none;
  outline: none;
}

.universities-header {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.universities-intro {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.uni-p {
  font-size: clamp(2rem, 3.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--text-color);
}

.uni-subtitle {
  max-width: 680px;
  line-height: 1.8;
  color: var(--muted-text);
  font-size: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gridCont {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.7rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.2rem;
  background-color: var(--card-surface);
  border-radius: 24px;
  border: 1px solid rgba(100, 116, 139, 0.08);
  box-shadow: 0 16px 45px -38px var(--shadow-cl);
  transition:transform 0.25s ease,box-shadow 0.25s ease,border-color 0.25s ease;
  color: var(--text-color);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 48px -30px var(--shadow-cl);
  border-color: rgba(23, 125, 228, 0.18);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.card-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  object-fit: contain;
  padding: 0.4rem;
  background: rgba(23, 125, 228, 0.08);
}

.card-details {
  flex: 1;
  min-width: 0;
}

.rank-badge {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 95, 95, 0.12);
  color: #d63939;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.card-sch {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.location {
  color: var(--muted-text);
  font-size: 0.95rem;
  margin: 0;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.card-type,
.card-faculty {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--text-color);
  font-size: 0.85rem;
  font-weight: 600;
}

.card-excerpt {
  margin: 0;
  color: var(--muted-text);
  line-height: 1.8;
  min-height: 4.5rem;
}

.card-actions {
  display: flex;
  justify-content: flex-start;
}

.card-actions .view-profile-btn {
  border: none;
  padding: 0.9rem 1.2rem;
  border-radius: 14px;
  background: linear-gradient(to right, #177de4, #40e0d0);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.card-actions .view-profile-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 25px -18px rgba(23, 125, 228, 0.6);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.491);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 9999;
}
.modal-overlay.open {
  display: flex;
}
.modal-content-university {
  background: var(--card-surface);
  border-radius: 10px;
  max-width: 80vw;
  width: 100%;
  max-height: 89vh;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 10000;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 729.99px) {
  .modal-overlay {
    padding: 0.75rem;
  }

  .modal-content-university {
    max-width: 100vw;
    max-height: 91vh;
  }

  .modal-header-fixed {
    padding: 0.7rem;
  }
}

.modal-header-fixed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.header-title-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-text h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal-scrollable {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Custom scrollbar */
.modal-scrollable::-webkit-scrollbar {
  width: 8px;
}

.modal-scrollable::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.modal-scrollable::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.modal-scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

.modal-hero {
  width: 100%;
  height: 250px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.05));
}

.modal-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  margin-bottom: 0.5rem;
}

.description-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-color);
  margin: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
}

.info-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted-text);
}

.info-value {
  font-size: 0.95rem;
  color: var(--text-color);
  line-height: 1.4;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
}

.contact-item strong {
  font-size: 0.9rem;
  color: var(--text-color);
}

.contact-item span {
  font-size: 0.9rem;
  color: var(--text-color);
}

.academic-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.academic-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
}

.academic-item strong {
  font-size: 0.9rem;
  color: var(--text-color);
}

.academic-item span {
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.5;
}

.facilities-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-color);
  margin: 0;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
}
.modal-close {
  position: relative;
  border: none;
  background: transparent;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-color);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.08);
}

.modal-logo {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  object-fit: contain;
  padding: 4px;
}

.modal-type {
  color: var(--muted-text);
  margin: 0;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.modalimage {
  display: none;
}

.modaldDDescription {
  display: none;
}

.modal-details {
  display: none;
}

.detail-row {
  display: none;
}

.detail-row strong {
  display: none;
}

.detail-row span {
  display: none;
}

.modal-gallery-section {
  display: none;
}

.gallery-title {
  display: none;
}

.gallery-title {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.gallery-image-container {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gallery-image-container:hover {
  transform: scale(1.02);
}

.gallery-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-gallery {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted-text);
  font-size: 0.9rem;
  grid-column: 1 / -1;
}
