/* Base styles */
* {
  font-family: 'Exo 2', Sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #1a1a1a;
  min-height: 100vh;
  color: #a8a8a8;
  display: flex;
  flex-direction: column;
}

/* Header styles */
header {
  background-color: #000000;
  padding: 16px 40px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Purple Glow Across Top */
.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, 
      transparent 0%, 
      rgba(147, 112, 219, 0.1) 20%, 
      rgba(147, 112, 219, 0.3) 40%,
      rgba(147, 112, 219, 0.5) 50%,
      rgba(147, 112, 219, 0.3) 60%,
      rgba(147, 112, 219, 0.1) 80%,
      transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
}

.logo-section {
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  align-items: center;
  position: relative;
  transition: all 0.4s ease;
  overflow: hidden;
  box-shadow: 0 0 0 rgba(98, 77, 227, 0); /* Start with transparent shadow */
}

.logo-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
      to right,
      rgba(255, 255, 255, 0) 0%,
      rgba(207, 183, 255, 0.3) 50%,
      rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  transition: none;
}

.logo-section:hover {
  box-shadow: 0 4px 8px rgba(98, 77, 227, 0.15);
}

.logo-section:hover::before {
  animation: shimmer 1.2s ease-in-out;
}

@keyframes shimmer {
  0% {
      left: -100%;
  }
  100% {
      left: 150%;
  }
}

.logo {
  height: 28px;
  transition: all 0.2s;
  margin-top: 3px;
  margin-right: 4px;
}

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-link {
  font-weight: 400;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #a8a8a8;
  padding: 5px 0;
  text-decoration: none;
  transition: all 0.3s;
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: 0;
  left: 0;
  background-color: #9370db;
  visibility: hidden;
  transition: all 0.3s;
}

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

.nav-link:hover::before {
  visibility: visible;
  width: 100%;
}

/* Main container */
main {
  flex-grow: 1;
  padding: 30px;
  display: flex;
  justify-content: center;
}

.content-container {
  width: 100%;
}

/* Universities Header */
.universities-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  background: linear-gradient(to right, rgba(4, 4, 50, 0.8), rgba(56, 1, 95, 0.8));
  padding: 25px 30px;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.universities-header h1 {
  color: white;
  font-size: 24px;
  font-weight: 600;
}

.search-container {
  display: flex;
  position: relative;
  line-height: 0;
  width: 60%;
  max-width: 500px;
}

.search-input {
  width: 100%;
  padding: 12px 15px 12px 45px;
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(0, 0, 0, 0.3);
  color: white;
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
}

.search-input:focus {
  background-color: rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
  background-color: rgba(19, 15, 63, 0.1);
}

.search-button {
  position: absolute;
  left: 15px;
  top: 50%;
  opacity: 0.8;
  transform: translateY(-50%);
  font-size: 18px;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
  padding: 0;
  margin: 0;
  z-index: 1;
}

.search-icon {
  width: 20px;
  height: 20px;
  display: block;
}

/* Alphabet Navigator */
.alphabet-nav {
  margin-bottom: 30px;
  background-color: #222;
  border-radius: 15px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.letter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.letter-button {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #2c2c2c;
  border: none;
  border-radius: 6px;
  color: #a8a8a8;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.letter-button.active, .letter-button:hover {
  background-color: #14121F;
  color: white;
}

.letter-button:first-child {
  width: auto;
  padding: 0 15px;
}

/* Universities Grid */
.universities-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(300px, 1fr));
  gap: 55px;
  margin-bottom: 55px;
}

/* University Card */
.university-card {
  position: relative;
  display: flex;
  background-color: #222;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  height: 250px;
  width: 100%;
  flex: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-left: 4px solid var(--school-color, #9370db);
}

.university-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Card inner content */
.card-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Card top section */
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

/* Logo and name container */
.card-logo-name {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  width: 100%; /* Add this line */
}

.university-logo {
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--school-color) 40%, transparent);
  position: relative;
  overflow: hidden;
}

.university-logo::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 30%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
}

.name-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: calc(100% - 70px); /* Replace max-width: 70% with this */
  min-width: 0;
}

.university-name {
  color: white;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%; /* Add this line */
}

.student-count {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a8a8a8;
  font-size: 14px;
}

.students-icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.stats-container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 15px;
  background: linear-gradient(to bottom, rgba(40, 40, 40, 0.5), rgba(30, 30, 30, 0.5));
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: white;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

.stat-divider {
  width: 1px;
  background-color: #333;
  margin: 0 10px;
}

/* Card buttons */
.card-buttons {
  display: flex;
  gap: 12px;
  margin-top: auto;
  width: 100%;
}

.view-btn {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--school-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s;
  background-color: transparent;
  color: rgba(255, 255, 255, 0.8);
  background-color: color-mix(in srgb, var(--school-color) 10%, transparent);
}

.view-btn:hover {
  background-color: color-mix(in srgb, var(--school-color) 40%, transparent);
  color: white;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  margin-top: 20px;
}

.pagination-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #333;
  color: #a8a8a8;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.pagination-btn:hover {
  background-color: #444;
  color: white;
}

.pagination-btn.active {
  background: linear-gradient(to right, rgba(4, 4, 50, 0.8), rgba(56, 1, 95, 0.8));
  color: white;
}

.pagination-dots {
  display: flex;
  align-items: center;
  color: #a8a8a8;
}

/* Footer */
footer {
  background-color: #111;
  border-top: 1px solid #333;
  padding: 30px;
}

.footer-content {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-logo {
  font-size: 20px;
  font-weight: 600;
}

.logo-text {
  color: #a8a8a8;
}

.logo-highlight {
  background-image: linear-gradient(to right, rgb(9, 9, 154), rgba(56, 1, 95, 1));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: #a8a8a8;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s;
}

.footer-links a:hover {
  color: white;
}

.footer-copyright {
  color: #666;
  font-size: 12px;
  margin-top: 10px;
}

@media (max-width: 1024px) {
  /* Adjust university grid to 2 columns */
  .universities-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 30px;
  }
  
  /* Adjust header padding */
  .universities-header {
      padding: 20px;
  }
  
  /* Make search smaller */
  .search-container {
      width: 50%;
  }
  
  /* Adjust letter buttons in alphabet nav */
  .letter-button {
      width: 32px;
      height: 32px;
      font-size: 14px;
  }
  
  /* Make letter grid more compact */
  .letter-grid {
      gap: 6px;
  }
  
  /* Adjust university card */
  .university-card {
      height: auto;
      min-height: 230px;
  }
  
  /* Adjust card buttons */
  .card-buttons {
      flex-direction: column;
      gap: 8px;
  }
  
  .view-btn {
      padding: 10px 0;
  }
}

@media (max-width: 425px) {
  /* Center the logo and navigation */
  .header-wrap {
      flex-direction: column;
      align-items: center;
      padding: 15px 0;
  }
  
  /* Add some space between logo and navigation */
  .logo-section {
      margin-bottom: 15px;
  }
  
  /* Center the navigation links */
  .nav-links {
      justify-content: center;
  }
  
  /* Reduce main padding */
  main {
      padding: 15px;
  }
  
  .universities-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  
  /* Adjust header styling but keep the title */
  .universities-header {
      padding: 15px;
      flex-direction: column;
      align-items: center;
      gap: 15px;
  }
  
  .universities-header h1 {
      font-size: 20px;
      margin-bottom: 5px;
  }
  
  /* Make search container full width */
  .search-container {
      width: 100%;
  }
  
  /* Make alphabet nav scrollable */
  .alphabet-nav {
      overflow-x: auto;
      padding: 10px;
  }
  
  .letter-grid {
      flex-wrap: nowrap;
      justify-content: flex-start;
      width: max-content;
      padding: 5px 0;
  }
  
  /* Adjust cards for mobile */
  .university-card {
      margin-bottom: 15px;
  }
  
  /* Make card design more compact */
  .university-logo {
      width: 45px;
      height: 45px;
  }
  
  .university-name {
      font-size: 18px;
  }
  
  .stats-container {
      padding: 12px 10px;
  }
  
  .stat-value {
      font-size: 16px;
  }
  
  .stat-label {
      font-size: 10px;
  }
  
  /* Stack buttons again on very small screens */
  .card-buttons {
      flex-direction: column;
      gap: 8px;
  }
  
  /* Footer adjustments */
  .footer-links {
      flex-wrap: wrap;
      justify-content: center;
      gap: 12px;
  }
}