
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #1a1a1a;
  --secondary-color: #ffffff;
  --accent-color: #ff7e1b;
  --border-color: #eaeaea;
  --text-primary: #333333;
  --radius-lg: 30px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  font-size: 16px;
}


.container {
  max-width: 1400px;
  margin: 10 auto;
  padding: 0 1.5rem;
}


header {
  transition: transform 0.3s;
}


.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}


header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  padding: 0.3rem 1rem;
  margin: 0.9rem 1rem;
  border-radius: 50px;
  box-shadow: var(--shadow-md);
  max-width: 900px;
  overflow-x: auto;
  white-space: nowrap;
  gap: 0.2rem;
}


.nav-link {
  padding: 0.4rem 0.7rem;
  margin: 0 0.15rem;
  border-radius: 20px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--secondary-color);
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
  text-align: center;
  white-space: nowrap;
  min-width: 80px;
  box-sizing: border-box;
  flex: 0 0 auto;
  min-width: 80px;
  max-width: 100vw;
}


.nav-link:hover,
.nav-link.active {
  background: var(--accent-color);
  color: var(--primary-color);
}



main {
  padding: 3rem 0;
  margin-top: 45px;
}


.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.search-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;

}


.card {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.card-header {
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.card-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}


.search-form,
.auth-form {
  padding: 2rem;
  min-height: 60vh;
}

.input-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.input-group label {
  display: block;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
select {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all 0.2s ease;
  background: var(--bg-primary);
  color: var(--text-primary);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder {
  color: var(--text-light);
}

select {
  cursor: pointer;
}


.btn-primary {
  background: var(--accent-color);
  color: var(--primary-color);
  border: none;
  border-radius: 28px;
  font-weight: 700;
  padding: 1.3rem 2.2rem;
  font-size: 1.15rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-primary:hover {
  background: var(--primary-color);
  color: #fff;
}

.btn-outline {
  padding: 0.75rem 1.25rem;
  background: #fff;
  color: #000;
  border: 1px solid #000;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-outline:hover {
  background: #000;
  color: #fff;
  transform: translateY(-1px);
}



.search-results {
  padding: 1rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.result-card {
  background: #fff;
  padding: 2rem;
  border-radius: 16px;
  border: 2px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
}

.result-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--primary-color);
}

.result-card h3 {
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.result-card p {
  color: #666;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.result-card strong {
  color: var(--text-primary);
  font-weight: 600;
}

.result-card a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.result-card a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}



.suggestions-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: none;
  display: none;
  margin-top: 0.25rem;
}
.suggestion-item {
  background: #fff;
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border-bottom: 1px solid var(--border-color);
}
.suggestion-item:last-child {
  border-bottom: none;
}
.suggestion-item:hover, .suggestion-item.active {
  background: var(--accent-color);
  color: #fff;
}


footer {
  background: var(--text-primary);
  color: white;
  padding: 3rem 0 1rem;
}

.footer-content {
  text-align: center;
}

.footer-section {
  text-align: center;
}

.footer-section p {
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0;
}


@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .header-content {
    flex-direction: column;
    text-align: center;
  }

  .search-grid {
    grid-template-columns: 1fr;
  }

  .search-actions {
    flex-direction: column;
  }

  .card-header,
  .search-form,
  .auth-form {
    padding: 1.5rem;
  }
}


.loading {
  opacity: 0.6;
  pointer-events: none;
}


@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-card {
  animation: fadeIn 0.3s ease-out;
}


.suggestions-box::-webkit-scrollbar {
  width: 6px;
}

.suggestions-box::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 3px;
}

.suggestions-box::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.suggestions-box::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

.btn-danger {
  color: var(--danger-color);
  border-color: var(--danger-color);
}

.btn-danger:hover {
  background: var(--danger-color);
  color: white;
}

.auth-card {
  max-width: 400px;
}

.password-input {
  position: relative;
  display: flex;
  align-items: center;
}

.password-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 5px;
}

.password-toggle:hover {
  color: var(--text-secondary);
}

.password-strength {
  margin-top: 0.5rem;
}

.strength-bar {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.strength-fill {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
  border-radius: 2px;
  background: #ccc;
}

.strength-fill.weak {
  background: #ff4444;
}

.strength-fill.fair {
  background: #ff9800;
}

.strength-fill.good {
  background: #2196F3;
}

.strength-fill.strong {
  background: #4CAF50;
}

.strength-text {
  font-size: 0.75rem;
  color: #666;
  display: block;
}

.input-feedback {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.input-feedback.error {
  color: var(--danger-color);
}

.input-feedback.success {
  color: var(--success-color);
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.link-primary {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.875rem;
  text-align: center;
}

.link-primary:hover {
  text-decoration: underline;
}

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  color: #333;
  padding: 1.5rem 2.5rem;
  border-radius: 12px;
  font-size: 1.1rem;
  z-index: 9999;
  opacity: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  animation: fadeInCenter 0.3s;
  min-width: 320px;
  max-width: 500px;
  text-align: center;
  font-weight: 500;
  display: none;
}

@keyframes fadeInCenter {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}


.toast.show {
  display: block;
  opacity: 1;
}

.toast-warning {
  background: #fff;
  color: #ff7e1b;
  border: 3px solid #ff7e1b;
}

.toast-success {
  background: #fff;
  color: #4CAF50;
  border: 3px solid #4CAF50;
}

.toast-error {
  background: #fff;
  color: #ff4444;
  border: 3px solid #ff4444;
}

.toast-info {
  background: #fff;
  color: #2196F3;
  border: 3px solid #2196F3;
}

@media (max-width: 600px) {
  .toast {
    min-width: 280px;
    max-width: 90vw;
    padding: 1.2rem 1.5rem;
    font-size: 1rem;
  }
}

.account-container {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  margin: 16px 0;
}

@media (max-width: 900px) {
  .header-content {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.5rem;
  }
  header h1 {
    width: 100%;
    text-align: center;
    justify-content: center;
    margin-bottom: 0.5rem;
  }
  nav {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 0.3rem 0.2rem;
    margin: 0.5rem 0 0 0;
    border-radius: 30px;
    box-shadow: var(--shadow-md);
    background: var(--primary-color);
  }
  .nav-link {
    min-width: 80px;
    font-size: 0.95rem;
    padding: 0.5rem 0.7rem;
    margin: 0 0.1rem;
    display: inline-block;
    text-align: center;
    border-radius: 20px;
  }
  .nav-link i {
    margin-right: 0.5em;
  }
}
@media (max-width: 600px) {
  nav {
    padding: 0.2rem 0.1rem;
    max-width: 100vw;
  }
  .nav-link {
    font-size: 0.92rem;
    padding: 0.4rem 0.5rem;
    min-width: 70px;
  }
}


.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
}
.modal-content {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 2rem 2.5rem;
  min-width: 320px;
  max-width: 90vw;
  text-align: center;
  position: relative;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #ff7e1b;
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #888;
  cursor: pointer;
  transition: color 0.2s;
}
.modal-close:hover {
  color: #ff7e1b;
}

.result-card a[target="_blank"] {
  display: inline-block;
  background: var(--accent-color);
  color: var(--primary-color) !important;
  padding: 0.75rem 1.5rem;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  margin: 1rem 0 0.5rem 0;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.result-card a[target="_blank"]:hover {
  background: var(--primary-color);
  color: #fff !important;
  text-decoration: none;
  transform: translateY(-1px);
}

.result-card .btn-primary {
  width: 100%;
  margin-top: 1rem;
  padding: 1rem;
  font-size: 1rem;
}

/* My Universities Section - Single Column Layout */
.universities-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}

.user-university-card {
  background: #fff;
  padding: 2rem;
  border-radius: 16px;
  border: 2px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.user-university-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: #007bff;
}

.user-university-info h4 {
  color: #222;
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.user-university-info p {
  color: #666;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.user-university-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.btn-outline.btn-sm {
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.btn-outline.btn-sm:hover {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}

.login-prompt, .loading, .error {
  text-align: center;
  padding: 3rem 2rem;
  color: #666;
}

.loading i, .error i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #ccc;
}

/* Responsive Design for Cards */
@media (max-width: 768px) {
  .search-results, .universities-grid {
    padding: 0.5rem 1rem 1.5rem;
  }
  
  .result-card, .user-university-card {
    padding: 1.5rem;
  }
  
  .result-card h3, .user-university-info h4 {
    font-size: 1.2rem;
  }
  
  .user-university-actions {
    flex-direction: column;
  }
  
  .btn-outline.btn-sm {
    width: 100%;
  }
}