/*
 * Big Bang Result modal - matches fiitjeedwarka.in (red #b10004 / #dc3545, yellow #ffcc00).
 * Every rule is prefixed with .bb- so nothing clashes with the site's Bootstrap CSS.
 */
.bb-open-btn,
.bb-overlay {
  --bb-red: #b10004;
  --bb-red-2: #dc3545;
  --bb-yellow: #ffcc00;
  --bb-yellow-2: #ffd24d;
  --bb-ink: #111827;
  --bb-ink-2: #374151;
  --bb-muted: #6b7280;
  --bb-line: #e5e7eb;
  --bb-soft: #f9fafb;
  --bb-green: #16a34a;
  --bb-amber: #f59e0b;
  --bb-ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Open button ---------- */
.bb-open-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--bb-red-2), var(--bb-red));
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(177, 0, 4, .35);
  transition: transform .2s var(--bb-ease), box-shadow .2s var(--bb-ease);
  animation: bb-pulse 2.4s infinite;
}
.bb-open-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--bb-yellow); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bb-open-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(177, 0, 4, .45); }
.bb-open-btn:active { transform: translateY(0); }
@keyframes bb-pulse {
  0%, 100% { box-shadow: 0 6px 18px rgba(177, 0, 4, .35), 0 0 0 0 rgba(220, 53, 69, .45); }
  60% { box-shadow: 0 6px 18px rgba(177, 0, 4, .35), 0 0 0 12px rgba(220, 53, 69, 0); }
}

body.bb-lock { overflow: hidden; }

/* ---------- Overlay + open/close animation ---------- */
.bb-overlay {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 100000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
  background: rgba(17, 24, 39, .6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility 0s linear .3s;
}
.bb-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .3s ease, visibility 0s;
}

.bb-modal, .bb-modal * { box-sizing: border-box; }
.bb-modal {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: auto 0;
  background: #fff;
  color: var(--bb-ink);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
  overflow: hidden;
  outline: none;
  opacity: 0;
  transform: translateY(28px) scale(.96);
  transition: transform .4s var(--bb-ease), opacity .3s ease;
}
.bb-overlay.is-open .bb-modal { opacity: 1; transform: none; }

.bb-modal h2, .bb-modal h3, .bb-modal h4, .bb-modal p { margin: 0; }
.bb-modal button { font-family: inherit; }

/* ---------- Header (red bar like the site top strip, yellow accent line) ---------- */
.bb-head {
  position: relative;
  padding: 24px 64px 22px 26px;
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 204, 0, .35), transparent 38%),
    linear-gradient(120deg, var(--bb-red) 0%, #c8101e 55%, var(--bb-red-2) 100%);
  color: #fff;
  border-bottom: 4px solid var(--bb-yellow);
}
.bb-tag {
  display: inline-block;
  padding: 3px 10px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: var(--bb-yellow);
  color: var(--bb-red);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
}
.bb-modal .bb-head h2 { font-size: 24px; font-weight: 800; line-height: 1.2; color: #fff; letter-spacing: .2px; }
.bb-head-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px !important; font-size: 13.5px; color: rgba(255, 255, 255, .9); }
.bb-head-meta span { display: inline-flex; align-items: center; gap: 6px; }
.bb-head-meta svg { width: 15px; height: 15px; fill: none; stroke: var(--bb-yellow); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.bb-close {
  position: absolute;
  top: 14px; right: 14px;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  cursor: pointer;
  transition: background .2s, transform .3s var(--bb-ease);
}
.bb-close svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.bb-close:hover { background: rgba(255, 255, 255, .3); transform: rotate(90deg); }

/* ---------- Search form ---------- */
.bb-body { padding: 22px 26px 26px; }
.bb-form { margin: 0; }
.bb-modal .bb-form label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--bb-ink-2); }
.bb-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.bb-field-wrap { min-width: 0; }
.bb-req { color: var(--bb-red-2); }
.bb-modal .bb-submit { width: 100%; margin-top: 16px; }
.bb-field { position: relative; }
.bb-field-icon {
  position: absolute; left: 14px; top: 50%;
  width: 19px; height: 19px;
  transform: translateY(-50%);
  fill: none; stroke: var(--bb-muted); stroke-width: 2; stroke-linecap: round;
  pointer-events: none;
  transition: stroke .2s;
}
.bb-modal .bb-field input {
  width: 100%;
  height: 50px;
  padding: 0 44px 0 44px;
  border: 2px solid var(--bb-line);
  border-radius: 12px;
  background: var(--bb-soft);
  color: var(--bb-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: .5px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.bb-modal .bb-field input::placeholder { color: #9ca3af; font-weight: 400; letter-spacing: 0; }
.bb-modal .bb-field input:focus { outline: none; border-color: var(--bb-red-2); background: #fff; box-shadow: 0 0 0 4px rgba(220, 53, 69, .12); }
.bb-field:focus-within .bb-field-icon { stroke: var(--bb-red-2); }
.bb-field.is-invalid input { border-color: var(--bb-red-2); }
.bb-field.bb-shake { animation: bb-shake .45s; }
@keyframes bb-shake {
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

.bb-clear {
  position: absolute; right: 10px; top: 50%;
  display: grid; place-items: center;
  width: 28px; height: 28px;
  padding: 0; border: 0; border-radius: 50%;
  background: var(--bb-line);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(.6);
  transition: opacity .2s, transform .2s var(--bb-ease), background .2s;
}
.bb-clear svg { width: 14px; height: 14px; fill: none; stroke: var(--bb-ink-2); stroke-width: 2.6; stroke-linecap: round; }
.bb-clear:hover { background: #d1d5db; }
.bb-field.has-value .bb-clear { opacity: 1; pointer-events: auto; transform: translateY(-50%) scale(1); }

.bb-hint { margin-top: 8px !important; font-size: 13px; color: var(--bb-muted); transition: color .2s; }
.bb-hint.is-detected { color: var(--bb-green); font-weight: 600; }
.bb-hint.is-error { color: var(--bb-red-2); font-weight: 600; }

/* ---------- Buttons ---------- */
.bb-modal .bb-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 50px;
  padding: 0 26px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--bb-red-2), var(--bb-red));
  color: #fff;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: .3px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(177, 0, 4, .28);
  transition: transform .2s var(--bb-ease), box-shadow .2s, filter .2s;
}
.bb-modal .bb-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px rgba(177, 0, 4, .36); filter: brightness(1.05); }
.bb-modal .bb-btn:active { transform: translateY(0); }
.bb-modal .bb-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.bb-spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bb-spin .7s linear infinite;
}
.bb-submit.is-loading { pointer-events: none; filter: saturate(.85); }
.bb-submit.is-loading .bb-spinner { display: inline-block; }
@keyframes bb-spin { to { transform: rotate(360deg); } }

/* ---------- Error message ---------- */
.bb-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  max-height: 0;
  margin-top: 0;
  padding: 0 14px;
  overflow: hidden;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid transparent;
  color: #991b1b;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: max-height .3s var(--bb-ease), opacity .25s, margin .3s var(--bb-ease), padding .3s var(--bb-ease);
}
.bb-msg.is-visible { max-height: 120px; margin-top: 14px; padding: 11px 14px; border-color: #fecaca; opacity: 1; }
.bb-msg svg { flex-shrink: 0; width: 20px; height: 20px; fill: none; stroke: var(--bb-red-2); stroke-width: 2; stroke-linecap: round; }

/* ---------- Loading skeleton ---------- */
.bb-skeleton { margin-top: 22px; padding: 22px; border: 1px solid var(--bb-line); border-radius: 16px; }
.bb-sk { border-radius: 8px; background: linear-gradient(90deg, #f1f2f4 25%, #e6e8eb 37%, #f1f2f4 63%); background-size: 400% 100%; animation: bb-shimmer 1.3s ease infinite; }
.bb-sk-row { display: flex; align-items: center; gap: 16px; }
.bb-sk-avatar { width: 68px; height: 68px; border-radius: 50%; flex-shrink: 0; }
.bb-sk-lines { flex: 1; display: grid; gap: 10px; }
.bb-sk-line { height: 14px; }
.bb-sk-block { height: 110px; margin-top: 20px; border-radius: 14px; }
.bb-sk-bar { height: 46px; margin-top: 12px; border-radius: 12px; }
.bb-loading-text { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px !important; color: var(--bb-muted); font-size: 14px; font-weight: 500; }
.bb-loading-text .bb-spinner { display: inline-block; border-color: rgba(220, 53, 69, .2); border-top-color: var(--bb-red-2); }
@keyframes bb-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Result card ---------- */
.bb-results:not(:empty) { margin-top: 22px; }
.bb-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.bb-switch-label { width: 100%; font-size: 13.5px; color: var(--bb-muted); font-weight: 600; }
.bb-switch button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px 5px 5px;
  border: 2px solid var(--bb-line); border-radius: 999px;
  background: #fff; color: var(--bb-ink-2);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.bb-switch button .bb-avatar { width: 28px; height: 28px; font-size: 12px; border-width: 0; box-shadow: none; }
.bb-switch button small { font-size: 12px; font-weight: 500; color: var(--bb-muted); }
.bb-switch button small::before { content: "\00b7"; margin-right: 6px; }
.bb-switch button.is-active { border-color: var(--bb-red-2); background: #fff5f5; color: var(--bb-red); }

.bb-card { border: 1px solid var(--bb-line); border-radius: 16px; overflow: hidden; background: #fff; }
.bb-enter { animation: bb-rise .55s var(--bb-ease) both; }
@keyframes bb-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.bb-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: linear-gradient(180deg, #fff8e1, #fff);
  border-bottom: 1px solid var(--bb-line);
}
.bb-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 68px; height: 68px;
  border-radius: 50%;
  background: var(--bb-yellow);
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--bb-red-2), 0 8px 18px rgba(177, 0, 4, .2);
  color: var(--bb-red);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: .5px;
  line-height: 1;
  user-select: none;
}
.bb-enter .bb-avatar { animation: bb-pop .6s var(--bb-ease) .1s both; }
@keyframes bb-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }

.bb-who { flex: 1; min-width: 0; }
.bb-modal .bb-who h3 { font-size: 21px; font-weight: 800; color: var(--bb-ink); line-height: 1.25; word-break: break-word; }
.bb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.bb-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--bb-line);
  color: var(--bb-ink-2);
  font-size: 12.5px;
  font-weight: 600;
}
.bb-chip b { color: var(--bb-red); font-weight: 700; }
.bb-chip-date { background: #fff8e1; border-color: #ffe08a; }
.bb-copy {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px; margin-right: -5px;
  padding: 0; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer;
  transition: background .2s;
}
.bb-copy:hover { background: var(--bb-line); }
.bb-copy svg { width: 13px; height: 13px; fill: none; stroke: var(--bb-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bb-copy.is-done svg { stroke: var(--bb-green); }

.bb-award {
  flex-shrink: 0;
  padding: 9px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--bb-yellow-2), var(--bb-yellow));
  color: var(--bb-red);
  text-align: center;
  box-shadow: 0 6px 14px rgba(255, 204, 0, .4);
}
.bb-award small { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .7px; text-transform: uppercase; color: #7a4b00; }
.bb-award strong { display: block; font-size: 22px; font-weight: 900; line-height: 1.15; }

/* Total + percentage */
.bb-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 20px 22px 4px; }
.bb-stat { padding: 12px 16px; border-radius: 12px; background: var(--bb-soft); border: 1px solid var(--bb-line); }
.bb-stat small { display: block; font-size: 12.5px; font-weight: 600; color: var(--bb-muted); }
.bb-stat strong { display: block; margin-top: 2px; font-size: 24px; font-weight: 800; color: var(--bb-ink); }
.bb-stat strong span { font-size: 15px; font-weight: 600; color: var(--bb-muted); }

/* Marks table */
.bb-marks { padding: 18px 22px 20px; }
.bb-modal .bb-marks h4 { margin-bottom: 10px; font-size: 15px; font-weight: 800; color: var(--bb-ink); text-transform: uppercase; letter-spacing: .5px; }
.bb-table-wrap { overflow-x: auto; border: 1px solid var(--bb-line); border-radius: 10px; }
.bb-modal .bb-table { width: 100%; margin: 0; border-collapse: collapse; font-size: 14.5px; background: #fff; }
.bb-modal .bb-table th,
.bb-modal .bb-table td { padding: 9px 12px; border: 1px solid var(--bb-line); color: var(--bb-ink); vertical-align: middle; }
.bb-modal .bb-table tr > :first-child { border-left: 0; }
.bb-modal .bb-table tr > :last-child { border-right: 0; }
.bb-modal .bb-table thead th { border-top: 0; background: #f3f4f6; font-size: 13px; font-weight: 700; text-align: left; white-space: nowrap; }
.bb-modal .bb-table .bb-sec { background: var(--bb-soft); font-weight: 700; white-space: nowrap; }
.bb-modal .bb-table .bb-num { text-align: center; width: 110px; font-weight: 600; }
.bb-modal .bb-table thead th:nth-child(n+3) { text-align: center; }
.bb-modal .bb-table .bb-subtotal td { background: var(--bb-soft); font-weight: 700; }
.bb-modal .bb-table .bb-grand td { border-bottom: 0; background: #f3f4f6; font-size: 15.5px; font-weight: 800; }
.bb-modal .bb-table .bb-grand-label { border-right: 0; }
.bb-modal .bb-table .bb-grand-sub { border-left: 0; }
/* Phone-only pieces, hidden on tablet/desktop */
.bb-modal .bb-table .bb-sec-row,
.bb-modal .bb-table .bb-short { display: none; }

/* Actions */
.bb-actions { display: flex; gap: 10px; padding: 16px 22px 22px; border-top: 1px solid var(--bb-line); background: #fcfcfd; }
.bb-actions .bb-btn { flex: 1; }
.bb-modal .bb-btn.bb-btn-ghost { flex: 0 0 auto; background: #fff; color: var(--bb-ink-2); border: 2px solid var(--bb-line); box-shadow: none; }
.bb-modal .bb-btn.bb-btn-ghost:hover { color: var(--bb-red); border-color: #f5c2c7; filter: none; }
.bb-modal .bb-btn.is-done { background: linear-gradient(135deg, #22c55e, var(--bb-green)); box-shadow: 0 6px 16px rgba(22, 163, 74, .28); }
.bb-na { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 14px; }

/* ---------- Mobile ---------- */
@media (max-width: 575px) {
  .bb-overlay { padding: 0; align-items: flex-end; }
  .bb-modal { max-width: none; min-height: 92vh; margin: auto 0 0; border-radius: 20px 20px 0 0; transform: translateY(60px); }
  .bb-head { padding: 20px 58px 18px 18px; }
  .bb-modal .bb-head h2 { font-size: 20px; }
  .bb-body { padding: 18px 16px 22px; }
  .bb-form-grid { grid-template-columns: 1fr; }
  .bb-modal .bb-btn { width: 100%; }
  /* Avatar + name on one row, chips and scholarship full width underneath */
  .bb-profile { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 14px; padding: 18px 16px; }
  .bb-who { display: contents; }
  .bb-avatar { width: 56px; height: 56px; font-size: 21px; }
  .bb-modal .bb-who h3 { font-size: 19px; }
  .bb-chips { grid-column: 1 / -1; margin-top: 0; }
  .bb-chip { white-space: nowrap; }
  .bb-award { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
  .bb-switch button { width: 100%; justify-content: flex-start; text-align: left; }
  .bb-stats { padding: 16px 16px 0; gap: 10px; }
  .bb-stat strong { font-size: 20px; }
  .bb-marks { padding: 16px; }
  /* Table fits phone width: Section column becomes a heading row, short column titles */
  .bb-modal .bb-table { font-size: 13.5px; }
  .bb-modal .bb-table th, .bb-modal .bb-table td { padding: 8px 10px; }
  .bb-modal .bb-table .bb-num { width: 58px; padding-left: 4px; padding-right: 4px; }
  .bb-modal .bb-table .bb-col-sec,
  .bb-modal .bb-table .bb-long { display: none; }
  .bb-modal .bb-table .bb-short { display: inline; }
  .bb-modal .bb-table tr > :nth-child(2) { border-left: 0; }
  .bb-modal .bb-table .bb-sec-row { display: table-row; }
  .bb-modal .bb-table .bb-sec-row th {
    border-left: 0; border-right: 0;
    background: #fff5f5;
    color: var(--bb-red);
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
  }
  .bb-modal .bb-table .bb-grand td { font-size: 14.5px; }
  .bb-actions { flex-direction: column-reverse; padding: 16px; }
  .bb-actions .bb-btn { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bb-open-btn, .bb-overlay, .bb-modal, .bb-modal * { animation: none !important; transition: none !important; }
}
