/* =======================
   Global Reset & Base Styles
======================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(
    135deg,
    #74ebd5,
    #acb6e5
  ); /* Page gradient background */
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px 0;
}

/* =======================
   Container Styles
======================= */
.container {
  width: 95%;
  max-width: 900px;
  background: #fff;
  padding: 25px 30px;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

/* Lift container on hover for 3D effect */
.container:hover {
  transform: translateY(-5px);
}

/* =======================
   Headings
======================= */
h1,
h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #333;
}

/* =======================
   Input & Section Styles
======================= */
.date-section,
.search-section,
.buttons-section {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.date-section label {
  font-weight: 600;
  color: #555;
}

input[type="text"],
input[type="date"],
input[type="number"] {
  padding: 10px;
  width: 200px;
  border-radius: 8px;
  border: 1px solid #ccc;
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus {
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
  outline: none;
}

/* =======================
   Buttons
======================= */
/* Search Button - Purple */
.btn-search {
  background: #cc4141; /* Purple */
  color: rgb(235, 159, 159);
}

.btn-search:hover {
  background: #5936a6;
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(111, 66, 193, 0.3);
}

/* =======================
   Buttons
======================= */
/* Delete button styled like other buttons */
button.delete-btn {
  background: #dc3545; /* Red */
  color: white;
  border: none;
  padding: 10px 18px; /* same as other buttons */
  border-radius: 8px; /* same border-radius */
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  min-width: 120px; /* same as other buttons */
}

/* Hover effect */
button.delete-btn:hover {
  background-color: #c82333;
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(200, 35, 51, 0.3);
}

/* Active effect */
button.delete-btn:active {
  transform: scale(0.98);
}

/* Responsive adjustments */
@media screen and (max-width: 480px) {
  button.delete-btn {
    width: 100%; /* Full width on mobile */
  }
}

button {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  min-width: 120px;
}

/* Add New Student - Blue */
.btn-add {
  background: #007bff;
}
.btn-add:hover {
  background: #0056b3;
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

/* Load from Excel - Green */
.btn-load {
  background: #28a745;
}
.btn-load:hover {
  background: #218838;
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

/* Export Excel - Orange */
.btn-export {
  background: #fd7e14;
}
.btn-export:hover {
  background: #e66b00;
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(253, 126, 20, 0.3);
}

/* Active effect for all buttons */
button:active {
  transform: scale(0.98);
}

/* =======================
   Table Styles
======================= */
table {
  width: 100%;
  margin-top: 15px;
  border-collapse: collapse;
  overflow-x: auto;
  display: block; /* Enable horizontal scroll on small screens */
}

thead {
  background: #007bff;
  color: white;
}

th,
td {
  border: 1px solid #ccc;
  padding: 10px;
  text-align: center;
  font-size: 14px;
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* Attendance row colors */
.present {
  background-color: #d4edda; /* Green for present */
  transition: background 0.3s ease;
}

.absent {
  background-color: #f8d7da; /* Red for absent */
  transition: background 0.3s ease;
}

/* =======================
   Responsive Design
======================= */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="date"],
  input[type="number"] {
    width: 100%; /* Full-width inputs for tablets */
  }

  .date-section,
  .search-section,
  .buttons-section {
    flex-direction: column;
    align-items: center;
  }

  table {
    font-size: 12px;
  }
}

@media screen and (max-width: 480px) {
  th,
  td {
    padding: 8px;
    font-size: 11px;
  }

  button {
    width: 100%; /* Full-width buttons on mobile */
  }
}
