/* File: css/style.css */

:root {
  --primary-color: #5a67d8;
  --primary-color-light: #7f8eee;
  --secondary-color: #f7fafc;
  --bg-color: #ffffff;
  --text-color: #2d3748;
  --light-text-color: #718096;
  --border-color: #e2e8f0;
  --success-color: #38a169;
  --danger-color: #e53e3e;
  --warning-color: #d69e2e;
  --info-color: #3182ce;
  --font-family: "Poppins", sans-serif;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 8px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-family);
  background-color: var(--secondary-color);
  color: var(--text-color);
  line-height: 1.6;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
header {
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}
header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#schoolName {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  padding: 5px 0;
}
#schoolName:focus {
  outline: none;
  border-bottom: 2px solid var(--primary-color-light);
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
  z-index: 1001;
}
nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  align-items: center;
}
nav a {
  text-decoration: none;
  color: var(--light-text-color);
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--radius);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
}
nav a i {
  margin-right: 8px;
}
nav a:hover,
nav a.active {
  color: var(--primary-color);
  background-color: rgba(90, 103, 216, 0.05);
}
.page {
  display: none;
  animation: fadeInPage 0.5s ease-in-out;
}
.page.active {
  display: block;
}
@keyframes fadeInPage {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
main {
  padding: 2rem 0;
}
.card,
.welcome-card {
  background-color: var(--bg-color);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}
.welcome-card {
  max-width: 700px;
  margin: 4rem auto;
  text-align: center;
  padding: 3rem;
  background: linear-gradient(135deg, var(--bg-color) 0%, #f8faff 100%);
  box-shadow: var(--shadow-lg);
}
.welcome-card h2 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.welcome-card p {
  font-size: 1.1rem;
  color: var(--light-text-color);
  margin-bottom: 2.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
h2 {
  margin-bottom: 2rem;
  color: var(--text-color);
  font-weight: 600;
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
h2 i {
  color: var(--primary-color);
}
.btn {
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn.primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}
.btn.primary:hover {
  background-color: var(--primary-color-light);
  border-color: var(--primary-color-light);
}
.btn.secondary {
  background-color: var(--light-text-color);
  border-color: var(--light-text-color);
  color: #fff;
}
.btn.danger {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
  color: #fff;
}
.btn.success {
  background-color: var(--success-color);
  border-color: var(--success-color);
  color: #fff;
}
.btn:disabled {
  background-color: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.table-wrapper {
  overflow-x: auto;
  background: var(--bg-color);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}
thead th {
  background-color: transparent;
  font-weight: 600;
  color: var(--light-text-color);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border-color);
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr {
  transition: background-color 0.2s ease;
}
tbody tr:hover {
  background-color: #fafbff;
}
tfoot tr {
  background-color: var(--secondary-color);
  font-weight: 600;
}
tfoot td {
  border-top: 2px solid var(--primary-color);
}
.action-buttons button {
  margin-right: 5px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 5px;
  transition: all 0.2s;
  border-radius: 50%;
  width: 36px;
  height: 36px;
}
.action-buttons button:hover {
  background-color: var(--secondary-color);
  transform: scale(1.1);
}
.action-buttons .edit-btn {
  color: var(--primary-color);
}
.action-buttons .delete-btn {
  color: var(--danger-color);
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}
.toolbar:last-child {
  margin-bottom: 0;
}
.form-group {
  display: flex;
  flex-direction: column;
}
.form-group label {
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.9rem;
}
input[type="text"],
input[type="date"],
select,
input[type="file"] {
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-family);
  background-color: var(--bg-color);
  transition: all 0.2s ease;
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.2);
}
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fade-in 0.3s;
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 30px;
  border: none;
  width: 90%;
  max-width: 500px;
  border-radius: var(--radius);
  position: relative;
  animation: slide-down 0.4s ease;
  box-shadow: var(--shadow-lg);
}
.modal-content h3 {
  margin-bottom: 2rem;
  font-size: 1.5rem;
  color: var(--text-color);
}
#studentForm .form-group {
  margin-bottom: 1.25rem;
}
@keyframes slide-down {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.close-btn {
  color: #aaa;
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
}
.close-btn:hover {
  color: var(--danger-color);
}
.status-radio-group label {
  margin-right: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
#recapTable td:not(:first-child):not(:nth-child(2)):not(:nth-child(3)):not(:nth-child(4)) {
  text-align: center;
}
#recapTable th {
  text-align: center;
}
#recapTable th:first-child,
#recapTable th:nth-child(2),
#recapTable th:nth-child(3),
#recapTable th:nth-child(4) {
  text-align: left;
}
#recapTable td:first-child,
#recapTable td:nth-child(2),
#recapTable td:nth-child(3),
#recapTable td:nth-child(4) {
  text-align: left;
}
footer {
  text-align: center;
  padding: 2rem 0;
  margin-top: 3rem;
  background-color: transparent;
  color: var(--light-text-color);
  border-top: 1px solid var(--border-color);
}
@media (max-width: 820px) {
  .menu-toggle {
    display: block;
  }
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    box-shadow: var(--shadow-md);
  }
  nav.active {
    display: block;
  }
  nav ul {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }
  nav ul li {
    width: 100%;
  }
  nav a {
    display: block;
    text-align: left;
    padding: 1rem 1.5rem;
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
  }
  nav a.active,
  nav a:hover {
    background-color: var(--secondary-color);
  }
  .welcome-card h2 {
    font-size: 2rem;
  }
  .responsive-table thead {
    display: none;
  }
  .responsive-table tr {
    display: block;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    border-radius: var(--radius);
    background: var(--bg-color);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
  }
  .responsive-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
    border-bottom: 1px solid #eee;
    padding: 12px 0;
  }
  .responsive-table td:last-child {
    border-bottom: none;
  }
  .responsive-table td::before {
    content: attr(data-label);
    font-weight: bold;
    text-align: left;
    margin-right: 1rem;
    color: var(--text-color);
  }
  .action-buttons {
    text-align: right;
  }
}
/* Tambahan untuk status di halaman riwayat */
.status-indicator {
  padding: 5px 12px;
  border-radius: 15px;
  font-weight: 500;
  font-size: 0.85rem;
  text-align: center;
  color: #fff;
  display: inline-block;
}
.status-Hadir {
  background-color: var(--success-color);
}
.status-Sakit {
  background-color: var(--warning-color);
  color: var(--text-color);
}
.status-Izin {
  background-color: var(--info-color);
}
.status-Alpa {
  background-color: var(--danger-color);
}
