/* Basic Reset & Styles */
body {
  margin: 0;
  font-family: Arial, sans-serif;
}

/* Top Navbar */
.top-nav {
  display: flex;
  align-items: center;
  background-color: #333;
  color: #fff;
  padding: 0.5rem 1rem;
}

.top-nav .logo {
  font-size: 1.5rem;
  font-weight: bold;
}

/* Filters button */
.filter-button {
  margin-left: 1rem;
  padding: 0.5rem 1rem;
  background-color: #555;
  border: none;
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
}

/* Search input */
.search-input {
  flex: 1;
  margin: 0 1rem;
  padding: 0.5rem;
  border: none;
  border-radius: 3px;
}

/* Menu */
.top-nav .menu {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.top-nav .menu li a {
  color: #fff;
  text-decoration: none;
}

/* Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Responsive grid */
  gap: 1rem;
  padding: 1rem;
}

/* Content Item */
.content-item {
    position: relative; /* For absolutely positioned details */
    background-color: #f0f0f0;
    padding: 1rem;
    text-align: center;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease; /* Smooth transition for expansion */
    height: auto; /* Default height */
}

.content-item img {
  max-width: 100%;
  height: auto;
}

.content-item h3 {
  margin: 0.5rem 0;
}

.collection-details {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9); /* Dark overlay */
    color: #fff;
    opacity: 0;
    visibility: hidden; /* Initially hidden */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto; /* Enable vertical scrolling */
    padding: 1rem;
    box-sizing: border-box; /* Include padding in height/width */
}

.content-item.expanded {
    height: auto; /* No fixed height  */
}

.content-item.expanded .collection-details {
    position: static; /* No longer overlaying  */
    opacity: 1;
    visibility: visible;
    background: none; /* No dark background  */
    color: inherit; /* Use default text color  */
    display: block; /* Always show  */
    max-height: none; /* No height limit  */
    overflow-y: visible; /* No scrolling here  */
}

.collection-description {
    max-height: 150px; /* Max height for description */
    overflow-y: auto; /* Enable scrolling within description */
}


/* Add these new styles  */

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8); /* Semi-transparent black */
    display: none; /* Initially hidden */
    z-index: 1001; /* Above other content */
}

.expanded-details {
    position: fixed;
    top: 50%; /* Center vertically */
    left: 50%; /* Center horizontally */
    transform: translate(-50%, -50%); /* Precise centering */
    background: #fff;
    padding: 2rem;
    border-radius: 5px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto; /* For long content */
    z-index: 1002; /* Above the overlay */
    display: none; /* Initially hidden */
}

.expanded-details .close-details {
    /* Adjust close button styles if needed  */
    top: 5px;
    right: 10px;
    color: #333;
}


/* Close button (X) */
.close-details {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #fff;
}

/* Filter Overlay Modal */
.filter-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.filter-content {
  background: #fff;
  padding: 2rem;
  border-radius: 5px;
  width: 80%;
  max-width: 600px;
  text-align: center;
  position: relative;
}

.filter-content h2 {
  margin-top: 0;
}

.filter-content label {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  /* Remove any extra horizontal padding if present */
  padding: 0;
}

.filter-content label input[type="checkbox"] {
  margin-right: 0.5rem;
}

.filter-checkbox {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 0;
  margin-bottom: 0.5rem;
  width: auto;
  cursor: pointer;
}

.filter-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  margin-right: 0.5rem;
  cursor: pointer;
}

/* Close button for filter modal */
.close-filter {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: #333;
}