/* ================================================
   RESULTS PAGE STYLES – Disha 2025-26
   Search → Cards → Detail View
   ================================================ */

/* --- VISIBILITY FIX --- */
.results-hero,
.search-section,
.result-detail-section,
#view-search,
#view-result {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

/* --- NAV ACTIVE --- */
.nav-active {
  color: #1f4fd8 !important;
  font-weight: 700 !important;
}

/* --- HERO --- */
.results-hero {
  background: linear-gradient(135deg, #1f4fd8 0%, #163aa7 100%);
  padding: 120px 20px 60px;
  text-align: center;
  color: #ffffff;
}

.results-hero-inner {
  max-width: 700px;
  margin: 0 auto;
}

.r-badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 6px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
  display: inline-block;
  letter-spacing: 0.5px;
}

.results-hero h1 {
  font-size: 48px;
  line-height: 1.15;
  margin-bottom: 16px;
  font-weight: 800;
  color: #ffffff;
}

.results-hero .accent {
  color: #ff7a18;
}

.results-subtitle {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
  line-height: 1.6;
}

/* --- SEARCH SECTION --- */
.search-section {
  padding: 0 20px 80px;
  background: #f8faff;
  margin-top: -28px;
}

.search-container {
  max-width: 620px;
  margin: 0 auto;
}

/* Search Box */
.search-box {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 16px;
  padding: 6px 6px 6px 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid #e0e4ee;
  position: relative;
  z-index: 10;
}

.search-box:focus-within {
  border-color: #1f4fd8;
  box-shadow: 0 18px 40px rgba(31, 79, 216, 0.15);
}

.search-box-icon {
  display: flex;
  align-items: center;
  margin-right: 12px;
  flex-shrink: 0;
}

#search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 17px;
  font-family: 'Poppins', sans-serif;
  padding: 14px 0;
  background: transparent;
  color: #222;
  letter-spacing: 0.5px;
}

#search-input::placeholder {
  color: #aaa;
  font-weight: 400;
  letter-spacing: 0;
}

.search-go-btn {
  background: linear-gradient(135deg, #1f4fd8, #163aa7);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.search-go-btn:hover {
  background: linear-gradient(135deg, #ff7a18, #e56a10);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 122, 24, 0.35);
}

/* Initial message */
.initial-message {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.initial-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.initial-message p {
  font-size: 15px;
  font-weight: 500;
}

/* Loading */
.loading-bar {
  text-align: center;
  padding: 50px 20px;
}

.loading-pulse {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border: 4px solid #e0e4ee;
  border-top: 4px solid #1f4fd8;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-bar p {
  color: #888;
  font-size: 14px;
  font-weight: 500;
}

/* No results */
.no-results-card {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border-radius: 20px;
  margin-top: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  border: 1px solid #f0f2f5;
}

.no-results-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.no-results-card h3 {
  font-size: 20px;
  color: #333;
  margin-bottom: 8px;
  font-weight: 700;
}

.no-results-card p {
  color: #888;
  font-size: 14px;
}

/* --- STUDENT CARDS --- */
.student-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 28px;
}

.student-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
  border: 1px solid #eef0f5;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.student-card:hover {
  border-color: #1f4fd8;
  box-shadow: 0 12px 32px rgba(31, 79, 216, 0.12);
  transform: translateY(-2px);
}

.student-card-info {
  flex: 1;
}

.student-card-name {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.student-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 8px;
  background: #f0f4ff;
  color: #1f4fd8;
}

.meta-tag.school {
  background: #fff7ed;
  color: #c2410c;
}

.meta-tag.location {
  background: #f0fdf4;
  color: #166534;
}

.student-card-arrow {
  font-size: 22px;
  color: #ccc;
  transition: color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.student-card:hover .student-card-arrow {
  color: #1f4fd8;
  transform: translateX(3px);
}

/* --- DETAIL VIEW --- */
.result-detail-section {
  padding: 100px 20px 80px;
  background: #f8faff;
  min-height: calc(100vh - 120px);
}

.result-detail-container {
  max-width: 640px;
  margin: 0 auto;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #1f4fd8;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 24px;
  padding: 8px 0;
  transition: color 0.2s;
}

.back-btn:hover {
  color: #ff7a18;
}

/* Result Card */
.result-card {
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  border: 1px solid #eef0f5;
}

.result-card-header {
  background: linear-gradient(135deg, #1f4fd8, #163aa7);
  padding: 36px 32px;
  color: white;
  text-align: center;
}

.result-card-header h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
}

.result-card-header .result-class {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.85;
}

.result-card-header .result-school {
  font-size: 13px;
  opacity: 0.7;
  margin-top: 6px;
}

/* Score Circle */
.score-section {
  display: flex;
  justify-content: center;
  padding: 32px 24px 20px;
  position: relative;
}

.score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(#1f4fd8 calc(var(--pct) * 1%), #e8ecf4 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.score-circle-inner {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-pct {
  font-size: 32px;
  font-weight: 800;
  color: #1f4fd8;
  line-height: 1;
}

.score-label {
  font-size: 11px;
  color: #888;
  font-weight: 600;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Marks Row */
.marks-row {
  display: flex;
  justify-content: center;
  gap: 32px;
  padding: 0 24px 28px;
}

.marks-item {
  text-align: center;
}

.marks-value {
  font-size: 24px;
  font-weight: 800;
  color: #1a1a1a;
}

.marks-label {
  font-size: 12px;
  color: #888;
  font-weight: 600;
}

/* Detail Rows */
.result-details {
  padding: 0 32px 32px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #f4f5f7;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 14px;
  color: #888;
  font-weight: 500;
}

.detail-value {
  font-size: 14px;
  color: #1a1a1a;
  font-weight: 700;
  text-align: right;
}

/* Rank badges */
.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}

.rank-national {
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.rank-state {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Status + Congrats Banner (unified) */
.status-banner {
  padding: 28px 32px 24px;
  text-align: center;
  animation: banner-enter 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.status-banner.national {
  background: linear-gradient(135deg, #fffbeb, #fef3c7, #fde68a);
  color: #92400e;
}

.status-banner.state {
  background: linear-gradient(135deg, #eff6ff, #dbeafe, #bfdbfe);
  color: #1e3a8a;
}

.status-banner-emoji {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 8px;
  animation: emoji-pop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both;
}

.status-banner-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
  animation: text-rise 0.4s ease 0.4s both;
}

.status-banner-rank {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.8;
  animation: text-rise 0.4s ease 0.55s both;
}

/* --- MOBILE --- */
@media (max-width: 768px) {
  .results-hero {
    padding: 100px 20px 50px;
  }

  .results-hero h1 {
    font-size: 34px;
  }

  .results-subtitle {
    font-size: 14px;
  }

  .search-box {
    flex-direction: column;
    border-radius: 18px;
    padding: 12px;
    gap: 10px;
  }

  .search-box-icon {
    display: none;
  }

  #search-input {
    text-align: center;
    font-size: 18px;
    padding: 10px 0;
  }

  .search-go-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
  }

  .student-card {
    padding: 18px;
  }

  .student-card-name {
    font-size: 16px;
  }

  .result-card-header {
    padding: 28px 20px;
  }

  .result-card-header h2 {
    font-size: 22px;
  }

  .result-details {
    padding: 0 20px 24px;
  }

  .marks-row {
    gap: 20px;
  }
}

/* --- CONFETTI PARTICLES --- */
.confetti-particle {
  position: absolute;
  z-index: 100;
  pointer-events: none;
  opacity: 1;
  animation: confetti-burst 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes confetti-burst {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot));
    opacity: 0;
  }
}

/* --- BANNER ANIMATIONS --- */
@keyframes banner-enter {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes emoji-pop {
  0% { transform: scale(0) rotate(-15deg); }
  50% { transform: scale(1.3) rotate(5deg); }
  70% { transform: scale(0.9) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes text-rise {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}