@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap");

.results-main {
  background-color: #f8fafc;
  min-height: calc(100vh - 80px);
  padding-bottom: 80px;
}

/* --- Search Banner & 4-Part Input --- */
.search-banner {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  padding: 80px 20px 60px;
  text-align: center;
  border-bottom: 1px solid #ffcc80;
}
.badge {
  background-color: #ffffff;
  color: #e65100;
  padding: 6px 16px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
  margin-bottom: 15px;
  box-shadow: 0 2px 5px rgba(230, 81, 0, 0.1);
}
.search-banner h1 {
  font-size: 3rem;
  color: #2c3e50;
  font-weight: 800;
  margin: 0 0 15px 0;
}
.search-banner .highlight {
  color: #e65100;
}
.search-banner p {
  color: #546e7a;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 30px;
}

.search-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  margin: 0 auto;
  max-width: 700px;
}

.roll-input-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: white;
  padding: 15px 25px;
  border-radius: 50px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  border: 2px solid #ffffff;
  transition: 0.3s;
  width: 100%;
  box-sizing: border-box;
}
.roll-input-container:focus-within {
  border-color: #e65100;
  box-shadow: 0 10px 30px rgba(230, 81, 0, 0.15);
}

.roll-part {
  width: 70px;
  text-align: center;
  border: 2px solid transparent;
  outline: none;
  font-family: monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: #2c3e50;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 12px 0;
  text-transform: uppercase;
  transition: 0.2s;
}
.roll-part:focus {
  background: #fff7ed;
  color: #e65100;
  border-color: #ffcc80;
}
.roll-part::placeholder {
  color: #cbd5e1;
  font-weight: 500;
}
.dash {
  color: #94a3b8;
  font-weight: bold;
  font-size: 1.5rem;
}

#search-btn {
  background: #e65100;
  color: white;
  border: none;
  padding: 16px 45px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.15rem;
  cursor: pointer;
  transition: 0.3s;
  font-family: inherit;
  box-shadow: 0 10px 20px rgba(230, 81, 0, 0.25);
}
#search-btn:hover {
  background: #b33e00;
  transform: translateY(-2px);
  box-shadow: 0 15px 25px rgba(230, 81, 0, 0.35);
}

.error-text {
  color: #dc2626;
  margin-top: 20px;
  font-weight: 600;
  font-size: 1rem;
  background: #fee2e2;
  padding: 10px 20px;
  border-radius: 8px;
  display: inline-block;
}
.hidden {
  display: none !important;
}

/* --- Result Card --- */
#result-section {
  margin-top: -30px;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 10;
}
.result-card {
  background: white;
  width: 100%;
  max-width: 800px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  border: 1px solid #e2e8f0;
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-header {
  background: #2c3e50;
  padding: 30px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}
.header-titles h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
}
.school-name {
  margin: 5px 0 0;
  color: #94a3b8;
  font-size: 1rem;
}
.status-badge {
  background: #10b981;
  color: white;
  padding: 6px 16px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.student-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 30px 40px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}
.info-item {
  display: flex;
  flex-direction: column;
}
.info-item label {
  font-size: 0.85rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 5px;
}
.info-item strong {
  font-size: 1.15rem;
  color: #0f172a;
  font-weight: 700;
}

.marks-breakdown {
  padding: 30px 40px;
}
.marks-breakdown h3 {
  margin: 0 0 20px;
  font-size: 1.2rem;
  color: #334155;
}
.marks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}
.mark-box {
  border: 1px solid #e2e8f0;
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  background: white;
}
.mark-box span {
  display: block;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.mark-box strong {
  font-size: 1.5rem;
  color: #e65100;
  font-weight: 800;
}

.rank-container {
  display: flex;
  padding: 0 40px 30px;
  gap: 20px;
}
.rank-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 15px;
  background: #f1f5f9;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}
.rank-box.alt {
  background: #fff7ed;
  border-color: #ffedd5;
}
.rank-box .material-icons-round {
  font-size: 2.5rem;
  color: #64748b;
}
.rank-box.alt .material-icons-round {
  color: #e65100;
}
.rank-box label {
  display: block;
  font-size: 0.9rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
}
.rank-box.alt label {
  color: #c2410c;
}
.rank-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 2px;
}

.card-footer {
  padding: 30px 40px;
  background: white;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}
.btn-primary-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #e65100;
  color: white;
  border: none;
  padding: 16px 40px;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.3s;
  font-family: inherit;
  box-shadow: 0 10px 20px rgba(230, 81, 0, 0.25);
  width: 100%;
  max-width: 400px;
}
.btn-primary-lg:hover {
  background: #b33e00;
  transform: translateY(-3px);
  box-shadow: 0 15px 25px rgba(230, 81, 0, 0.35);
}
.btn-primary-lg:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (max-width: 600px) {
  .search-banner h1 {
    font-size: 2.2rem;
  }
  .roll-input-container {
    padding: 12px;
    gap: 5px;
    border-radius: 16px;
    flex-wrap: wrap;
  }
  .roll-part {
    width: 60px;
    font-size: 1.1rem;
    padding: 10px 0;
  }
  .dash {
    font-size: 1.2rem;
  }
  .student-info-grid,
  .marks-grid,
  .rank-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .card-header,
  .student-info-grid,
  .marks-breakdown,
  .rank-container,
  .card-footer {
    padding: 20px;
  }
}
