/* === LMS Celebrity Autographs v1.3.5 — Core Styles === */

/* -------------------- ROOT -------------------- */
:root {
  --brand-main: #2c146c;
  --brand-accent: #4932a3;
  --brand-gold: #d6b24a;
  --light-bg: #f8f8f8;
  --border: #ccc;
  --highlight-bg: #fff8e1;
}

body {
  margin: 0;
  font-family: "Poppins", "Roboto", Arial, sans-serif;
  background: var(--light-bg);
  color: #222;
}

/* -------------------- TABLE -------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  margin-top: 10px;
  font-size: 0.95rem;
}

th,
td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
}

th {
  background: var(--brand-main);
  color: #fff;
  cursor: pointer;
  user-select: none;
}

tr:nth-child(even) {
  background: #fafafa;
}

tr:hover {
  background: #f1f1f1;
}

.highlight {
  background-color: var(--brand-gold);
  color: #000;
  font-weight: 600;
  padding: 0 2px;
  border-radius: 2px;
}

/* -------------------- PAGINATION -------------------- */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  margin-top: 10px;
}

.pagination-bar button {
  background: var(--brand-main);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.pagination-bar button:hover {
  background: var(--brand-accent);
}

.pagination-bar button:disabled {
  opacity: 0.4;
  cursor: default;
}

.pagination-bar select {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 6px;
  background: #fff;
}

/* -------------------- FILTERS -------------------- */
#filters {
  text-align: center;
  margin: 15px 0;
}

#filters input {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px;
  margin: 0 5px;
  width: 180px;
}

#filters button {
  background: var(--brand-main);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  margin: 0 5px;
  cursor: pointer;
}

#filters button:hover {
  background: var(--brand-accent);
}

/* -------------------- SPINNER -------------------- */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  border: 6px solid #ccc;
  border-top: 6px solid var(--brand-main);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* -------------------- RECORD COUNTER -------------------- */
#recordCount {
  display: block;
  text-align: right;
  font-weight: 500;
  color: var(--brand-main);
  margin: 10px 5px;
}

/* -------------------- CART MODAL -------------------- */
/* Cart modal background + close button */
#cartModal {
  display: none;
  position: fixed;
  inset: 0;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.7); /* darker, opaque backdrop */
  z-index: 2000;
}

#cartModal .modal-content {
  background: #fff;
  padding: 20px 30px;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  position: relative;
}

#cartModal .close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: var(--brand-main);
  font-size: 1.6rem;
  cursor: pointer;
  transition: color 0.25s;
}
#cartModal .close:hover {
  color: var(--brand-accent);
}


/* -------------------- DETAIL MODAL -------------------- */
#detailsModal {
  display: none;
  position: fixed;
  inset: 0;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  overflow-y: auto;
  padding: 20px;
}

#detailsModal > div {
  background: #fff;
  padding: 25px 30px;
  border-radius: 10px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  position: relative;
}

/* Detail modal close button */
#detailsModal button.close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: var(--brand-main);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10;
  transition: color 0.25s;
}
#detailsModal button.close:hover {
  color: var(--brand-accent);
}

/* -------------------- CART & DETAIL CONTENT -------------------- */
#cartItems div,
#detailsInfo p {
  line-height: 1.5;
  color: #333;
}

#detailsInfo h2 {
  color: var(--brand-main);
  margin-top: 0;
}

#detailsInfo button {
  background: var(--brand-main);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.25s;
}

#detailsInfo button:hover {
  background: var(--brand-accent);
}

#cartModal label {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--brand-main);
}
#shipCountry {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-family: "Poppins", sans-serif;
}


/* -------------------- RESPONSIVE -------------------- */
@media (max-width: 768px) {
  table,
  th,
  td {
    font-size: 0.9rem;
  }

  #filters input {
    width: 140px;
  }

  .pagination-bar {
    flex-direction: column;
    gap: 8px;
  }

  #detailsModal > div,
  #cartModal .modal-content {
    width: 95%;
  }
}
