/* -----------------------------
   ROOT & BODY
----------------------------- */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100vw;
  background: black;
  color: white;
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-style: bold;
  overflow: hidden;
letter-spacing: 1px;
}

/* MAIN LAYOUT: Header / Top / Ticker / Bottom */
body {
  display: grid;
  grid-template-rows: 8vh 32vh 6vh 1fr; 
height: 100vh;
  /* 8vh = header, 32vh = top (announcement + calling), 6vh = ticker, 1fr = bottom table */
}

/* -----------------------------
   DASHBOARD HEADER
----------------------------- */
.dashboard-header {
  display: flex;
  align-items: center;       /* vertically center items */
  justify-content: flex-start; /* keep items from stretching */
  gap: 2vw;
  padding: 0 1vw;            /* horizontal padding only */
  background-color: #0f3a5a;
  color: white;
  height: 8vh;               /* fixed header height */
  box-sizing: border-box;
  border-bottom: 1px solid black;
}

.dashboard-logo {
  max-height: 100%;          /* logo scales with header height */
  width: auto;               /* maintain aspect ratio */
  object-fit: contain;       /* prevent distortion */
}

.dashboard-title {
  font-size: 2.5vw;          /* scales with screen width */
  margin: 0;
  font-weight: bold;
  white-space: nowrap;       /* prevent title from wrapping */
  align-self: center;        /* vertically center within flex */
}

/* -----------------------------
   TOP SECTION: ANNOUNCEMENTS + NOW CALLING
----------------------------- */
.top {
  display: grid;
  grid-template-columns: 35% 65%;
  gap: 0.5vh;
  padding: 0.5vh;
}

/* ANNOUNCEMENTS BOX */
.announcement-box {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  background: #0f3a5a;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  border-bottom: 4px solid black;
}

.announcement-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

.announcement-box p {
  color: white;
  font-size: 2vw;
  text-align: center;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0;
}

.announcement-box h1 {
  color: white;
  font-size: 3vw;
  text-align: center;
  width: 100%;
  height: 100%;
  display: flex;
  margin: 0;
}

/* NOW CALLING BOX */
.called {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden; /* IMPORTANT */
}

.called h2 {
  font-size: 4vw;
  text-align: center;
  color: white;
  margin: 0.5vh 0;
}

/* Container */
.called-table-container {
  width: 100%;
  flex: 1;
  overflow: hidden;
  position: relative; /* required for sliding */
}

/* Table fills container */
.called-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* FIX: Proper table behavior */
.called-table tbody {
  height: 100%;
}

/* 🔥 KEY FIX: evenly divide rows */
.called-table tbody tr {
  height: calc(100% / 4); /* ALWAYS 6 visible rows */
}

/* Text scaling */
.called-table td {
  font-size: clamp(24px, 3vw, 48px);
  padding: 0.3vh;
font-weight: bold;
}

/* Row colors */
.called-table tbody tr:nth-child(odd) { background: #0a1f33; color: #fff; }
.called-table tbody tr:nth-child(even) { background: #0f3a5a; color: #7fd3ff; }
/* -----------------------------
   TICKER TAPE
----------------------------- */
.ticker {
  position: relative;
  z-index: 2;
  background: yellow;
  color: black;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  font-family: monospace;
  text-transform: uppercase;
  font-size: 2vw;
  font-weight: bold;
  height: 100%;
  border: 2px solid black;
}

.ticker span {
  display: inline-block;
  padding-left: 100%;
  animation: ticker 10s linear infinite;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* -----------------------------
   BOTTOM TABLE: GRADES / SECTION / STATUS
----------------------------- */
.bottom {
  padding: 2px;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* TABLE */
.grid-slide {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* 🔥 THIS IS THE KEY FIX */
.grid-slide tbody {
  display: block;
  height: 100%;
  width: 100%;
}

/* 🔥 ROWS MUST BE TABLE AGAIN */
.grid-slide tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

/* TEXT */
.bottom td, .bottom th {
  font-size: clamp(24px, 3vw, 48px);
  padding: 0.3vh;
  font-weight: bold;
  text-align: center;
}

/* COLORS */
table tr:nth-child(even) { background-color: #041335; }
table tr:nth-child(odd) { background-color: #0069e3; }

.row-inclass { background-color: red; animation: flashRed 1s ease forwards; }
.row-dismissed { background-color: limegreen; animation: flashGreen 1s ease forwards; }

@keyframes flashRed {
  0% { color: red; } 50% { color: #ff5555; } 100% { color: red; }
}

@keyframes flashGreen {
  0% { color: limegreen; } 50% { color: #aaffaa; } 100% { color: limegreen; }
}
