
:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --accent: #f59e42;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #fbbf24;
  --bg: #f8fafc;
  --card-bg: #fff;
  --border: #e5e7eb;
  --text: #22223b;
  --muted: #6b7280;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(30, 64, 175, 0.10);
  --navbar-height: 64px;
  --transition: 0.18s cubic-bezier(.4,0,.2,1);
  --font-main: 'Inter', 'Poppins', 'Segoe UI', Arial, sans-serif;
}

/* ===== Reset & Base ===== */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  font-size: 1.05rem;
  margin: 0;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition);}
a:focus { outline: 2px solid var(--primary-dark); outline-offset: 2px; }

/* ===== Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, #FFA500 0%, #FF7F50 50%, #FF6347 100%);
  color: #fff;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: var(--shadow);
}
.navbar .logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
  user-select: none;
  color: #fff;
}
.navbar nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.navbar button {
  background: #FF7F50;
  color: #fff;
  border: none;
  padding: 0.5rem 1.2rem; 
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
  box-shadow: 0 1px 4px rgba(255,127,80,0.08);
  outline: none;
}
.navbar button:hover,
.navbar button:focus {
  background: #e0e0e0 !important;
  color: #222 !important;
  box-shadow: 0 6px 24px rgba(224,224,224,0.18), 0 1.5px 6px rgba(0,0,0,0.08);
  transform: translateY(-4px) scale(1.05);
}
.navbar button:active {
  background: #ccc !important;
  color: #222 !important;
  transform: scale(0.98);
} 

/* ===== Main Layout ===== */
main {
  max-width: 900px;
  margin: 2.5rem auto;
  padding: 2rem 1rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ===== Headings ===== */
h1, h2 {
  color: var(--primary-dark);
  margin-bottom: 1.2rem;
  font-weight: 700;
}
h1 {
  font-size: 2rem;
  text-align: center;
  background: #000;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
h2 { font-size: 1.3rem; }

/* ===== Forms ===== */
form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: #fff;
  color: #222;
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(255,127,80,0.10);
  padding: 2rem 1.5rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
label {
  font-weight: 500;
  color: var(--primary-dark);
  margin-bottom: 0.2rem;
}
input[type='text'],
input[type='password'],
input[type='email'],
select {
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: #f3f4f6;
  color: #222;
  transition: border var(--transition), box-shadow var(--transition);
}
input:focus, select:focus {
  border-color: #FFA500;
  outline: 2px solid #FFA500;
  background: #fff;
  box-shadow: 0 0 0 2px #FFA50033;
}
form button[type='submit'] {
  background: #FFA500;
  color: #fff;
  border: none;
  padding: 0.9rem 0;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(255,127,80,0.08);
}
form button[type='submit']:hover,
form button[type='submit']:focus {
  background: #222;
  color: #fff;
  outline: none;
  transform: translateY(-2px) scale(1.04);
}
form p {
  color: var(--muted);
  font-size: 0.98rem;
  margin-top: -0.7rem;
}
form a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 500;
}

/* ===== Password Strength Meter ===== */
#passStrengthMeter {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e5e7eb;
  margin-top: 0.2rem;
  margin-bottom: 0.2rem;
  appearance: none;
  outline: none;
}
#passStrengthMeter::-webkit-progress-bar { background: #e5e7eb; border-radius: 4px; }
#passStrengthMeter::-webkit-progress-value { border-radius: 4px; background: var(--danger);}
#passStrengthMeter.weak::-webkit-progress-value { background: var(--danger);}
#passStrengthMeter.medium::-webkit-progress-value { background: var(--warning);}
#passStrengthMeter.strong::-webkit-progress-value { background: var(--success);}
#passStrengthText {
  font-size: 0.98rem;
  font-weight: 600;
  margin-left: 0.2rem;
}
#passStrengthText.weak { color: var(--danger);}
#passStrengthText.medium { color: var(--warning);}
#passStrengthText.strong { color: var(--success);}

/* ===== Popup/Toast Notification ===== */
#popup, .popup {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  min-width: 280px;
  max-width: 90vw;
  background: #4caf50; /* Default: success green */
  color: #fff;
  padding: 1.1rem 2.2rem;
  border-radius: 14px;
  font-weight: 600;
  font-size: 1.15rem;
  z-index: 99999;
  display: none;
  box-shadow: 0 8px 32px rgba(30, 64, 175, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s, background 0.3s;
  text-align: center;
  letter-spacing: 0.01em;
}

#popup.show, .popup.show {
  display: block;
  opacity: 1;
  pointer-events: auto;
  animation: fadeInOut 3s forwards;
}

#popup.success, .popup.success {
  background: #4caf50;
}

#popup.error, .popup.error {
  background: #f44336;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; }
}

/* ===== Search Bar & Filter ===== */
#searchContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0 1.5rem 0;
}
#searchInput, #countrySelect {
  width: 100%;
  max-width: 400px;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: #f3f4f6;
  transition: border var(--transition), box-shadow var(--transition);
}
#searchInput:focus, #countrySelect:focus {
  border-color: var(--primary);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 2px #2563eb33;
}

.search-btn {
  background: #FFA500;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.7rem 1.2rem;
  box-shadow: 0 2px 4px rgba(255,127,80,0.10);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.search-btn:hover, .search-btn:focus {
  background: #e0e0e0;
  color: #222;
  box-shadow: 0 6px 24px rgba(224,224,224,0.18), 0 1.5px 6px rgba(0,0,0,0.08);
  transform: translateY(-4px) scale(1.05);
}
.search-btn:active {
  background: #ccc;
  color: #222;
  transform: scale(0.98);
}

/* ===== University Results (Cards/Tiles) ===== */
#resultsList {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
  gap: 1.2rem;
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 700px;
  width: 100%;
}
#resultsList li {
  background: linear-gradient(135deg, #fff 70%, #f3f4f6 100%);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
  min-height: 160px;
  width: 100%;
}
#resultsList li h3 {
  margin: 0 0 0.3rem 0;
  color: var(--primary-dark);
  font-size: 1.1rem;
  font-weight: 600;
}
#resultsList li p {
  color: var(--muted);
  font-size: 0.98rem;
  margin: 0 0 0.5rem 0;
}
#resultsList li a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: underline;
  margin-right: 1rem;
  transition: color var(--transition);
}
#resultsList li a:hover, #resultsList li a:focus {
  color: var(--primary-dark);
}
#resultsList li button {
  background: #FFA500;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.5rem 1.1rem;
  box-shadow: 0 2px 4px rgba(255,127,80,0.10);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
#resultsList li button:hover, #resultsList li button:focus {
  background: #222;
  color: #fff;
  box-shadow: 0 6px 24px rgba(34,34,34,0.18), 0 1.5px 6px rgba(0,0,0,0.08);
  transform: translateY(-4px) scale(1.05);
}
#resultsList li button:active {
  background: #444;
  color: #fff;
  transform: scale(0.98);
}

/* ===== Favourite List (Dashboard) ===== */
.fav-list {
  max-width: 900px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.fav-list h2 {
  margin-bottom: 1.2rem;
  color: var(--primary-dark);
}
.fav-list ul {
  padding: 0;
  list-style: none;
}
.fav-list li {
  background: linear-gradient(135deg, #fff 70%, #f3f4f6 100%);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.fav-list li a {
  color: var(--primary);
  margin-right: 1rem;
  text-decoration: underline;
}
.fav-list li button {
  background: #FFA500;
  color: #fff;
  border: none;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.fav-list li button:hover, .fav-list li button:focus {
  background: #e0e0e0 !important;
  color: #222 !important;
  box-shadow: 0 6px 24px rgba(224,224,224,0.18), 0 1.5px 6px rgba(0,0,0,0.08);
  transform: translateY(-4px) scale(1.05);
}
.fav-list li button:active {
  background: #ccc !important;
  color: #222 !important;
  transform: scale(0.98);
}

/* ===== Accessibility & Focus ===== */
button:focus, input:focus, select:focus, a:focus {
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
}
::selection { background: #c7d2fe; }

/* ===== Responsive Design ===== */
@media (max-width: 1100px) {
  main, .fav-list { max-width: 98vw; padding: 1.2rem; }
  #resultsList { max-width: 98vw; }
}
@media (max-width: 700px) {
  .navbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    height: auto;
    gap: 0.5rem;
  }
  .navbar nav { gap: 0.3rem; margin-top: 0.7rem; }
  main, .fav-list { padding: 0.7rem; }
  #resultsList { grid-template-columns: 1fr; gap: 1rem; }
}
@media (max-width: 500px) {
  h1 { font-size: 1.2rem; }
  h2 { font-size: 1rem; }
  .navbar .logo { font-size: 1rem; }
  #resultsList { grid-template-columns: 1fr; gap: 0.7rem; }
  main, .fav-list { padding: 0.3rem; }
}

/* ===== Footer ===== */
footer {
  text-align: center;
  margin-top: 3rem;
  padding: 2rem 0;
  color: var(--muted);
  font-size: 1rem;
  background: #f3f4f6;
  border-top: 1px solid var(--border);
}

.navbar button:hover,
.navbar button:focus,
.search-btn:hover,
.search-btn:focus,
.search-section button:hover,
#searchBtn:hover,
.fav-list li button:hover,
.fav-list li button:focus,
button:hover,
button:focus {
  background: #222 !important;
  color: #fff !important;
  box-shadow: 0 6px 24px rgba(34,34,34,0.18), 0 1.5px 6px rgba(0,0,0,0.08);
  transform: translateY(-4px) scale(1.05);
  cursor: pointer;
}
.navbar button:active,
.search-btn:active,
.search-section button:active,
#searchBtn:active,
.fav-list li button:active,
button:active {
  background: #444 !important;
  color: #fff !important;
  transform: scale(0.98);
}

.fav-list h2 {
  color: #000 !important;
}

.fav-list li a,
#allUnisList .website-btn,
#resultsList li a.website-btn {
  display: inline-block;
  background: #FF7F50;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.5rem 1.1rem;
  margin-right: 1rem;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(255,127,80,0.10);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.fav-list li a:hover,
#allUnisList .website-btn:hover,
#resultsList li a.website-btn:hover,
.fav-list li a:focus,
#allUnisList .website-btn:focus,
#resultsList li a.website-btn:focus {
  background: #333;
  color: #fff;
  box-shadow: 0 6px 24px rgba(34,34,34,0.18), 0 1.5px 6px rgba(0,0,0,0.08);
  transform: translateY(-4px) scale(1.05);
  outline: none;
}

.website-btn {
  display: inline-block;
  background: #FF7F50;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.5rem 1.1rem;
  margin-right: 1rem;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(255,127,80,0.10);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.website-btn:hover,
.website-btn:focus {
  background: #333;
  color: #fff;
  box-shadow: 0 6px 24px rgba(34,34,34,0.18), 0 1.5px 6px rgba(0,0,0,0.08);
  transform: translateY(-4px) scale(1.05);
  outline: none;
}

/* === Styles moved from index.html inline === */

.navbar {
  background: linear-gradient(135deg, #FFA500 0%, #FF7F50 50%, #FF6347 100%);
  padding: 2rem;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 900px;
}

.logo {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.navbar nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

#userDisplay {
  display: none;
  color: #fff;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-family: inherit;
}

#logoutBtn {
  display: none;
}

#homeSection p {
  text-align: center;
  margin: 0 auto;
  font-size: 1.1rem;
}

#searchContainer > div {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
  position: relative;
}

#suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-height: 200px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
}

#loginSection,
#registerSection {
  display: none;
}

#loginForm input[type='text'],
#loginForm input[type='password'],
#registerForm input[type='text'],
#registerForm input[type='password'] {
  width: 100%;
  box-sizing: border-box;
}

#loginForm > div,
#registerForm > div {
  position: relative;
}

#loginPassword,
#registerPassword,
#registerConfirm {
  padding-right: 2.5rem;
  width: 100%;
  box-sizing: border-box;
}

#toggleLoginPassword,
#toggleRegisterPassword,
#toggleRegisterConfirm {
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  display: flex;
  align-items: center;
  height: 100%;
}

footer {
  text-align: center;
  margin-top: 3rem;
  padding: 2rem 0;
  color: #6b7280;
  font-size: 1rem;
  background: #f3f4f6;
  border-top: 1px solid #e5e7eb;
}

