/* General Styles */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
}

/* Login/Signup Pages */
body:not(.dashboard-page) {
  background-color: #7a449a;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.form-container {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  width: 300px;
  box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

h2 {
  color: #7a449a;
  margin-bottom: 1rem;
}

input {
  width: 100%;
  padding: 10px;
  margin: 0.5rem 0;
  border: 1px solid #ccc;
  border-radius: 5px;
}

/* Match style for select dropdown */
select {
  width: 100%;
  padding: 10px;
  margin: 0.5rem 0;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: white;
  color: #333;
  font-family: inherit;
}

button {
  width: 100%;
  background-color: #7a449a;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 1rem;
}

p {
  margin-top: 1rem;
}

a {
  color: #7a449a;
  text-decoration: none;
  font-weight: bold;
}

/* Dashboard Page */
body.dashboard-page {
  background-color: white;
  padding: 2rem;
}

.dashboard {
  text-align: center;
  color: #7a449a;
}

/* Table Styles */
table {
  width: 90%;
  margin: 2rem auto;
  border-collapse: collapse;
  background: white;
  color: #333;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background-color: #7a449a;
  color: white;
}

a {
  color: #7a449a;
  text-decoration: none;
  font-weight: bold;
}

th a {
  color: white;
  text-decoration: none;
}

tr:hover {
  background-color: #f3e8f7;
}

.dashboard-header {
  position: relative;
  width: 90%;
  margin: 0 auto 20px auto;
  border-bottom: 2px solid #7a449a;
  padding-bottom: 10px;
  height: 40px;
  text-align: left;
}

/* Centered heading */
.dashboard-header h2 {
  position: static;      /* or just remove 'position' entirely */
  left: auto;
  transform: none;
  margin: 0;
  color: #7a449a;
  font-size: 24px;
  text-align: left !important;
}

/* New container for the buttons */
.header-buttons {
  position: absolute;
  right: 0;
  top: 0;
  display: flex;
  gap: 10px;
}

/* Shared button styles */
.add-button,
.logout-button {
  background-color: #7a449a;
  color: white;
  padding: 6px 12px;
  font-size: 14px;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.add-button:hover,
.logout-button:hover {
  background-color: #5c3375;
}

.success-message {
  color: #28a745;
  font-weight: bold;
}

.error-message {
  color: #dc3545;
  font-weight: bold;
}

.pagination {
  text-align: center;
  margin-top: 20px;
}

.pagination-button {
  display: inline-block;
  margin: 0 5px;
  padding: 8px 12px;
  border: 1px solid #7a449a;
  border-radius: 4px;
  text-decoration: none;
  color: #7a449a;
  font-weight: bold;
  background-color: white;
  transition: background-color 0.2s ease;
}

.pagination-button:hover {
  background-color: #f3e8f7;
}

.pagination-button.active {
  background-color: #7a449a;
  color: white;
}

.search-container {
  display: flex;
  justify-content: center;
  margin: 20px auto;
}


.search-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-form input[type="text"] {
  width: 200px;
  padding: 8px 10px;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #ccc;
  height: 38px;
  box-sizing: border-box;

  display: flex;
  align-items: center;
}

.search-button {
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #5e2f7f;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-button:hover {
  background-color: #4a2361;
}

/* Toggle Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 25px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  content: "";
  position: absolute;
  height: 19px;
  width: 19px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #5e2f7f;
}

input:checked + .slider:before {
  transform: translateX(24px);
}


/* Responsive Styles for Small Screens */
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    height: auto;
    padding-bottom: 40px;
    text-align: left;
  }

  .dashboard-header h2 {
    position: static;      /* or just remove 'position' entirely */
    left: auto;
    transform: none;
    margin: 0;
    color: #7a449a;
    font-size: 24px;
    text-align: left;
  }

  .header-buttons {
    position: static;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
  }

  .add-button,
  .logout-button {
    width: auto;
    font-size: 13px;
    padding: 6px 10px;
  }

  .search-container {
    flex-direction: column;
    align-items: center;
  }

  .search-container form {
    flex-direction: column;
    gap: 10px;
  }
}



/* 90% centered row — matches the table’s left/right spacing */
.row-90 {
  width: 90%;
  margin: 0 auto 15px;    /* auto left/right = equal space; 15px bottom gap */
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box; /* prevent padding/border from expanding width */
}

.row-90 select {
  padding: 5px 8px;
  min-width: 160px;
}

.row-90__label {
  margin-right: 8px;
}

:root{
  --table-width: 90%; /* matches your table */
  --rebel-gutter: calc((100% - var(--table-width)) / 2);
}

/* full-width row, content right-aligned with the same right gutter */
.align-right-gutter{
  display:flex;
  justify-content:flex-end;
  padding:10px var(--rebel-gutter) 0 0;
  box-sizing:border-box;
}

/* small content-width box whose RIGHT edge aligns with the table */
.right-edge{
  width:max-content;               /* shrink to button size */
  margin:10px var(--rebel-gutter) 0 auto;  /* top | right | bottom | left */
  box-sizing:border-box;
}



/* Admin toggle bar under the banner */
.admin-controls {
  max-width: 1200px;
  margin: 12px auto 0;
  padding: 0 40px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Toggle (from your snippet) */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  margin-top: 0; /* looks nicer in this toolbar */
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}
.slider:before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}
.switch input:checked + .slider {
  background-color: #28a745;
}
.switch input:checked + .slider:before {
  transform: translateX(22px);
}

.toggle-label {
  font-size: 14px;
  color: #333;
}

/* Card layout tweaks to fit the delete button */
.card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.card-actions {
  display: flex;
  align-items: flex-start;
}
.btn-delete {
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  background: #dc3545;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}
.btn-delete:hover {
  filter: brightness(0.95);
}
