/*
 * UNIT GUIDELINES (for my future self):
 * 
 * px  - small, fixed things that shouldn't scale (borders, icons, fine-tuned spacing)
 * rem - DEFAULT for most things! (font sizes, padding, margins) — scales with user font settings
 * %   - widths in flexible layouts, especially hero sections or full-width elements
 * em  - only for local relative scaling (like icon inside a button that follows font size)
 * vw/vh - Rarely, for full-screen effects (hero height: 100vh, etc)
 */


/* styles.css external file*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f0f2f5;
  color: #333;
  line-height: 1.6;
  overflow-x: hidden;
}

/* 
  Glassmorphism effect: 
  backdrop-filter + rgba + border = stylish cards
  DO NOT remove 'backdrop-filter' — it's what makes the blur work!
*/
/* Navigation Bar aka semi-transparent, blurred bar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-brand {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2c3e50;
  letter-spacing: 1px;
}

.nav-buttons {
  display: flex;
  gap: 1rem;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.3);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* Hero Section */
.hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 20px;
  position: relative;
  overflow: hidden;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.shape-circle {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  top: 20%;
  left: 10%;
  filter: blur(20px);
}

.shape-wave {
  position: absolute;
  width: 50%;
  height: 100px;
  background: rgba(255, 255, 255, 0.1);
  bottom: 0;
  left: 0;
  clip-path: polygon(0% 100%, 25% 0%, 50% 100%, 75% 0%, 100% 100%);
  filter: blur(10px);
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero p {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  max-width: 600px;
}

.search-container {
  display: flex;
  gap: 1rem;
  width: 80%;
  max-width: 800px;
  margin-top: 1rem;
}

.search-container input,
.search-container select {
  padding: 1rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  flex: 1;
  outline: none;
}

.search-container input {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.search-container select {
  background: white;
  min-width: 180px;
}

.btn-search {
  padding: 0 1.5rem;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  border-radius: 50px;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
  min-width: 100px;
}

.btn-search:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

/* University List */
.university-list {
  padding: 120px 5% 50px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  min-height: 100vh;
}

/* University Card aka frosted glass*/
.university-card {
  background: rgba(102, 126, 234, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(102, 126, 234, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border-radius: 15px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.university-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.university-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: #333;
}

.university-card p {
  color: #555;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.university-card a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.university-card a:hover {
  text-decoration: underline;
}

.favourite-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  float: right;
  transition: transform 0.2s ease;
}

.favourite-btn:hover {
  transform: scale(1.2);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  color: #2c3e50;
  text-align: center;
}

.favourites-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.fav-item {
  background: rgba(255, 255, 255, 0.3);
  padding: 1rem;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fav-item button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

.btn-close {
  display: block;
  margin: 0 auto;
  padding: 0.7rem 2rem;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  backdrop-filter: blur(5px);
}

/* Auth Form */
#authForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#authForm input {
  padding: 1rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
}

#authForm button {
  padding: 1rem;
  border: none;
  border-radius: 10px;
  background: #667eea;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
}

#authForm button:hover {
  background: #5a6fd8;
}

.toggle-auth {
  text-align: center;
  margin-top: 1rem;
}

.toggle-auth a {
  color: #667eea;
  text-decoration: none;
}

.toggle-auth a:hover {
  text-decoration: underline;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 2rem;
  font-size: 1.2rem;
  color: #666;
}

/* No results */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: #666;
  font-style: italic;
}

/* 
 * TThis is for small screens aka phones BUT Joe might have a smaller screen pc(Mac Air) and this might just keep the website working
 * For usability even when window is resized or on small screens
 */
/* Responsive */
/* Adjustments for smaller desktops or narrow windows */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.8rem; /* larger enough for pc, but not huge */
  }
  
  .hero p {
    font-size: 1.2rem;
  }
  
  .search-container {
    flex-direction: column;
    width: 95%;
    gap: 0.8rem;
  }
  
  .search-container input,
  .search-container select {
    padding: 0.9rem;
  }
  
  .btn-search {
    padding: 0.9rem 1.2rem;
  }
  
  .nav-brand {
    font-size: 1.6rem;
  }
  
  .university-list {
    gap: 1.5rem;
    padding: 100px 3% 40px;
  }
}