:root {
  /* Brand Colors */
  --purple-darkest: #1F1A2E;
  --purple-dark: #1C1624;
  --purple-deep: #2D1E37;

  /* Accent Colors */
  --plum-velvet: #6b4c73;
  --plum-heather: #7c5a85;
  --plum-muted: #47375B; 
  --plum-stone: #4A2E3E;
  --mulberry: #914D68;
  --berrywine: #865070;

  /* Button Colors */
  --blush-mist: #e4b1b1;
  --rosewood: #A15D78;
  --rose-blush: #C94956;

  /* Text Colors */
  --peach-fuzz: #FDEBD0;
  --frosted-lilac: #F2EAFB;
  --lavender-haze: #E5DAF5;
  --mauve-mist: #cdbfd4;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.hidden {
  visibility: hidden !important;
  pointer-events: none;
}

body {
  height: 100%;
  background-color: var(--purple-darkest);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--peach-fuzz);
}

.login-container {
  background-color: var(--purple-deep);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(228, 177, 177, 0.2);
  width: 400px;
  text-align: center;
}

.login-container h2 {
  color: var(--frosted-lilac);
}

input {
  width: 100%;
  padding: 0.7rem;
  margin: 0.5rem 0;
  border: none;
  border-radius: 8px;
  background-color: var(--plum-muted);
  color: var(--frosted-lilac);
}

input::placeholder {
  color: var(--mauve-mist);
}

.login-container button {
  width: 100%;
  padding: 0.7rem;
  margin-top: 1rem;
  background-color: var(--rosewood);
  border: none;
  border-radius: 8px;
  color: var(--peach-fuzz);
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.login-container button:hover {
  background-color: var(--rose-blush);
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  pointer-events: none;
  transition: opacity 0.3s ease;
  opacity: 0;
}

.modal.show {
  pointer-events: all;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.modal-content {
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--purple-deep);
  color: var(--frosted-lilac);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 0 25px rgba(252, 222, 191, 0.25);
  z-index: 1000;
  max-width: 90%;
  min-width: 300px;
  width: fit-content;
  text-align: center;
  animation: popupFadeIn 0.4s ease-out;
}

.modal-content button {
  width: 100%;
  cursor: pointer;
  display: block;
  text-align: center;
}

.modal-actions {
  display: flex;
  justify-content: flex-end; /* Align buttons to the right */
  gap: 1rem; /* Space between buttons */
}

@keyframes popupFadeIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  margin: 0;
  background-color: var(--purple-darkest);
  color: var(--frosted-lilac);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

main.content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.container.hidden {
  display: none !important;
}

.container {
  flex: 1;
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  min-width: 0;
  overflow: hidden;
  width: 100%;
}

/* Parking areas */
.parking-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--purple-deep);
  border-radius: 10px;
  padding: 0.5rem;
  min-width: 0;
  overflow: hidden;
}
.normal-parking {
  border: 2px solid var(--mauve-mist);
}
.reserved-parking {
  border: 2px solid var(--peach-fuzz);
}
.parking-area header {
  padding: 0.5rem;
  text-align: center;
  border-bottom: 2px solid var(--mauve-mist);
}
.normal-parking header {
  border-bottom: 2px solid var(--mauve-mist);
}
.reserved-parking header {
  border-bottom: 2px solid var(--peach-fuzz);
}
.parking-area h2 {
  font-size: 2.3rem;
  line-height: 1.3;
}
.normal-parking h2 {
  color: var(--lavender-haze);
}
.reserved-parking h2 {
  color: var(--peach-fuzz);
}


.slot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start; /* aligns to the left */
  align-items: flex-start;
  padding: 0.5rem;
  overflow-y: auto;
}

.slot {
  flex: 1 0 calc(16.66% - 0.5rem); /* try 6 per row initially */
  aspect-ratio: 2 / 3;
  min-width: 60px;
  background-color: var(--plum-heather);
  color: var(--lavender-haze);
  font-size: 2.3rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: bold;
  transition: all 0.2s ease;
}
.slot.reserved {
  color: var(--peach-fuzz);
  background-color: var(--rosewood);
}
.slot.occupied {
  background-color: var(--plum-stone);
  pointer-events: none;
  cursor: not-allowed;
}

/* Admin container */
.admin-parking {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--rose-blush);
  overflow: hidden;
}
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.search-select-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.search-wrapper,
.select-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.search-wrapper {
  flex: 2;
}
.search-wrapper i,
.select-wrapper i {
  position: absolute;
  left: 0.75rem;
  color: var(--lavender-haze);
  pointer-events: none;
}
.search-wrapper input,
.select-wrapper select {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2rem;
  border-radius: 8px;
  border: 2px solid var(--berrywine);
  background-color: var(--purple-deep);
  color: var(--lavender-haze);
  font-weight: 500;
  appearance: none;
}

.uid-table {
  overflow-x: auto;
  width: 100%;
  height: 100%;
}
.uid-inner {
  display: inline-block;
  min-width: max-content;
  width: 100%;
}
.uid-header {
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background-color: var(--berrywine);
  border: 1px solid var(--purple-darkest);
  border-radius: 8px;
  font-weight: 600;
  color: var(--frosted-lilac);
  opacity: 0.9;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: 0.5rem; 
}
.uid-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: max-content; 
}
.uid-card {
  display: flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--plum-muted);
  border-radius: 8px;
}
.uid-card:nth-child(odd) {
  background-color: var(--plum-muted);
}
.uid-card:nth-child(even) {
  background-color: var(--plum-heather); 
}
.uid-card button {
  font-size: 1rem;
  background-color: transparent;
  color: var(--peach-fuzz);
}
.uid-card button:hover {
  background-color: transparent;
  color: var(--rose-blush);
}
.uid-checkbox {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-right: 1rem;
}
.uid-info {
  display: flex;
  flex: 1;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.uid-field {
  flex: 1;
  min-width: 200px;
  text-align: left;
}

.admin-actions {
  background-color: var(--purple-dark);
  border: 2px solid var(--berrywine);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.admin-actions > div {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

#panelActions.hidden,
#adminButtons.hidden {
  display: none !important;
}

/* Footer always visible */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center; /* Align vertically centered */
  gap: 1rem;
  padding: 1rem;
  background-color: var(--purple-dark);
  border-top: 2px solid var(--plum-velvet);
  flex-shrink: 0;
  width: 100%;
  height: 5rem;
  box-sizing: border-box;
}

.footer > div {
  flex: 1;
}

.copyright {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.github-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  text-decoration: none;
  color: var(--mauve-mist);
  font-size: 0.95rem;
  font-weight: 500;
}

.github-link:hover {
  color: var(--peach-fuzz);
}

.branding {
  text-align: center;
  color: var(--lavender-haze);
  user-select: none;
  cursor: pointer;
}

.branding h1 {
  font-size: 1.8rem;
}

.branding p {
  font-size: 1rem;
  color: var(--mauve-mist);
}

.control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
}

.control button {
  font-size: 1.2rem;
  width: 2rem;
  aspect-ratio: 1 / 1;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 900px) {
  .branding p,
  .copyright p {
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .parking-area header {
    padding: 0.25rem;
  }

  .parking-area h2 {
    font-size: 1rem;
  }

  .slot {
    flex: 1 0 calc(50% - 0.5rem);
    aspect-ratio: 2 / 3;
    font-size: 1rem;
  }

  .search-wrapper {
    flex: 1.5;
  }

  .btn-text {
    display: none;
  }

  .footer {
    padding: 0 0.5rem;
    height: 3rem;
  }
  .branding p,
  .copyright p {
    display: none;
  }
  .branding h1 {
    font-size: 1.2rem;
  }
  .github-link {
    font-size: 0.85rem;
  }
  .control button {
    font-size: 0.8rem;
    width: 1.2rem;
  }
}

/* General Styling */
button {
  padding: 0.6em 1.2em;
  background-color: var(--rosewood);
  color: var(--lavender-haze);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  transition: background-color 0.3s ease, color 0.3s ease, border 0.3s ease;
  display: block;
  text-align: center;
}

button:hover {
  background-color: var(--blush-mist);
  color: var(--purple-darkest);
}

button.danger {
  background-color: var(--rose-blush);
}

button.danger:hover {
  background-color: var(--blush-mist);
}

button.outline {
  background-color: transparent;
  color: var(--mauve-mist);
  border: 2px solid var(--mauve-mist);
}

button.outline:hover {
  color: var(--peach-fuzz);
  border-color: var(--peach-fuzz);
}

/* Remove any legacy styles */
.bulk-delete, .close-modal, .control-button {
  all: unset;
}

/* Universal Modern Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--plum-muted) var(--purple-darkest);
}

/* For WebKit-based browsers (Chrome, Edge, Safari) */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background-color: var(--purple-darkest);
  border-radius: 8px;
}

*::-webkit-scrollbar-thumb {
  background-color: var(--plum-muted);
  border-radius: 8px;
  border: 2px solid var(--purple-darkest);
}

*::-webkit-scrollbar-thumb:hover {
  background-color: var(--plum-heather);
}
