/* General Layout and Typography */
:root {
  --primary-color: #0d9488; /* Teal for headers and active states */
  --secondary-color: rgba(
    13,
    148,
    136,
    0.15
  ); /* Teal-tinted backdrop for table header */
  --border-color: #263043; /* Dark border for dark theme */
  --text-color: #e5e7eb; /* Light grey for text */
  --header-bg: #111827; /* Dark background for section headers */
}

body {
  font-family: Poppins, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background-color: #0b1220; /* Dark page background */
  color: var(--text-color);
  margin: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start; /* Align items to the top of the flex container */
  min-height: 100vh; /* Ensures body takes full viewport height */
  line-height: 1.5;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

.container {
  width: 100%;
  max-width: 800px; /* Max width for content */
  background-color: #0f172a; /* Dark card background */
  border: 1px solid #1f2937;
  border-radius: 8px; /* Rounded corners for the container */
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  overflow: hidden; /* Ensures child elements respect border-radius */
}

/* Header Section */
header {
  background: linear-gradient(135deg, #0e7d74, var(--primary-color));
  color: #e6fffb;
  padding: 20px;
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 1.8em;
}

/* Bill Header Section (contains class/student type title and gender tabs) */
.bill-header {
  padding: 15px 20px;
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  text-align: center; /* Center align title and tabs */
}

.bill-header h2 {
  margin: 0;
  color: var(--primary-color);
  margin-bottom: 15px; /* Space below the main title */
}

/* Gender Tabs Styling */
.gender-tabs {
  display: flex; /* Use flexbox to arrange tabs horizontally */
  justify-content: center; /* Center the tabs within their container */
  margin-top: 20px;
  border: 1px solid var(--primary-color); /* Border around the entire tab group */
  border-radius: 5px;
  overflow: hidden; /* Crucial for rounded corners on the group */
}

.gender-tab {
  padding: 12px 25px;
  cursor: pointer; /* Indicates it's clickable */
  background-color: #1f2937; /* Inactive tab bg for dark mode */
  color: #cbd5e1; /* Inactive tab text */
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition for hover/active */
  flex-grow: 1; /* Allows tabs to grow and fill available space evenly */
  text-align: center;
  user-select: none; /* Prevent text selection on click */
}

.gender-tab:first-child {
  border-right: 1px solid var(--primary-color); /* Vertical separator between Male and Female */
}

.gender-tab:hover {
  background-color: #334155; /* Slightly lighter on hover */
}

.gender-tab.active {
  background-color: var(--primary-color); /* Primary color for the active tab */
  color: #ffffff;
}

.gender-tab:focus-visible {
  outline: 2px solid #22d3ee; /* Teal-ish focus ring */
  outline-offset: 2px;
}

/* Bill Display Section (contains message and table) */
.bill-display {
  padding: 20px;
  overflow-x: hidden; /* Disallow horizontal scrolling */
}

#message-area {
  text-align: center;
  padding: 40px;
  color: #94a3b8; /* Muted text for messages on dark bg */
  font-style: italic;
}

/* Table Styling */
table {
  width: 100%;
  border-collapse: collapse; /* Removes spacing between table cells */
  display: none; /* Hidden by default, shown by JavaScript when data loads */
  color: var(--text-color);
  background-color: transparent;
  table-layout: fixed; /* Ensure columns shrink and content wraps instead of scrolling */
}

th,
td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color); /* Bottom border for rows */
  word-break: break-word; /* Allow long words to wrap */
  overflow-wrap: anywhere; /* Break anywhere to avoid overflow */
  white-space: normal; /* Allow wrapping */
}

thead tr {
  background-color: var(
    --secondary-color
  ); /* Light blue background for table header */
}

th {
  font-weight: 600; /* Bold header text */
}

tbody tr:hover {
  background-color: rgba(148, 163, 184, 0.08); /* Subtle hover */
}

.amount {
  text-align: right; /* Align currency to the right */
  font-variant-numeric: tabular-nums;
}

/* Emphasize TOTAL row */
tfoot td {
  font-weight: 700; /* Bold both label and value */
}
tfoot td.amount,
tfoot #total-amount {
  font-weight: 800; /* Slightly bolder for the amount */
}

/* -----------------------------
   Mobile Responsiveness
   ----------------------------- */
@media (max-width: 600px) {
  header {
    padding: 16px;
  }
  header h1 {
    font-size: 1.4em;
  }

  .bill-header {
    padding: 12px 16px;
  }
  .bill-header h2 {
    font-size: 1.1em;
    margin-bottom: 10px;
  }

  .gender-tabs {
    margin-top: 12px;
  }
  .gender-tab {
    padding: 10px 16px;
  }

  table {
    min-width: 0;
  } /* Ensure no horizontal scroll is introduced */
  body {
    overflow-x: hidden;
  }
  .bill-display {
    overflow-x: hidden;
  }
}

/* ---------------------------------
   Footer (appears at bottom of pages)
   --------------------------------- */
.site-footer {
  background-color: #0f172a;
  border-top: 1px solid #1f2937;
  padding: 12px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.95em;
}
.site-footer a {
  color: inherit; /* Use footer text color */
  font-weight: 600;
  text-decoration: underline;
}
.site-footer a:hover {
  text-decoration: underline;
}

/* ---------------------------------
   Landing Page styles
   --------------------------------- */
.landing-hero {
  padding: 24px 20px;
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}
.landing-hero .logo {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  margin-bottom: 12px;
}
.landing-hero h1 {
  margin: 10px 0 6px;
  font-size: 1.9em;
}
.landing-hero p.tagline {
  margin: 0;
  color: #cbd5e1;
  font-style: italic;
}
.landing-hero .sub {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 0.95em;
}

.landing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 20px;
}
@media (min-width: 700px) {
  .landing-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  background-color: #0b1220;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 16px;
}
.card h3 {
  margin-top: 0;
  color: var(--primary-color);
}
.link-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.link-list a {
  display: block;
  padding: 10px 12px;
  background-color: #111827;
  border: 1px solid #1f2937;
  border-radius: 6px;
  color: var(--text-color);
  text-decoration: none;
  transition: border-color 0.2s ease, background-color 0.2s ease,
    transform 0.1s ease;
}
.link-list a:hover {
  border-color: var(--primary-color);
  background-color: rgba(13, 148, 136, 0.12);
  transform: translateY(-1px);
}

/* ---------------------------------
   Admissions Call CTA (homepage)
   --------------------------------- */
.admissions-call {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 6px;
  background-color: var(--primary-color);
  color: #ffffff !important;
  border: 1px solid #0e7d74;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: background-color 0.2s ease, border-color 0.2s ease,
    transform 0.1s ease, box-shadow 0.2s ease;
}
.admissions-call:hover {
  background-color: #0e7d74;
  border-color: #0e7d74;
  transform: translateY(-1px);
  text-decoration: none;
}
.admissions-call:focus-visible {
  outline: 2px solid #22d3ee;
  outline-offset: 2px;
}
