/* COLLECTIONS CSS */

/* --- PAGE LAYOUT (Match Finance/Dashboard/Devices) --- */
main {
  display: grid;
  grid-template-columns: 20.8rem 1fr;
  min-height: 100vh;
}

.collections-content {
  padding: 3.2rem;
  display: flex;
  flex-direction: column;
  gap: 4rem; /* Increased spacing between sections */
}

/* --- HEADER SECTION --- */
.collections-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.6rem 2.4rem;
  background: rgba(18, 18, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.collections-page-title {
  font-family: "Orbitron", sans-serif;
  font-size: 2.4rem;
  color: #fff;
  letter-spacing: 1px;
}

/* Button "Buy New Art" - matched to Device Style */
.btn-new-art {
  background: linear-gradient(135deg, #ffd900 0%, #ff8c00 100%);
  border: none;
  border-radius: 8px;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  text-decoration: none;
}

.btn-new-art:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 140, 0, 0.4);
}

.btn-new-art ion-icon {
  font-size: 2rem;
  color: #000;
}

.btn-new-art span {
  font-family: "Rajdhani", sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: #000;
  text-transform: uppercase;
}

/* --- CATEGORY SECTIONS --- */
.category-section {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.category-header {
  font-family: "Orbitron", sans-serif;
  font-size: 2rem;
  color: #fff;
  padding: 0.8rem 1.6rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  width: fit-content;
  border-left: 4px solid #fff;
  /* Base neon style */
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

/* Neon Glow Variants */
.header-painting {
  border-color: #6a58dc; /* Purple */
  text-shadow: 0 0 10px rgba(166, 77, 255, 0.8);
  box-shadow: 0 0 20px rgba(166, 77, 255, 0.2);
}

.header-figurine {
  border-color: #00f2ff; /* Cyan */
  text-shadow: 0 0 10px rgba(0, 242, 255, 0.8);
  box-shadow: 0 0 20px rgba(0, 242, 255, 0.2);
}

.header-sculpture {
  border-color: rgb(166, 77, 255); /* Green */
  /* border-color: #40c057; Green */
  text-shadow: 0 0 20px rgba(166, 77, 255, 0.4);
  /* text-shadow: 0 0 10px rgba(64, 192, 87, 0.8); */
  box-shadow: 0 0 20px rgba(166, 77, 255, 0.4);
  /* box-shadow: 0 0 20px rgba(64, 192, 87, 0.2); */
}

/* --- COLLECTIONS GRID --- */
.collections-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(20rem, 1fr)
  ); /* Reduced size */
  gap: 2rem;
}

/* Card Style */
.collection-card {
  background: rgba(35, 35, 45, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
  overflow: hidden;
  position: relative;
  text-decoration: none;
  aspect-ratio: 1 / 1;
}

.collection-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card-img {
  width: 80%;
  /* height: 80%; */
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
}

.card-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  font-size: 1.4rem;
}

.card-name {
  font-family: "Orbitron", sans-serif;
  /* font-size: 1.7rem; */
  color: #fff;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%; /* Ensure it truncates before hitting price if needed */
}

.card-price {
  font-family: "Rajdhani", sans-serif;
  /* font-size: 1.7rem; */
  color: #40c057;
  font-weight: 600;
}

/* Empty State Card */
.collection-card.empty-card {
  justify-content: center;
  align-items: center;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  animation: pulse-card 3s infinite;
  /* Removed min-height to respect aspect-ratio */
}

.collection-card.empty-card:hover {
  border-color: #ffd900;
  box-shadow: 0 0 15px rgba(255, 217, 0, 0.2);
  animation: none;
}

.empty-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  color: #666;
  transition: color 0.3s;
}

.collection-card.empty-card:hover .empty-content {
  color: #ffd900;
}

.empty-content ion-icon {
  font-size: 3.2rem;
}

.empty-text {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@keyframes pulse-card {
  0% {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
  }
  100% {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
}

/* --- MEDIA QUERIES --- */
@media (max-width: 84em) {
  #page-collections {
    zoom: 90%;
  }
}

@media (max-width: 75em) {
  #page-collections {
    zoom: 80%;
  }
}

@media (max-width: 59em) {
  #page-collections {
    zoom: 70%;
  }
}

@media (max-width: 44em) {
  #page-collections {
    zoom: 1; /* Reset zoom on container */
  }

  .collection-card {
    zoom: 90%; /* Scale cards by -10% */
  }

  .collections-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 34em) {
  #page-collections {
    zoom: 75%; /* Shrink the container by roughly 25% overall on phones */
  }

  .collections-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .collections-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1.6rem;
  }
}

/* =========================================================
   CLICKABLE CARDS + ARTWORK MODAL (JS/collections-page.js)
   ========================================================= */
button.collection-card {
  font: inherit;
  color: inherit;
  text-align: left;
  width: 100%;
  cursor: pointer;
}
button.collection-card:focus-visible {
  outline: 2px solid #ffd900;
  outline-offset: 2px;
}

.artwork-content {
  width: 86rem;
  border-top-color: #ffd900;
}
.artwork-body {
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
}
.artwork-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 2.4rem;
  align-items: start;
}
.artwork-layout.cat-painting {
  --cat: #6a58dc;
}
.artwork-layout.cat-figurine {
  --cat: #22a6b3;
}
.artwork-layout.cat-sculpture {
  --cat: #be2edd;
}
.artwork-media {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  padding: 1.6rem;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.07), transparent 70%),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 2px solid var(--cat);
  display: flex;
  align-items: center;
  justify-content: center;
}
.artwork-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.artwork-info {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  font-family: "Rajdhani", sans-serif;
}
.artwork-category {
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.artwork-author {
  font-size: 1.6rem;
  color: #999;
}
.artwork-author b {
  color: #fff;
}
.artwork-price {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.2rem 1.6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.artwork-price span {
  font-size: 1.3rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.artwork-price b {
  font-size: 2.4rem;
  color: #40c057;
}
.artwork-desc {
  font-family: "Roboto", sans-serif;
  font-size: 1.3rem;
  line-height: 1.6;
  color: #999;
}
.artwork-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 2rem;
}
.artwork-details div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 1.4rem;
}
.artwork-details dt {
  color: #777;
}
.artwork-details dd {
  color: #ddd;
  font-weight: 600;
  text-align: right;
}

/* Display on device */
.artwork-section {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.artwork-section-title {
  font-family: "Orbitron", sans-serif;
  font-size: 1.5rem;
  color: #ddd;
  letter-spacing: 1px;
}
.artwork-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.5rem;
  color: #888;
}
.artwork-status ion-icon {
  font-size: 1.8rem;
}
.artwork-status.is-on {
  color: #ccc;
}
.artwork-status.is-on ion-icon {
  color: #40c057;
}
.artwork-link-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #fa5252;
  cursor: pointer;
  font-family: "Rajdhani", sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  text-decoration: underline;
}
.artwork-devices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
  gap: 1rem;
}
.artwork-device {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  padding: 1.2rem 1.4rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: inherit;
  text-align: left;
  cursor: pointer;
  font-family: "Rajdhani", sans-serif;
  transition:
    border-color 0.2s,
    background-color 0.2s;
}
.artwork-device:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.3);
}
.artwork-device.is-selected {
  border-color: #40c057;
  background: rgba(64, 192, 87, 0.08);
}
.artwork-device.is-current {
  cursor: default;
  border-color: rgba(64, 192, 87, 0.4);
  opacity: 0.75;
}
.artwork-device-radio {
  flex-shrink: 0;
  width: 1.8rem;
  height: 1.8rem;
  margin-top: 0.2rem;
  border-radius: 50%;
  border: 2px solid #555;
  position: relative;
}
.artwork-device.is-selected .artwork-device-radio,
.artwork-device.is-current .artwork-device-radio {
  border-color: #40c057;
}
.artwork-device.is-selected .artwork-device-radio::after,
.artwork-device.is-current .artwork-device-radio::after {
  content: "";
  position: absolute;
  inset: 0.3rem;
  border-radius: 50%;
  background: #40c057;
}
.artwork-device-text {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.artwork-device-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff;
}
.artwork-device-meta {
  font-size: 1.3rem;
  color: #888;
}
.artwork-device-state {
  font-size: 1.3rem;
  color: #40c057;
}
.artwork-device-state.is-busy {
  color: #ffa94d;
}
.artwork-assign-btn {
  align-self: flex-start;
  width: auto;
  padding: 1rem 2rem;
  font-size: 1.4rem;
}
.artwork-assign-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.artwork-no-device {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.5rem;
  color: #999;
}
.artwork-no-device a {
  color: #ffd900;
  margin-left: 0.6rem;
}
.artwork-footer {
  display: flex;
  justify-content: flex-end;
}
.artwork-sell-btn {
  width: auto;
  min-width: 20rem;
  padding: 0 3.2rem;
  min-height: 5rem;
  font-size: 1.7rem;
}

@media (max-width: 44em) {
  .artwork-layout {
    grid-template-columns: 1fr;
  }
  .artwork-media {
    max-height: 32vh;
    aspect-ratio: auto;
    height: 32vh;
  }
  .artwork-details {
    grid-template-columns: 1fr;
  }
  .artwork-footer .artwork-sell-btn {
    width: 100%;
  }
}
