* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  background: #0a0a0a;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  padding-top: 90px;
  padding-bottom: 0;
  color: #e0e0e0;
  display: flex;
  flex-direction: column;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #000000;
  border-bottom: 2px solid #fbbf24;
  padding: 20px 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.nav-brand {
  font-size: 1.5em;
  font-weight: 700;
  color: #fbbf24;
}

.container {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  padding-bottom: 40px;
}

header {
  text-align: center;
  margin-bottom: 40px;
  margin-top: 20px;
  padding: 20px 0;
}

header h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin-bottom: 12px;
  font-weight: 700;
  color: #fff;
}

header p {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: #888888;
  font-weight: 400;
}

main {
  background: #1a1a1a;
  border-radius: 16px;
  padding: clamp(20px, 5vw, 40px);
  border: 1px solid #333333;
}

.search-section {
  display: flex;
  gap: 12px;
  margin-bottom: 25px;
}

#rollNumber {
  flex: 1;
  padding: 16px 20px;
  border: 2px solid #333333;
  border-radius: 8px;
  font-size: 16px;
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: "Montserrat", sans-serif;
  transition: all 0.3s;
}

#rollNumber:focus {
  outline: none;
  border-color: #fbbf24;
  background: #000000;
}

button {
  padding: 16px 32px;
  background: #fbbf24;
  color: #000000;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  font-family: "Montserrat", sans-serif;
  white-space: nowrap;
}

button:hover {
  background: #f59e0b;
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.loading {
  text-align: center;
  padding: 30px 0;
}

.spinner {
  width: 45px;
  height: 45px;
  border: 3px solid #333333;
  border-top: 3px solid #fbbf24;
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}

.result-section {
  margin-bottom: 25px;
  margin-top: 25px;
}

.student-info-card {
  background: #000000;
  border: 2px solid #fbbf24;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
}

.student-name-display {
  background: #fbbf24;
  padding: clamp(25px, 5vw, 40px);
  text-align: center;
}

.name-label {
  font-size: clamp(10px, 2vw, 12px);
  color: #000000;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
  opacity: 0.7;
}

.name-value {
  font-size: clamp(22px, 5vw, 32px);
  color: #000000;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.roll-number-display {
  background: #000000;
  padding: clamp(20px, 4vw, 35px);
  text-align: center;
}

.roll-label {
  font-size: clamp(10px, 2vw, 11px);
  color: #666666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.roll-value {
  font-size: clamp(20px, 4vw, 28px);
  color: #fbbf24;
  font-weight: 700;
}

.error-message {
  background: #2a1515;
  border: 1px solid #4a2020;
  color: #fca5a5;
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 15px;
  font-weight: 400;
}

.all-students-section {
  margin-top: 30px;
  border-top: 1px solid #333333;
  padding-top: 20px;
}

#showAllBtn {
  width: 100%;
  background: #000000;
  color: #fbbf24;
  border: 1px solid #333333;
  margin-bottom: 20px;
}

#showAllBtn:hover {
  background: #1a1a1a;
}

.students-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.student-card {
  background: #0a0a0a;
  padding: 18px;
  border-radius: 10px;
  border: 2px solid #333333;
  transition: all 0.3s;
  cursor: pointer;
  text-align: center;
}

.student-card:hover {
  background: #1a1a1a;
  border-color: #fbbf24;
  transform: translateY(-3px);
}

.student-card .roll {
  font-weight: 700;
  color: #fbbf24;
  font-size: 0.95em;
  margin-bottom: 10px;
}

.student-card .name {
  color: #a0aec0;
  font-size: 0.85em;
  line-height: 1.5;
  font-weight: 500;
  word-break: break-word;
}

.hidden {
  display: none;
}

.footer {
  margin-top: auto;
  padding: 15px;
  text-align: center;
  background: #000000;
  border-top: 2px solid #fbbf24;
  font-size: 14px;
  font-family: "Montserrat", sans-serif;
  color: #888888;
  width: 100%;
}

.github-link {
  display: inline;
  margin-right: 5px;
}

.github-icon {
  width: 18px;
  height: 18px;
  color: #888888;
  vertical-align: middle;
  transition: all 0.2s;
}

.github-link:hover .github-icon {
  color: #fbbf24;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 600px) {
  body {
    padding: 0;
    padding-top: 70px;
  }

  .navbar {
    padding: 15px 0;
  }

  .nav-brand {
    font-size: 1.2em;
  }

  header {
    margin-bottom: 30px;
    padding: 0 15px;
  }

  main {
    border-radius: 0;
  }

  .search-section {
    flex-direction: column;
    gap: 10px;
  }

  button {
    width: 100%;
    padding: 14px 20px;
  }

  .student-info-card {
    border-radius: 0;
  }

  .students-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .student-card {
    padding: 14px;
  }
}

@media (max-width: 400px) {
  body {
    padding: 0;
    padding-top: 65px;
  }

  .navbar {
    padding: 12px 0;
  }

  .students-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 700px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 800px;
  }
}
