:root {
  --green-dark: #1f2a24;
  --green-main: #2f6f4e;
  --green-light: #9fe0b5;
  --green-extra-light: #eef6f0;
  --white: #ffffff;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  background-color: var(--green-extra-light);
  color: var(--green-dark);

  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background-color: var(--green-main);
  color: var(--white);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
}

nav a {
  color: var(--white);
  text-decoration: none;
  margin-left: 1rem;
  font-weight: bold;
}

nav a:hover {
  text-decoration: underline;
}

main {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  flex: 1;
}

.login-container {
  max-width: 400px;
  margin: 0 auto;
  background-color: var(--white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0px 4px 10px rgba(0,0,0,0.1);
}

.login-container h2 {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--green-dark);
}

.login-container h3 {
  margin-top: 30px;
  font-size: 1.3rem;
  color: #333;
}

.login-container input,
.login-container select {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  border-radius: 8px;
  border: 1px solid #2f6f4e;
  font-size: 1rem;
}

.login-container button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  background: #2f6f4e;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.login-container button:hover {
  background: #2f6f4e;
}

#dashboard {
  display: none;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}
.card {
  background: #f4f4f4;
  border-radius: 12px;
  padding: 20px;
  min-height: 220px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);

  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.card button {
  align-self: flex-start;
}

.card button:hover {
  background-color: #66b58a;
}
/* 3. Fix Responsiveness */
@media (max-width: 1000px) {
  .dashboard {
    grid-template-columns: repeat(2, 1fr); /* 2 per row on tablets */
  }
}

@media (max-width: 600px) {
  .dashboard {
    grid-template-columns: 1fr; /* 1 per row on phones */
  }
}

.card h3 {
  margin-bottom: 15px;
  color: #2f6f4f;
}

.card p {
  margin: 10px 0;
  line-height: 1.6;
  word-wrap: break-word;
}

.btn {
  background-color: var(--green-light);
  color: var(--green-dark);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 0.5rem;
}

.btn:hover {
  background-color: var(--green-main);
  color: var(--white);
}


footer {
  text-align: center;
  padding: 1rem;
  margin-top: 2rem;
  background-color: var(--green-main);
  color: var(--white);
  padding-bottom: 80px;
}

.timetable {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  margin-top: 1rem;
}

.timetable div {
  padding: 0.8rem;
  text-align: center;
  border-radius: 6px;
}

.day {
  background-color: var(--green-main);
  color: var(--white);
  font-weight: bold;
}

.time {
  background-color: var(--green-light);
  font-weight: bold;
}

.class {
  background-color: var(--white);
  box-shadow: 0px 2px 5px rgba(0,0,0,0.1);
}

.class:hover {
  background-color: var(--green-extra-light);
}


.gpa-card {
  background-color: var(--green-main);
  color: var(--white);
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: 0px 4px 10px rgba(0,0,0,0.1);
}

.gpa {
  font-size: 2.5rem;
  font-weight: bold;
  margin: 0.5rem 0 0;
}

#addGradeBtn {
  padding: 12px 20px;
  background: #4a90e2;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  margin-bottom: 20px;
}

#addGradeBtn:hover {
  background: #357ac9;
}

#saveBtn {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

#saveBtn:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

#saveBtn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#saveBtn:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}

.grade-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.grade-input {
  width: 60px;
  padding: 5px;
  font-size: 1rem;
}

.grade-card {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  border-left: 8px solid #4CAF50;
}
.grade-card h3 {
  margin-top: 0;
  color: var(--green-main);
}

.grade-card:hover {
  transform: translateY(-5px);
}

#role {
  width: 100%;
  padding: 0.8rem;
  margin: 0.5rem 0;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background-color: var(--green-light);
  color: var(--green-dark);
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.dropbtn:hover {
  background-color: var(--green-dark);
  color: var(--white);
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: var(--white);
  min-width: 180px;
  border-radius: 8px;
  box-shadow: 0px 4px 10px rgba(0,0,0,0.15);
  overflow: hidden;
  z-index: 1000;
}

.dropdown-content a {
  display: block;
  padding: 0.8rem 1rem;
  color: var(--green-dark);
  text-decoration: none;
  font-weight: normal;
}

.dropdown-content a:hover {
  background-color: var(--green-extra-light);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* ===== LUNCH MENU STYLING ===== */

.menu {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

.menu h2 {
  text-align: center;
  color: var(--green-main);
  margin-bottom: 1.5rem;
}

.menu-item {
  background-color: var(--white);
  margin: 12px 0;
  padding: 1.2rem;
  border-radius: 12px;
  box-shadow: 0px 3px 10px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-item:hover {
  transform: translateY(-4px);
  box-shadow: 0px 6px 14px rgba(0,0,0,0.12);
}

.menu-item h3 {
  margin: 0 0 8px;
  color: var(--green-main);
  border-bottom: 2px solid var(--green-light);
  padding-bottom: 4px;
}

.menu-item p {
  margin: 5px 0;
}

.menu-item ul {
  margin: 5px 0;
  padding-left: 20px;
}

.menu-item li {
  margin: 4px 0;
}

/* ===== EVENTS PAGE STYLING ===== */

.event-card {
  background-color: var(--white);
  padding: 1.2rem;
  border-radius: 12px;
  box-shadow: 0px 3px 10px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-left: 6px solid var(--green-main);
}

.event-card:hover {
  transform: translateY(-5px);
  box-shadow: 0px 6px 14px rgba(0,0,0,0.15);
}

.event-card h3 {
  margin-top: 0;
  color: var(--green-main);
}

.event-date {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--green-dark);
  margin-bottom: 0.5rem;
}

/* ===== ADD EVENT BOX IMPROVED ===== */

.add-event {
  background-color: var(--white);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0px 3px 10px rgba(0,0,0,0.1);
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: center;
}

.add-event input {
  flex: 1;
  min-width: 150px;
  padding: 0.7rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.add-event input:focus {
  border-color: var(--green-main);
  box-shadow: 0 0 5px rgba(47, 111, 78, 0.3);
  outline: none;
}

.add-event button {
  background-color: var(--green-main);
  color: var(--white);
  border: none;
  padding:
 0.7rem 1.2rem;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}
.add-event button:hover {
  background-color: var(--green-dark);
  transform: translateY(-1px);
}

.add-event button:active {
  transform: scale(0.97);
}

main h2 {
  text-align: center;
  color: var(--green-main);
  margin-bottom: 1.2rem;
}

.add-event {
  background-color: var(--white);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0px 3px 10px rgba(0,0,0,0.08);
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.add-event input,
.add-event button {
  box-sizing: border-box;
}

.add-event input[type="text"],
.add-event input[type="date"] {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.85rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 1rem;
}

.add-event input:focus {
  outline: none;
  border-color: var(--green-main);
  box-shadow: 0 0 5px rgba(47, 111, 78, 0.2);
}

#addEventBtn {
  background-color: var(--green-main);
  color: var(--white);
  border: none;
  padding: 0.85rem 1.2rem;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  min-width: 140px;
}

#addEventBtn:hover {
  background-color: var(--green-dark);
}

.events-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.event-card {
  background-color: var(--white);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0px 3px 10px rgba(0,0,0,0.08);
  border-left: 6px solid var(--green-main);
}

.event-card h3 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  color: var(--green-main);
  font-size: 1.1rem;
  line-height: 1.3;
}

.event-date {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--green-dark);
}

.event-card .btn,
.event-card .delete-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  box-sizing: border-box;
}

/* ===== TABLETS ===== */
@media (max-width: 900px) {
  .events-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== PHONES ===== */
@media (max-width: 600px) {
  main {
    padding: 1rem;
  }

  .add-event {
    padding: 0.9rem;
    gap: 0.7rem;
  }

  .add-event input[type="text"],
  .add-event input[type="date"],
  #addEventBtn {
    width: 100%;
    flex: 1 1 100%;
  }

  .events-container {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .event-card {
    padding: 0.95rem;
  }

  .event-card h3 {
    font-size: 1rem;
  }

  .event-date {
    font-size: 0.9rem;
  }
}

@media (max-width: 380px) {
  header {
    padding: 0.8rem 1rem;
  }

  header h1 {
    font-size: 1.1rem;
  }

  main h2 {
    font-size: 1.2rem;
  }

  .add-event input[type="text"],
  .add-event input[type="date"],
  #addEventBtn {
    font-size: 0.95rem;
    padding: 0.75rem;
  }

  .event-card .btn,
  .event-card .delete-btn {
    font-size: 0.9rem;
    padding: 0.7rem 0.9rem;
  }
}

.delete-btn {
  margin-top: 0.5rem;
  background-color: #e74c3c;
  color: var(--white);
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: bold;
}

.delete-btn:hover {
  background-color: #c0392b;
  transform: translateY(-1px);
  box-shadow: 0px 3px 8px rgba(0,0,0,0.15);
}

.delete-btn:active {
  transform: scale(0.95);
}

.event-card .delete-btn {
  display: inline-block;
}

.events-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px; 
  margin-top: 20px;
}

.event-card {
  background-color: #f9f9f9;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.logout {
  display: block;
  width: 100%;
  text-align: left;
  background-color: #2f6f4e;
  color: #fff;
  padding: 0.8rem 1rem;
  border-radius: 0;
  font-weight: bold;
  transition: background-color 0.3s;
}

.dropdown-content .logout {
  border-top: 1px solid #ccc;
  margin-top: 5px;
}

.logout:hover {
  background-color: #246040;
  transform: scale(1.05);
}

#courseSelect {
  width: 100%;
  padding: 0.8rem;
  margin: 0.5rem 0;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: var(--white);
  color: var(--green-dark);
  font-size: 1rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

#courseSelect:focus {
  outline: none;
  border-color: var(--green-main);
  box-shadow: 0 0 5px rgba(47, 111, 78, 0.2);
}

@media (max-width: 480px) {
  #courseSelect {
    font-size: 0.95rem;
    padding: 0.7rem;
  }
}

#courseSelect:focus {
  outline: none;
  border-color: var(--green-main);
  box-shadow: 0 0 5px rgba(47,111,78,0.25);
}

@media (max-width: 330px) {
  #courseSelect {
    font-size: 0.95rem;
    padding: 0.7rem;
  }
}


#bookSearch {
  width: 100%;
  padding: 0.7rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-bottom: 0.5rem;
}

#bookResults {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
}

#bookResults li {
  padding: 0.5rem;
  background-color: var(--white);
  border-radius: 6px;
  margin-bottom: 0.3rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

#bookResults li:hover {
  background-color: var(--green-extra-light);
  transform: translateY(-2px);
}

/* ===== LOANS SECTION ===== */
#loanList {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
}

#loanList li {
  padding: 0.6rem;
  background-color: var(--white);
  border-radius: 6px;
  margin-bottom: 0.4rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#loanList li button {
  background-color: var(--green-light);
  color: var(--green-dark);
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

#loanList li button:hover {
  background-color: var(--green-main);
  color: var(--white);
  transform: scale(1.05);
}

/* ===== STUDY ROOM RESERVATION ===== */
#roomDate, #roomTime {
  width: calc(50% - 5px);
  padding: 0.6rem;
  margin-right: 0.5rem;
  border-radius: 6px;
  border: 1px solid #ccc;
}

#reservationStatus {
  margin-top: 0.5rem;
  font-weight: bold;
  color: var(--green-dark);
}

/* ===== BUTTONS IN SECTIONS ===== */
section.card button {
  background-color: var(--green-main);
  color: var(--white);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 0.5rem;
  transition: background-color 0.2s, transform 0.2s;
}

section.card button:hover {
  background-color: var(--green-dark);
  transform: translateY(-2px);
}

/* ===== RESPONSIVENESS FOR LIBRARY SERVICES ===== */
@media (max-width: 768px) {
  #roomDate, #roomTime {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  main {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  section.card {
    padding: 15px;
  }
  section.card button {
    width: 100%;
  }
}


table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background-color: var(--white);
  border-radius: 12px;
  overflow: hidden;
}

thead {
  background-color: var(--green-main);
  color: var(--white);
}

thead th {
  padding: 12px;
  text-align: left;
}

tbody td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

tbody tr:nth-child(even) {
  background-color: var(--green-extra-light);
}

tbody tr:hover {
  background-color: #e6f2ec;
}

/* ===== GRADES PAGE POLISH ===== */

#gradesContainer {
  display: grid;
  gap: 1.2rem;
}

.grade-card {
  background: var(--white);
  padding: 1.25rem;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  border-left: 8px solid var(--green-main);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grade-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.grade-card h3 {
  margin: 0 0 0.75rem;
  color: var(--green-main);
  font-size: 1.2rem;
}

.grade-card p {
  margin: 0.7rem 0;
  line-height: 1.5;
  color: var(--green-dark);
}

.grade-input,
.feedback-input {
  margin-top: 0.35rem;
  border: 1px solid #cfe3d5;
  border-radius: 10px;
  font-size: 0.95rem;
  padding: 0.75rem 0.9rem;
  background: #f9fcfa;
  color: var(--green-dark);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.grade-input {
  width: 90px;
  text-align: center;
  font-weight: bold;
}

.feedback-input {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  box-sizing: border-box;
}

.grade-input:focus,
.feedback-input:focus {
  outline: none;
  border-color: var(--green-main);
  box-shadow: 0 0 0 3px rgba(47, 111, 78, 0.12);
  background: var(--white);
}

.grade-input:disabled,
.feedback-input:disabled {
  background: #eef2ef;
  color: #5f6f66;
  border-color: #d7e2da;
  cursor: not-allowed;
}

.grade-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.grade-letter {
  display: inline-block;
  margin-left: 0.35rem;
  font-weight: bold;
  color: var(--green-main);
}

.gpa-card {
  max-width: 320px;
  margin: 0 auto 2rem;
}

@media (max-width: 768px) {
  .grade-card {
    padding: 1rem;
  }

  .grade-input {
    width: 100%;
    max-width: 120px;
  }

  .grade-actions {
    flex-direction: column;
  }

  #saveBtn,
  #addGradeBtn {
    width: 100%;
  }
}

.password-wrapper {
  position: relative;
  width: 100%;
}

.password-wrapper input {
  width: 100%;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 16px;
  color: #666;
  user-select: none;
  transition: color 0.2s ease;
}

.toggle-password:hover {
  color: var(--green-main);
}
