/* ===============================
   PREMIUM CSS — Red · Blue · White
   Font: Times New Roman | Animated
================================ */

/* ========================= */
/* RESET & VARIABLES         */
/* ========================= */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Times New Roman", Times, serif !important;
}

:root {
  --blue:        #003366;
  --blue-mid:    #0a4a8f;
  --blue-light:  #e8f0ff;
  --blue-pale:   #f0f5ff;
  --red:         #b30000;
  --red-mid:     #e53935;
  --red-light:   #fceaea;
  --white:       #ffffff;
  --off-white:   #f8faff;
  --shadow-blue: rgba(0,51,102,0.13);
  --shadow-red:  rgba(179,0,0,0.16);
  --text-main:   #111827;
  --text-mid:    #374151;
}

/* ========================= */
/* SCROLLBAR                 */
/* ========================= */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--off-white); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--blue), var(--red));
  border-radius: 10px;
}

/* ========================= */
/* TEXT SELECTION            */
/* ========================= */
::selection {
  background: rgba(0,51,102,0.15);
  color: var(--blue);
}

/* ========================= */
/* BODY                      */
/* ========================= */
body {
  background:
    radial-gradient(ellipse at 10% 15%, rgba(0,51,102,0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 85%, rgba(179,0,0,0.05) 0%, transparent 50%),
    linear-gradient(160deg, #ddeeff 0%, #f5f8ff 45%, #ffffff 100%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  padding: 0;
  position: relative;
  overflow-x: hidden;
  animation: pageFade 0.8s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes pageFade {
  from { opacity: 0; filter: blur(4px); transform: scale(0.99); }
  to   { opacity: 1; filter: blur(0);   transform: scale(1); }
}

/* ── Animated dot grid ── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(0,51,102,0.05) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
  animation: gridDrift 30s linear infinite alternate;
}
@keyframes gridDrift {
  from { background-position: 0 0; }
  to   { background-position: 28px 28px; }
}

/* ── Corner glow orbs ── */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 0% 0%,    rgba(0,51,102,0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(179,0,0,0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: vigPulse 10s ease-in-out infinite alternate;
}
@keyframes vigPulse {
  from { opacity: 0.6; }
  to   { opacity: 1; }
}

/* ========================= */
/* PAGE HEADING              */
/* ========================= */
.page-title {
  text-align: center;
  font-size: 42px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  animation: titleEntrance 1s cubic-bezier(0.22,1,0.36,1) 0.15s forwards,
             titleShimmer  7s linear 1.3s infinite;

  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-mid) 35%, var(--red) 70%, var(--blue) 100%);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes titleEntrance {
  from { opacity: 0; transform: translateX(-50%) translateY(-30px); filter: blur(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0);     filter: blur(0); }
}
@keyframes titleShimmer {
  from { background-position: 0% center; }
  to   { background-position: 300% center; }
}

/* Gradient underline */
.page-title::after {
  content: "";
  display: block;
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--red), var(--blue));
  background-size: 200% auto;
  margin: 12px auto 0;
  border-radius: 20px;
  box-shadow: 0 0 16px rgba(179,0,0,0.3), 0 0 8px rgba(0,51,102,0.2);
  animation: lineGrow 0.9s cubic-bezier(0.22,1,0.36,1) 0.8s forwards,
             lineFlow 4s linear 1.8s infinite;
}
@keyframes lineGrow { to { width: 200px; } }
@keyframes lineFlow {
  from { background-position: 0% center; }
  to   { background-position: 200% center; }
}

/* Glow behind heading */
.page-title::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 500px; height: 120px;
  background: radial-gradient(ellipse, rgba(0,51,102,0.07), transparent 70%);
  pointer-events: none;
  border-radius: 50%;
  animation: titleGlow 4s ease-in-out infinite alternate;
}
@keyframes titleGlow {
  from { opacity: 0.5; transform: translate(-50%,-50%) scale(0.9); }
  to   { opacity: 1;   transform: translate(-50%,-50%) scale(1.1); }
}

/* ========================= */
/* PAGE TITLE SPAN (red)     */
/* ========================= */
.page-title span {
  -webkit-text-fill-color: transparent;
  background: linear-gradient(90deg, var(--red), #e53935, var(--red));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  animation: spanFlow 3s linear infinite;
}
@keyframes spanFlow {
  from { background-position: 0% center; }
  to   { background-position: 200% center; }
}

/* ========================= */
/* PAGE SUBTITLE             */
/* ========================= */
.page-subtitle {
  text-align: center;
  font-size: 16px;
  color: var(--text-mid);
  margin-bottom: 40px;
  letter-spacing: 1px;
  opacity: 0;
  animation: subtitleFade 0.8s ease 0.5s forwards;
  position: relative;
}
@keyframes subtitleFade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Decorative dots beside subtitle */
.page-subtitle::before,
.page-subtitle::after {
  content: "◆";
  font-size: 9px;
  color: rgba(179,0,0,0.4);
  margin: 0 10px;
  vertical-align: middle;
  animation: dotFade 2s ease-in-out infinite alternate;
}
@keyframes dotFade {
  from { opacity: 0.3; }
  to   { opacity: 0.9; }
}

/* ========================= */
/* TABLE WRAPPER             */
/* ========================= */
.table-wrapper {
  max-width: 1200px;
  margin: 0 auto 35px;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 28px;
  border-radius: 22px;
  border: 1.5px solid rgba(0,51,102,0.1);
  box-shadow:
    0 10px 50px var(--shadow-blue),
    0 2px 10px rgba(0,0,0,0.04),
    inset 0 1px 0 rgba(255,255,255,0.9);
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: wrapperRise 0.9s cubic-bezier(0.22,1,0.36,1) 0.3s forwards;
  transition: box-shadow 0.4s ease;
}
.table-wrapper:hover {
  box-shadow:
    0 22px 70px var(--shadow-blue),
    0 6px 20px var(--shadow-red),
    inset 0 1px 0 rgba(255,255,255,0.9);
}

@keyframes wrapperRise {
  from { opacity: 0; transform: translateY(40px); filter: blur(4px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0); }
}

/* Animated top accent bar */
.table-wrapper::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--blue), var(--red), var(--blue));
  background-size: 200% auto;
  border-radius: 22px 22px 0 0;
  animation: topBarFlow 4s linear infinite;
}
@keyframes topBarFlow {
  from { background-position: 0% center; }
  to   { background-position: 200% center; }
}

/* Subtle corner shimmer */
.table-wrapper::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.8s ease;
  pointer-events: none;
}
.table-wrapper:hover::after { left: 150%; }

/* ========================= */
/* MEDAL TABLE               */
/* ========================= */
.medal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid rgba(0,51,102,0.15);
  box-shadow: 0 4px 24px var(--shadow-blue);
}

/* ── Header ── */
.medal-table thead tr {
  background: linear-gradient(90deg, var(--blue) 0%, var(--blue-mid) 45%, var(--red) 100%);
  background-size: 200% auto;
  animation: headerFlow 8s linear infinite;
}
@keyframes headerFlow {
  0%,100% { background-position: 0% center; }
  50%      { background-position: 100% center; }
}

.medal-table th {
  color: var(--white);
  padding: 20px 16px;
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  font-weight: bold;
  position: relative;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.15);
}
.medal-table th:last-child { border-right: none; }

/* ── Body rows ── */
.medal-table tbody tr {
  transition: all 0.35s cubic-bezier(0.22,1,0.36,1);
  border-bottom: 1px solid rgba(0,51,102,0.07);
  position: relative;
}
.medal-table tbody tr:nth-child(even) { background: var(--blue-pale); }
.medal-table tbody tr:nth-child(odd)  { background: var(--white); }

/* Left border reveal on hover */
.medal-table tbody tr::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: linear-gradient(180deg, var(--blue), var(--red));
  transition: width 0.35s cubic-bezier(0.22,1,0.36,1);
  border-radius: 0 4px 4px 0;
}
.medal-table tbody tr:hover::before { width: 5px; }

/* Shimmer sweep on row hover */
.medal-table tbody tr::after {
  content: "";
  position: absolute;
  top: 0; left: -200%;
  width: 80%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(0,51,102,0.04), transparent);
  transition: left 0.5s ease;
  pointer-events: none;
}
.medal-table tbody tr:hover::after { left: 150%; }

.medal-table tbody tr:hover {
  background: linear-gradient(90deg, rgba(0,51,102,0.08), rgba(179,0,0,0.04), transparent) !important;
  transform: scale(1.012);
  box-shadow: 0 6px 28px var(--shadow-blue);
  z-index: 1;
}

/* ── Cells ── */
.medal-table td {
  padding: 16px 14px;
  font-size: 15px;
  text-align: center;
  border: none;
  border-bottom: 1px solid rgba(0,51,102,0.07);
  border-right: 1px solid rgba(0,51,102,0.05);
  line-height: 1.8;
  transition: color 0.3s;
}
.medal-table td:last-child { border-right: none; }

/* S.No bold blue */
.medal-table td:first-child {
  font-weight: bold;
  font-size: 16px;
  color: var(--blue);
}
.medal-table tbody tr:hover td:first-child { color: var(--red); }

/* ========================= */
/* RESPONSIVE TABLE          */
/* ========================= */
@media (max-width: 768px) {
  .page-title  { font-size: 28px; letter-spacing: 2px; }
  .table-wrapper { padding: 18px 14px; border-radius: 16px; }
  .medal-table th,
  .medal-table td { font-size: 13px; padding: 12px 9px; }
}

/* ========================= */
/* FOOTER                    */
/* ========================= */
.site-footer {
  max-width: 1200px;
  margin: 0 auto 30px;
  padding: 20px 24px;
  text-align: center;
  background: linear-gradient(90deg, var(--blue), var(--blue-mid) 40%, var(--red));
  background-size: 200% auto;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 10px 40px var(--shadow-blue),
    0 4px 14px var(--shadow-red),
    inset 0 1px 0 rgba(255,255,255,0.15);
  animation: footerRise 0.8s cubic-bezier(0.22,1,0.36,1) 0.5s both,
             footerGrad  8s linear 1.3s infinite;
  border: 1px solid rgba(255,255,255,0.1);
}
@keyframes footerRise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes footerGrad {
  0%,100% { background-position: 0% center; }
  50%      { background-position: 100% center; }
}

/* Shine sweep on footer */
.site-footer::before {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.15), transparent);
  animation: footerSweep 5s ease-in-out infinite;
}
@keyframes footerSweep {
  0%  { left: -100%; }
  50% { left: 150%; }
  100%{ left: 150%; }
}

/* Top shimmer line */
.site-footer::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}

.site-footer p {
  color: var(--white);
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
  opacity: 0.92;
  transition: opacity 0.3s, letter-spacing 0.3s;
}
.site-footer:hover p {
  opacity: 1;
  letter-spacing: 3px;
}