/* =========================
   Theme
   ========================= */
:root {
  --primary: #176c3a; /* GIC green (tweakable) */
  --primary-dark: #11522c;
  --accent: #d4af37; /* gold */
  --text: #333;
  --bg: #f8f9fa;
}

/* =========================
   Base Page Style
   ========================= */
body {
  font-family: Arial, sans-serif;
  background-color: var(--bg);
  margin: 0;
  padding: 0;
}

/* Page container (applies to all non-dashboard pages) */
.page-wrap {
  max-width: 1100px; /* change to taste */
  margin: 24px auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.form-container {
  max-width: 700px;
  margin: 40px auto;
  padding: 25px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}
.form-container h2,
.form-container h1 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 20px;
}

label {
  font-weight: bold;
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

/* Inputs */
input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 14px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 5px rgba(23, 108, 58, 0.3);
}

/* Buttons */
button[type="submit"],
.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: 10px 20px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s ease, transform 0.02s;
}
button[type="submit"]:hover,
.btn-primary:hover {
  background: var(--primary-dark);
}
button[type="submit"]:active,
.btn-primary:active {
  transform: translateY(1px);
}

/* Accent link/button (gold) */
.btn-accent {
  background: var(--accent);
  color: #111;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 8px;
  border: 1px solid #ddd;
  text-align: left;
}
th {
  background: var(--accent);
  color: #111;
} /* gold header */

a {
  margin-right: 10px;
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Flash messages */
.flash {
  padding: 10px 15px;
  margin-bottom: 10px;
  border-radius: 4px;
  color: #fff;
  font-weight: bold;
}
.flash.success {
  background: var(--primary);
}
.flash.danger {
  background: #dc3545;
}

/* Responsive */
@media (max-width: 600px) {
  .form-container {
    padding: 15px;
  }
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.form-grid label {
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
}
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  padding: 8px;
  box-sizing: border-box;
}

.top-button {
  display: inline-block;
  background-color: var(--primary-green);
  color: white;
  padding: 10px 15px;
  text-decoration: none;
  border-radius: 4px;
  margin-bottom: 15px;
}
.top-button:hover {
  background-color: var(--primary-gold);
  color: black;
}

/* --- Buttons --- */
.top-button {
  display: inline-block;
  background-color: #d4af37; /* School gold */
  color: white;
  padding: 10px 20px;
  margin-bottom: 15px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.1s ease;
}
.top-button:hover {
  background-color: #b08c2d; /* darker gold */
  transform: translateY(-2px);
}
.top-button:active {
  transform: translateY(0);
}

.button-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Navbar styling */
.navbar {
  background-color: var(--primary);
  padding: 10px;
  text-align: center;
}
.navbar a {
  color: white;
  text-decoration: none;
  margin: 0 15px;
  font-weight: bold;
}
.navbar a:hover {
  text-decoration: underline;
}

/* ===== Navbar Styling ===== */
.navbar {
  background-color: var(--primary);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}
.navbar a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 8px 15px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}
.navbar a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}
.navbar a.active {
  background-color: var(--secondary);
  color: var(--primary);
}

/* Center the confirm delete card */
.confirm-page {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 80vh;
}
.confirm-card {
  background-color: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  width: 90%;
  text-align: center;
}
.confirm-card h1 {
  color: #116530;
  margin-bottom: 20px;
}
.confirm-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}
.confirm-buttons button {
  min-width: 140px;
  padding: 10px 0;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.confirm-buttons .btn-delete {
  background-color: #116530;
  color: white;
}
.confirm-buttons .btn-cancel {
  background-color: #d4aa28;
  color: white;
}
.confirm-buttons button:hover {
  opacity: 0.9;
}

/* Adjust confirm page for top alignment */
.confirm-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 50px;
}
.confirm-card {
  background: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 500px;
  width: 100%;
}
.confirm-card h1 {
  color: var(--primary);
  margin-bottom: 15px;
}
.confirm-card p {
  margin-bottom: 20px;
}
.confirm-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
}
.confirm-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  width: 120px;
}
.btn-delete {
  background-color: var(--primary);
  color: white;
}
.btn-cancel {
  background-color: var(--accent);
  color: white;
}
.btn-delete:hover,
.btn-cancel:hover {
  opacity: 0.9;
}

/* Reusable button styles */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.15s ease-in-out;
}
.btn:hover {
  filter: brightness(0.95);
}
.btn-primary {
  background: #156b3b;
  color: #fff;
} /* GIC green */
.btn-secondary {
  background: #c9a432;
  color: #fff;
} /* GIC gold  */
.btn-danger {
  background: #c9302c;
  color: #fff;
} /* red */
/* Logout link (top-right) */
.logout-link {
  position: fixed;
  top: 12px;
  right: 16px;
  text-decoration: none;
  background: #eee;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 600;
  color: #333;
  z-index: 1000;
}
.logout-link:hover {
  background: #e2e2e2;
}
/* Logout button container */
.logout-container {
  position: absolute;
  top: 15px;
  right: 20px;
}

/* Logout button styling */
.logout-link {
  display: inline-block;
  padding: 8px 14px;
  background-color: #006400; /* GIC green */
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.logout-link:hover {
  background-color: #004d00; /* Darker green on hover */
}
.logout-container {
  display: flex;
  gap: 12px; /* space between links */
  justify-content: flex-end;
  padding: 10px 20px;
}

.logout-link {
  color: #fff;
  background-color: #007bff;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.3s ease;
}

.logout-link:hover {
  background-color: #0056b3;
}
.change-password-link {
  display: inline-block;
  background-color: #166534; /* green */
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  margin-right: 8px; /* space before Logout */
}

.change-password-link:hover {
  background-color: #14532d; /* darker green on hover */
}
.change-password-link,
.logout-link {
  background-color: #166534; /* same green as other buttons */
  color: white;
  padding: 8px 14px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.2s ease;
}

.change-password-link:hover,
.logout-link:hover {
  background-color: #14532d; /* darker green on hover */
}
.logout-container {
  display: flex;
  gap: 10px; /* space between the buttons */
  margin-right: 15px; /* keeps them away from the edge */
  align-items: center;
}
.logout-link,
.change-password-link {
  background-color: #28a745; /* green */
  color: white;
  padding: 8px 15px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
}

.logout-link:hover,
.change-password-link:hover {
  background-color: #218838; /* darker green on hover */
}
.logout-link {
  background-color: #2d7a38; /* same green as your other buttons */
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
}

.logout-link:hover {
  background-color: #25632f; /* darker on hover */
}
.topnav,
.subnav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: 10px 14px;
}
.subnav {
  border-top: 1px solid #1d6b3a22;
  border-bottom: 1px solid #1d6b3a22;
  background: #0b2f1c08;
}
.topnav a,
.subnav a {
  text-decoration: none;
}
.subnav {
  display: flex;
  gap: 1.25rem;
  padding: 10px 14px;
  background: #0b2f1c08;
  border: 1px solid #1d6b3a22;
  border-radius: 12px;
}
.subnav a {
  text-decoration: none;
}
/* ===== Calendar Styles ===== */

.cal-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.month-heading {
  background-color: #106b38; /* Deep green */
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 1.4rem;
  font-weight: bold;
}

.cal-row {
  display: flex;
  align-items: flex-start;
  background-color: #f8f9fa; /* light grey background */
  border-radius: 8px;
  padding: 0.75rem 1rem;
  gap: 1rem;
}

.cal-date {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 150px; /* wider for start & end dates */
}

.cal-date-main {
  font-weight: bold;
  color: #106b38;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.cal-date-main .to {
  font-weight: normal;
  color: #666;
}

.cal-body {
  flex-grow: 1;
}

.cal-title {
  font-size: 1rem;
  font-weight: bold;
}

.cal-title .sep {
  margin: 0 0.25rem;
}

.cal-title .loc {
  font-size: 0.9rem;
  color: #555;
}

.cal-desc {
  font-size: 0.9rem;
  margin-top: 0.25rem;
  color: #444;
}

.badge {
  background-color: #d4edda; /* soft green */
  color: #155724;
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  margin-bottom: 0.25rem;
  display: inline-block;
}
/* Calendar: lock the date column so titles line up */
.cal-list .cal-row {
  display: grid;
  grid-template-columns: 340px 1fr; /* ← fixed date col, rest for content */
  align-items: start;
  gap: 24px;
}

.cal-list .cal-date {
  min-width: 320px; /* keep width even for single dates */
}

.cal-list .cal-date-main {
  white-space: nowrap; /* keep date/range on one line */
}

.cal-list .cal-date .to {
  padding: 0 6px;
  opacity: 0.6;
}

/* Responsive: stack on narrow screens */
@media (max-width: 720px) {
  .cal-list .cal-row {
    grid-template-columns: 1fr; /* stack date above content */
    gap: 8px;
  }
  .cal-list .cal-date,
  .cal-list .cal-date-main {
    min-width: 0;
    white-space: normal;
  }
}
