* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Cairo', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 88px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 20px;
}

.header {
  text-align: center;
  margin-bottom: 40px;
  background: #fff;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 12px;
}

.header p {
  color: #7f8c8d;
  font-size: 1.15rem;
  font-weight: 500;
}

.stats-section {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.stat-item {
  background: linear-gradient(135deg, #c8102e 0%, #a00d24 100%);
  color: #fff;
  padding: 18px 22px;
  border-radius: 15px;
  text-align: center;
  min-width: 140px;
  box-shadow: 0 8px 25px rgba(200, 16, 46, 0.3);
  border: 2px solid #c8102e;
  transition: transform 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-5px);
}

.stat-item i {
  font-size: 1.7rem;
  display: block;
  margin-bottom: 8px;
}

.stat-number {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.95;
}

.top-students-link {
  margin-top: 28px;
  text-align: center;
}

.top-students-btn {
  background: linear-gradient(135deg, #c8102e 0%, #a00d24 100%);
  color: #fff;
  padding: 14px 28px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 5px 15px rgba(200, 16, 46, 0.3);
  transition: 0.3s;
  border: 2px solid #c8102e;
}

.top-students-btn:hover {
  transform: translateY(-3px);
  color: #fff;
  background: linear-gradient(135deg, #a00d24, #c8102e);
}

.search-box {
  background: #fff;
  padding: 36px;
  border-radius: 20px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.search-form {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input {
  flex: 1;
  padding: 16px 22px;
  border: 2px solid #ecf0f1;
  border-radius: 12px;
  font-size: 1.05rem;
  background: #f8f9fa;
  text-align: center;
  transition: 0.25s;
  font-family: 'Cairo', sans-serif;
}

.search-input:focus {
  outline: none;
  border-color: #c8102e;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

.search-btn {
  background: linear-gradient(135deg, #c8102e 0%, #a00d24 100%);
  color: #fff;
  border: 2px solid #c8102e;
  padding: 16px 30px;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 5px 15px rgba(200, 16, 46, 0.3);
  transition: 0.25s;
  font-family: 'Cairo', sans-serif;
}

.search-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #a00d24, #c8102e);
}

.search-btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

.search-error {
  background: linear-gradient(135deg, #fff5f5, #fed7d7);
  color: #c53030;
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 16px;
  border: 2px solid #feb2b2;
  text-align: center;
  font-weight: 600;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.search-error.show {
  display: flex;
}

.result-card {
  background: #fff;
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  animation: resultIn 0.35s ease;
}

.results-list-card,
.error-message {
  background: #fff;
  border-radius: 20px;
  padding: 36px;
  margin-bottom: 24px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

@keyframes resultIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.error-message {
  background: linear-gradient(135deg, #fff5f5, #fed7d7);
  color: #c53030;
  text-align: center;
  border: 2px solid #feb2b2;
}

.card-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 3px solid #ecf0f1;
  text-align: center;
}

.results-count {
  text-align: center;
  color: #7f8c8d;
  margin-bottom: 20px;
  font-weight: 600;
}

.results-grid {
  display: grid;
  gap: 14px;
}

.result-item {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 1px solid #dee2e6;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: 0.25s;
}

.result-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
}

.student-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 6px;
}

.seat-number {
  color: #7f8c8d;
  font-size: 0.95rem;
}

.system-type {
  font-size: 0.9rem;
  color: #c8102e;
  font-weight: 600;
  margin-top: 4px;
}

.view-result-btn {
  background: linear-gradient(135deg, #c8102e, #a00d24);
  color: #fff;
  padding: 11px 18px;
  border-radius: 10px;
  border: 2px solid #c8102e;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-family: 'Cairo', sans-serif;
}

.view-result-btn:hover {
  background: linear-gradient(135deg, #a00d24, #c8102e);
}

.summary-section {
  background: linear-gradient(160deg, #f7f9fc 0%, #eef2f7 100%);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 22px;
  border: 1px solid #e3e8ef;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.summary-item {
  text-align: center;
  padding: 18px 12px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(44, 62, 80, 0.06);
  border: 1px solid #f0f2f5;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(200, 16, 46, 0.1);
}

.summary-label {
  font-size: 0.9rem;
  color: #7f8c8d;
  margin-bottom: 8px;
  font-weight: 600;
}

.summary-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: #c8102e;
  font-variant-numeric: tabular-nums;
}

/* Ø±Ø£Ø³ Ø§Ù„Ù†ØªÙŠØ¬Ø© */
.result-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  padding: 22px 24px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 88% 20%, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(135deg, #c8102e 0%, #a00d24 55%, #8b0a1e 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(200, 16, 46, 0.28);
}

.result-head-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  flex-shrink: 0;
}

.result-head-text {
  min-width: 0;
  flex: 1;
}

.result-kicker {
  margin: 0 0 4px;
  font-size: 0.88rem;
  opacity: 0.85;
  font-weight: 600;
}

.result-name {
  margin: 0 0 10px;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.9rem;
  font-weight: 600;
}

.result-head.is-pass {
  background:
    radial-gradient(circle at 88% 20%, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(135deg, #1e9f5a 0%, #178a4b 55%, #127440 100%);
  box-shadow: 0 12px 28px rgba(23, 138, 75, 0.28);
}

.result-head.is-fail {
  background:
    radial-gradient(circle at 88% 20%, rgba(255, 255, 255, 0.14), transparent 42%),
    linear-gradient(135deg, #c8102e 0%, #a00d24 55%, #8b0a1e 100%);
  box-shadow: 0 12px 28px rgba(200, 16, 46, 0.28);
}

.result-badge.is-pass {
  background: rgba(255, 255, 255, 0.2);
}

.result-badge.is-fail {
  background: rgba(0, 0, 0, 0.15);
}

.detail-tile.is-pass {
  border-color: #b7e4c7;
  background: linear-gradient(180deg, #f3fff7, #fff);
}

.detail-tile.is-pass .detail-tile-value {
  color: #178a4b;
}

.detail-tile.is-fail {
  border-color: #f5c2cb;
  background: linear-gradient(180deg, #fff5f7, #fff);
}

.detail-tile.is-fail .detail-tile-value {
  color: #c8102e;
}

.case-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
}

.case-pill.is-pass {
  background: #e8f8ef;
  color: #178a4b;
  border: 1px solid #b7e4c7;
}

.case-pill.is-fail {
  background: #fff0f3;
  color: #c8102e;
  border: 1px solid #f5c2cb;
}

/* Ø´Ø¨ÙƒØ© Ø§Ù„ØªÙØ§ØµÙŠÙ„ Ù„Ù„Ø´Ø§Ø´Ø§Øª Ø§Ù„ÙƒØ¨ÙŠØ±Ø© */
.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.detail-tile {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 14px;
  padding: 18px 16px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  min-height: 100px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.detail-tile:hover {
  border-color: #f5c2cb;
  box-shadow: 0 6px 18px rgba(200, 16, 46, 0.08);
  transform: translateY(-2px);
}

.detail-tile-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #7f8c8d;
}

.detail-tile-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #c8102e;
  line-height: 1.5;
  word-break: break-word;
}

.detail-tile-value.ltr-num {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ØªÙˆØ§ÙÙ‚ Ù‚Ø¯ÙŠÙ… Ù„Ùˆ ÙˆÙØ¬Ø¯ */
.details-list {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 22px;
  border: 1px solid #e9ecef;
}

.detail-row {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: baseline;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f3f4;
  text-align: right;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: #495057;
  flex: 0 0 auto;
  white-space: nowrap;
}

.detail-value {
  font-weight: 600;
  color: #2c3e50;
  font-size: 1.08rem;
  flex: 1 1 auto;
  text-align: right;
  word-break: break-word;
}

.detail-value.ltr-num {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
  display: inline-block;
  flex: 0 1 auto;
}

.hidden {
  display: none !important;
}

.loading-bar {
  height: 3px;
  background: #ecf0f1;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
  display: none;
}

.loading-bar.show {
  display: block;
}

.loading-bar span {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, #c8102e, #ff6b81, #c8102e);
  animation: load 1s linear infinite;
}

@keyframes load {
  0% { transform: translateX(150%); }
  100% { transform: translateX(-350%); }
}

.queue-card {
  background: #fff;
  border-radius: 20px;
  padding: 36px 28px;
  margin-bottom: 24px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  text-align: center;
  border: 2px solid #fde8ec;
  animation: queueIn 0.35s ease;
}

@keyframes queueIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.queue-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff5f7, #ffe0e6);
  color: #c8102e;
  font-size: 1.6rem;
  animation: pulseQ 1.6s ease-in-out infinite;
}

@keyframes pulseQ {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.queue-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0 0 8px;
}

.queue-seat {
  color: #7f8c8d;
  margin: 0 0 20px;
  font-size: 1rem;
}

.queue-seat strong {
  color: #c8102e;
  font-size: 1.15rem;
}

.queue-meta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.queue-chip {
  min-width: 120px;
  background: #f8f9fa;
  border: 1px solid #ecf0f1;
  border-radius: 14px;
  padding: 12px 16px;
}

.queue-chip.accent {
  background: linear-gradient(135deg, #fff5f7, #ffe8ec);
  border-color: #f5c2cb;
}

.queue-chip-label {
  display: block;
  font-size: 0.85rem;
  color: #7f8c8d;
  margin-bottom: 4px;
}

.queue-chip-value {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  color: #2c3e50;
  font-variant-numeric: tabular-nums;
}

.queue-chip.accent .queue-chip-value {
  color: #c8102e;
}

.queue-progress {
  height: 8px;
  background: #f0f2f5;
  border-radius: 8px;
  overflow: hidden;
  margin: 0 auto 14px;
  max-width: 360px;
}

.queue-progress span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 8px;
  background: linear-gradient(90deg, #c8102e, #ff6b81);
  transition: width 0.35s linear;
}

.queue-hint {
  margin: 0;
  color: #5d6d7e;
  font-size: 0.95rem;
  line-height: 1.6;
}

.live-badge {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: stretch;
  gap: 0;
  width: auto;
  min-width: 220px;
  max-width: calc(100vw - 32px);
  background: linear-gradient(135deg, #c8102e 0%, #a00d24 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 8px 10px;
  box-shadow: 0 10px 28px rgba(200, 16, 46, 0.35);
}

.live-badge-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 6px 18px;
  box-shadow: none;
  flex: 1;
  text-align: center;
}

.live-badge-item.online,
.live-badge-item.visits {
  border: none;
  background: transparent;
}

.live-badge-sep {
  width: 1px;
  align-self: stretch;
  margin: 4px 0;
  background: rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
}

.live-badge-item i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.7rem;
  margin: 0;
  flex-shrink: 0;
}

.live-badge-item.online i {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  position: relative;
}

.live-badge-item.online i.online-glow {
  color: transparent;
  background: rgba(255, 255, 255, 0.18);
}

.live-badge-item.online i.online-glow::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.75);
  animation: onlineGlow 1.6s ease-out infinite;
}

.live-badge-item.visits i {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.live-badge-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.live-badge-label {
  display: none;
}

.live-badge-text {
  display: none;
}

@keyframes onlineGlow {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); opacity: 1; }
  70% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); opacity: 0.85; }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

@media (max-width: 900px) {
  .summary-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .container { padding: 20px 15px; }
  .header { padding: 28px 18px; }
  .header h1 { font-size: 1.7rem; }
  .search-form { flex-direction: column; }
  .search-input, .search-btn { width: 100%; }
  .result-item { flex-direction: column; text-align: center; gap: 12px; }
  .view-result-btn { width: 100%; justify-content: center; }
  .summary-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .summary-item { padding: 14px 10px; }
  .summary-value { font-size: 1.25rem; }
  .details-grid { grid-template-columns: 1fr; }
  .result-head {
    flex-direction: column;
    text-align: center;
    padding: 18px 16px;
    gap: 12px;
  }
  .result-name { font-size: 1.2rem; }
  .result-card { padding: 18px; }
  .stat-item { min-width: 120px; padding: 14px 16px; }
  .live-badge {
    left: 12px;
    right: 12px;
    bottom: 12px;
    transform: none;
    width: auto;
    max-width: none;
    justify-content: space-around;
    padding: 10px 12px;
    border-radius: 18px;
  }
  .live-badge-item {
    padding: 2px 6px;
    flex: 1;
    justify-content: center;
  }
  .live-badge-num { font-size: 0.9rem; }
  body { padding-bottom: 84px; }
}