/* ===== BASE STYLES ===== */
:root {
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --secondary: #3f37c9;
  --success: #4cc9f0;
  --danger: #f72585;
  --warning: #ffd800;
  --info: #4895ef;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --white: #ffffff;
  --border-radius: 0.375rem;
  --box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --transition: all 0.3s ease;
}

.status-green {
    background-color: #d4edda;
    color: #155724;
    font-weight: bold;
}

.status-yellow {
    background-color: #fff3cd;
    color: #ffaa00;
    font-weight: bold;
}

.status-red {
  background-color: #f8d7da;
  color: red;
  font-weight: bold;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background-color: #f5f7fa;
  padding: 20px;
}

/* ===== LOGIN PAGE STYLES ===== */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
}

.login-container {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-page h1 {
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.login-page form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-page label {
  display: block;
  text-align: left;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark);
}

.login-page input[type="password"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
}

.login-page input[type="password"]:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
}

.login-page button[type="submit"] {
  background-color: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 1rem;
}

.login-page button[type="submit"]:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

/* ===== HEADER STYLES ===== */
h1, h2, h3 {
  font-weight: bold;
  font-size: 1.25rem;
  color: var(--primary);
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
  margin: 1.5rem 0;
}

h2.section-header {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

/* ===== FORM STYLES ===== */
form {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--dark);
}

input[type="text"],
input[type="email"],
input[type="datetime-local"],
input[type="password"],
select {
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 1rem;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="datetime-local"]:focus,
input[type="password"]:focus,
select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
}

/* ===== BUTTON STYLES ===== */
.btn {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: var(--border-radius);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  color: var(--white);
  background-color: var(--primary);
  border-color: var(--primary);
  height: auto;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-success {
  color: var(--white);
  background-color: #28a745;
  border-color: #28a745;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  height: auto;
  box-shadow: none;
  border-radius: var(--border-radius);
  cursor: pointer;
}

.btn-success:hover {
  background-color: #218838;
  transform: translateY(-2px);
}

.btn-warning {
  color: var(--dark);
  background-color: var(--warning);
  border-color: var(--warning);
}

.btn-danger {
  background-color: #dc3545;
  color: white;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  height: auto;
  box-shadow: none;
  border-radius: var(--border-radius);
  cursor: pointer;
}

.btn-danger:hover {
  background-color: #c82333;
  transform: translateY(-2px);
}

.btn-warning:hover {
  background-color: #f2ca04;
  transform: translateY(-2px);
}

.delete-form {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  display: inline-block;
  box-shadow: none;
}

.btn-delete {
  color: var(--white);
  background-color: #dc3545;
  border: none;
  box-shadow: none;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
}

.btn-delete:hover {
  background-color: #c82333;
  transform: translateY(-2px);
}

.btn-edit {
  color: var(--dark);
  background-color: var(--warning);
  border-color: var(--warning);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-edit:hover {
  background-color: #f2ca04;
  transform: translateY(-2px);
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

/* ===== TABLE STYLES ===== */
table {
  width: 100%;
  margin: 1.5rem 0;
  background-color: var(--white);
  border-collapse: collapse;
  box-shadow: var(--box-shadow);
  border-radius: var(--border-radius);
  overflow: hidden;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

th {
  background-color: var(--primary);
  color: var(--white);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
  position: relative;
  cursor: pointer;
}

th.sort-asc::after {
  content: "▼";
  position: absolute;
  right: 10px;
  font-size: 0.75rem;
  color: var(--white);
}

th.sort-desc::after {
  content: "▲";
  position: absolute;
  right: 10px;
  font-size: 0.75rem;
  color: var(--white);
}

tr:nth-child(even) {
  background-color: rgba(67, 97, 238, 0.05);
}

tr:hover {
  background-color: rgba(67, 97, 238, 0.1);
}

/* ===== ADMIN SPECIFIC STYLES ===== */
.admin-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  align-items: end;
}

.admin-form button[type="submit"] {
  grid-column: 1 / -1;
}

/* ===== FLASH MESSAGE STYLES ===== */
.flash-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  max-width: 300px;
  width: auto;
}

.flash-message {
  padding: 12px 20px;
  margin-bottom: 10px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideIn 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55) forwards;
  transform: translateX(120%);
  opacity: 0;
  font-size: 14px;
  line-height: 1.4;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.flash-message.success {
  background-color: rgba(40, 167, 69, 0.9);
  color: white;
}

.flash-message.error {
  background-color: rgba(220, 53, 69, 0.9);
  color: white;
}

.flash-message.warning {
  background-color: rgba(255, 193, 7, 0.9);
  color: var(--dark);
}

.flash-message .close-btn {
  background: none;
  border: none;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
  margin-left: 12px;
  opacity: 0.7;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0 0 2px 4px;
}

.flash-message .close-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

@keyframes slideIn {
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.flash-message.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-center {
  text-align: center;
}

.mt-3 {
  margin-top: 1rem;
}

.mb-3 {
  margin-bottom: 1rem;
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 768px) {
  .admin-form {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  .action-buttons {
    display: flex;
    gap: 10px;
  }

  .action-buttons form {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
  }

  .flash-container {
    max-width: 90%;
    left: 20px;
    right: 20px;
    margin: 0 auto;
  }

  .flash-message {
    width: 100%;
  }

 .login-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        max-width: 400px;
        margin: 0 auto;
        padding: 2rem;
        background: var(--white);
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow);
    }

    .form-group {
        margin-bottom: 1.5rem;
        width: 100%;
    }

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
    }

    .form-group input {
        width: 100%;
        padding: 0.75rem;
        border: 1px solid #ced4da;
        border-radius: var(--border-radius);
    }
}