:root {
  --bg: #f4f6f8;
  --card: white;
  --text: #1f2937;
  --header: #111827;
  --button: #7713c9;
}

body.dark {
  --bg: #111827;
  --card: #1f2937;
  --text: #f3f4f6;
  --header: #000000;
  --button: #7713c9;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
}

p {
    margin-top: 0em;
    margin-bottom: 0em;
}

header {
  background: var(--header);
}

.footer {
  background: var(--header);
  text-align: center;
}

* {
  box-sizing: border-box;
}

header {
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

header h1 {
  margin: 0;
  font-size: 1.2rem;
}

.container {
  padding: 1rem;
  max-width: 1200px;
  margin: auto;
}

.card {
  background: var(--card);
  padding: 1.2rem;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  margin-bottom: 1rem;
  font-size: 1rem;
}

button {
  padding: 10px 16px;
  border: none;
  background: var(--button);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  margin: 2px 10px 2px 10px;
  animation: buttonanimation 5s infinite;
  box-shadow: inset 0 0 5px 0 rgba(255,255,255,.4), inset 0 0 5px 0 rgba(0,0,0,.4), inset 0 0 3px 5px rgba(0,0,0,.05), 2px 2px 4px 0 rgba(0,0,0,.25);
}

button:hover {
  background: #6a11b3;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  animation: none;
}

@keyframes buttonanimation {
  0%   {background-color: purple;}
  33%  {background-color: #880055;}
  66%  {background-color: #550088;}
  100% {background-color: purple;}
}

a:link{color:inherit}
a:active{color:inherit}
a:visited{color:inherit}
a:hover{color:inherit}

label {
  font-weight: 600;
  margin-bottom: 4px;
  display: block;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

/* Responsive table */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  min-width: 700px;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

th {
  background: var(--card);
}

img.thumb {
  width: 200px;
  border-radius: 8px;
}

input, select, textarea {
  padding: 0.5rem;
  width: 100%;
  max-width: 300px;
  border-radius: 6px;
  border: 1px solid #babdc2;
  margin-bottom: 0.5rem;
}

input[type="radio"],
input[type="checkbox"] {
  width: auto;
  max-width: 20px;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.25rem;
}

.inline-container label {
  display: inline-flex; /* allows the checkbox and text to sit inline */
  align-items: center;  /* vertically center checkbox and text */
  margin-bottom: 0;     /* optional: remove the bottom margin */
}

.checkbox-inline label {
  margin-right: 10px;   /* space between checkboxes */
}

.checkbox-group {
  display: flex;
  gap: 1rem;
  margin-top: 0.25rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Collapsible Filters */
.collapsible {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.collapsible.open {
  max-height: 1000px;
}

/* Image preview layout */
.image-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.image-preview {
  width: 100%;
  max-width: 300px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Mobile card layout */
.card-grid {
  display: none;
  gap: 0.5rem;
}

.polish-card {
  background: var(--card);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.polish-card img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.polish-card h3 {
  margin: 0 0 0.5rem 0;
}

/* Mobile behavior */
@media (max-width: 768px) {
  .table-wrapper {
    display: none;
  }

  .card-grid {
    display: grid;
  }
}

/* Pagination format */
.pagination-card {
  text-align: center;
  margin-top: 0.5rem;
}

.pagination-top {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.pagination-bottom {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.8;
  text-align: center;
}

/* Chip Multi-select menu */
.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #fff;
  font-weight: 600;
}

.chip {
  background: var(--button);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: buttonanimation 5s infinite;
  box-shadow: inset 0 0 5px 0 rgba(255,255,255,.4), inset 0 0 5px 0 rgba(0,0,0,.4), inset 0 0 3px 5px rgba(0,0,0,.05), 2px 2px 4px 0 rgba(0,0,0,.25);
}

.chip button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
}

.chip-dropdown {
  border: 1px solid #ccc;
  border-radius: 6px;
  max-height: 160px;
  overflow-y: auto;
  display: none;
  background: var(--bg);
  position: relative;
  z-index: 10;
}

.chip-dropdown div {
  padding: 6px;
  cursor: pointer;
}

.chip-dropdown div:hover {
  background: #eee;
}