/* ============================================= */
/* minifigs.css - Single Column Accordion Style */
/* ============================================= */

/* ======================== */
/* ====== VARIABLES ======== */
/* ======================== */
:root {
  --content-width: 600px;
  --form-width: 320px;
  --breakpoint-mobile: 480px;
  --breakpoint-tablet: 768px;
  --breakpoint-laptop: 1024px;
  --breakpoint-desktop: 1280px;
  --breakpoint-wide: 1440px;
}

/* ======================== */
/* ====== RESET & BASE ===== */
/* ======================== */
*, *::before, *::after {
  box-sizing: border-box;
}

/* -------------------- Base -------------------- */
html, body {
  min-width: 320px;
  margin: 0;
  padding: 0;
  height: 100vh;
  font-family: "Coalabeer-5Vlv", sans-serif;
  font-size: 18px;
  background: #ddd url(../assets/bg.webp);
  background-size: cover;
  background-position: center;
  background-repeat: repeat;

  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}


/* ======================== */
/* ====== TYPOGRAPHY ======= */
/* ======================== */
@font-face {
  font-family: "Coalabeer-5Vlv";
  src: url("../fonts/Coalabeer-5Vlv.eot");
  src: url("../fonts/Coalabeer-5Vlv.eot?#iefix") format("embedded-opentype"),
       url("../fonts/Coalabeer-5Vlv.woff2") format("woff2"),
       url("../fonts/Coalabeer-5Vlv.woff") format("woff"),
       url("../fonts/Coalabeer-5Vlv.ttf") format("truetype"),
       url("../fonts/Coalabeer-5Vlv.svg#Coalabeer-5Vlv") format("svg");
  font-weight: normal;
  font-style: normal;
}

h1, h2, h3 {
  margin: 10px 0 10px;
  text-align: center;
  font-size: 1.8rem;
}

p {
  margin: 10px;
  font-size: 1.2rem;
  line-height: 1.5rem;
  text-align: center;
}

label {
  text-align: center;
}

div {
    padding: 10px;
}

/* =============================== */
/* ========== BUTTONS ============ */
/* =============================== */
.button {
  background-color: #3bb3e0;
  font-family: "Coalabeer-5Vlv", sans-serif;
  font-size: 1.25rem;
  text-decoration: none;
  color: #fff;
  box-shadow: inset 0px 1px 0px #7fd2f1, 0px 6px 0px #156785;
  border-radius: 10px;
  display: inline-block;
  width: 140px;
  height: 36px;
  line-height: 36px;
  border: none;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  text-align: center;
}

.button:active {
  top: 7px;
  box-shadow: inset 0px 1px 0px #7fd2f1, inset 0px -1px 0px #156785;
  color: #072239;
  background: #3bb3e0;
}

.button::before {
  background-color: #072239;
  content: "";
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  left: -2px;
  top: 5px;
  z-index: -1;
  border-radius: 10px;
  box-shadow: 0px 1px 0px #fff;
}

.button:active::before {
  top: -2px;
}

/* ======================== */
/* ======= PAGINATION ====== */
/* ======================== */

.pagination {
  display: flex;
  justify-content: center;
  padding: 20px 0;
  font-family: "Coalabeer-5Vlv", sans-serif;
  flex-wrap: wrap;
}

.pagination button {
  font-family: inherit;
  padding: 6px 12px;
  cursor: pointer;
  border: 1px solid #ccc;
  background-color: #f5f5f5;
  border-radius: 4px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination .active {
  background-color: #3bb3e0;
  color: white;
}

.pagination button:disabled {
  background-color: #ddd;
  cursor: not-allowed;
}

.pagination button:hover:not(:disabled) {
  background-color: #d6d6d6;
}

.pagination button:focus {
  outline: 2px solid #3bb3e0;
  outline-offset: 2px;
}

.pagination .ellipsis {
  padding: 0 6px;
  user-select: none;
  pointer-events: none;
}

.pagination-top {
    margin-bottom: 10px;
}

.pagination-bottom {
    margin-top: 10px;
}

/* ========================= */
/* ======= SEARCH BAR ====== */
/* ========================= */

/* Search bar container */
.search-container {
    margin: 20px auto;      /* Balanced spacing top/bottom, centered left/right */
    width: 400px;           /* Set a FIXED width instead of 100% */
    max-width: 90%;         /* Safety valve for small mobile screens */
    display: flex;          /* Use flex to keep things tidy */
    justify-content: center;
}

/* Search bar input */
#search-bar {
    width: 100%;            /* Now it fills exactly 400px every time */
    padding: 0.5rem;
    font-family: "Coalabeer-5Vlv", sans-serif;
    color: #ffffff;
    font-size: 22px;
    border: 2px solid #000000;
    border-radius: 10px;
    height: 40px;
    box-sizing: border-box; /* Crucial: keeps padding inside the 400px width */
    background-color: #156785;
    box-shadow: inset 3px 6px #7fd2f1;
}

::placeholder {
	color: #ffffff;
}

/* =========================== */
/* ======= PROGRESS BAR ====== */
/* =========================== */

/* Progress bar container */
#progress-container {
    font-size: 22px;
    margin: 0 auto;           /* Good: centers it */
    max-width: 250px;         /* Limits the width */
    text-align: center;       /* Ensures label and text are centered */
    margin-bottom: 0rem;
}

.progress-bar {
  background: #eee;
  height: 14px;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  background-color: #4caf50;
}

/* Actual progress bar */
#progress-bar {
    width: 100%;              /* Fills container */
    height: 20px;             /* Good height */
    accent-color: #156785;    /* More modern & widely supported for native styling */
}

/* ============================ */
/* ======= MINIFIG CARDS ====== */
/* ============================ */

#minifigs-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center cards horizontally if max-width is set */
    gap: 15px; /* Space between cards vertically */
    padding: 0px;
    /* Optional: Constrain width of the column */
    max-width: 400px; /* Adjust as desired */
    margin: 0 auto; /* Center the column on the page */
    padding-top: 1rem;
}

/* --- Base Minifigure Card Container --- */
.minifig-card {
    position: relative;
    background-color: #ffffff;
    box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px, rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0, 0, 0.2) 0px -3px 0px inset;
    border-radius: 10px;
    border: 0;
    width: 100%; /* Take full width of the container */
    margin: 0;
    overflow: hidden;
    box-sizing: border-box;
    text-align: left;
    transition: box-shadow 0.3s ease;
	min-height: 150px;
}

.minifig-card:focus-within,
.minifig-card:hover {
    box-shadow: rgba(0, 0, 0, 0.5) 0px 3px 6px, rgba(0, 0, 0, 0.4) 0px 8px 15px -4px, rgba(0, 0, 0, 0.3) 0px -4px 0px inset;
}

/* --- Accordion Styling (<details> & <summary>) --- */
.minifig-card details {
    width: 100%;
}

.minifig-card summary {
    display: flex;
    align-items: center; /* Vertically align image and text block */
    padding: 2.5px;
    background-color: #ffffff;
    cursor: pointer;
    list-style: none;
    position: relative; /* Crucial for absolute positioning of children */
    width: 100%;
    box-sizing: border-box;
    transition: min-height 0.35s ease-in-out, background-color 0.2s ease;
	overflow: hidden;
}

.minifig-card summary::-webkit-details-marker { display: none; }

/* Wrapper for both checkboxes in the top right */
.checkbox-top-right {
    position: absolute;
    padding: 1px;
    top: 0px;
    right: 2px;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    font-size: 0.8rem;
    z-index: 1;
}

/* Label wraps input + text */
.checkbox-label {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px
}

/* Slightly larger checkboxes */
.checkbox-label input[type="checkbox"] {
    transform: scale(1.2);
    cursor: pointer;
}

/* Chevron Bottom-Center */
.minifig-card summary::after {
    content: '›';
    font-size: 1em;
    font-weight: bold;
    color: #555;
    position: absolute;
    bottom: 5px; /* Distance from bottom */
    left: 50%;   /* Center horizontally */
    transform: translateX(-50%) rotate(90deg); /* Pointing down initially */
    transition: transform 0.3s ease-in-out, color 0.2s ease;
    line-height: 1; /* Prevent extra spacing */
}

/* Style the Thumbnail Image (position relative to summary flex) */
.minifig-card summary .minifig-thumb {
    width: auto;  /* Slightly larger image */
    height: 150px;
    object-fit: contain;
    background-color: #ffffff;
    border-radius: 4px;
    margin: 5px; /* Space between image and text block */
    flex-shrink: 0;
    transform-origin: center center;
    transition: transform 0.35s ease-in-out; /* Keep image scale transition */
}

/* Wrapper for Name and ID */
.minifig-card summary .minifig-info {
    display: flex;
    flex-direction: column; /* Stack name and ID */
    justify-content: center;
    align-items: center; /* Center horizontally */
    padding: 0px;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* Style the Minifig Name in Summary */
.minifig-card summary .minifig-name-summary {
    padding: 10px 10px 0px 0px; /* Top, Right, Bottom, Left */
	white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: anywhere;
    text-align: center;
    display: block;
    font-weight: bold;
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    line-height: 0.8;
    color: #333;
    margin-bottom: 10px; /* Add space below the name */
}

/* Style the Minifig ID in Summary */
.minifig-card summary .minifig-id-summary {
    padding: 0px 0px 10px 0px; /* Top, Right, Bottom, Left */
    white-space: normal; /* Allow text to wrap */
    word-wrap: break-word;
    overflow-wrap: anywhere;
    font-size: clamp(1.5rem, 2vw, 1.3rem);
    color: #7fd2f1;
    line-height: 0.8;
    text-align: center;
    display: block;
}

/* --- Style the Details Content Area --- */
.minifig-card details > *:not(summary) {
    padding: 15px; /* Adjust padding if needed */
    border-top: 1px solid #ccc;
    background-color: #fafafa;
    font-size: 1.2rem;
    line-height: 1;
    color: #000000;
}

/* --- Styling for when the Accordion is Open --- */
.minifig-card details[open] summary {
    background-color: #ffffff;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 20px;
    padding-right: 15px;
    padding-left: 15px;
    padding-bottom: 15px;
}

.minifig-card details[open] summary .minifig-thumb {
    width: 100%; /* or larger if you like */
    max-width: 150px;
    height: auto;
    margin-top: 10px;
    margin-bottom: 5px;
    object-fit: contain;
    transform: none;
}

.minifig-card details[open] summary .minifig-info {
    text-align: center;
    width: 90%;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    font-size: clamp(1.2rem, 1.2vw, 1.5rem);
}

/* Rotate Chevron Up when open (Keep as is) */
.minifig-card details[open] summary::after {
    transform: translateX(-50%) rotate(-90deg);
}

/* Paragraphs inside the details block */
.minifig-details-content p {
    margin: 0.5rem 0;                 /* add vertical breathing room */
    font-family: "Coalabeer-5Vlv", sans-serif;
    font-size: 1.2rem;                  /* or clamp(...) if you prefer */
    line-height: 1;
    text-align: left;                 /* change to center if you like */
    color: #000000;
}

/* First paragraph could be bolder / standout */
.minifig-details-content p:first-child {
    font-weight: 600;
}

/* Remove bottom margin on the last paragraph to keep the card tight */
.minifig-details-content p:last-child {
    margin-bottom: 0;
}

.set-list {
    margin: 5px 0 0 0;
    padding-left: 15px;
    list-style-type: disc;
    color: #555;
    text-align: left;
}

.minifig-details-content hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 10px 0;
}

/* ======================== */
/* ===== MEDIA QUERIES ===== */
/* ======================== */

/* Tablet and up */
@media (min-width: var(--breakpoint-tablet)) {
  body {
    font-size: 16px;
    padding: 1.5rem;
  }
  nav {
    flex-direction: row;
    max-width: var(--breakpoint-tablet);
  }
  h1, h2, h3 {
    font-size: 2rem;
  }
  p {
    font-size: 1.2rem;
    line-height: 1.2rem;
  }


/* Laptop and up */
@media (min-width: var(--breakpoint-laptop)) {
  body {
    font-size: 17px;
    padding: 2rem;
  }
  nav {
    max-width: var(--breakpoint-laptop);
  }


/* Desktop and up */
@media (min-width: var(--breakpoint-desktop)) {
  body {
    font-size: 18px;
    padding: 2.5rem;
  }
  nav {
    max-width: var(--breakpoint-desktop);
  }


/* Wide screens and up */
@media (min-width: var(--breakpoint-wide)) {
  body {
    font-size: 19px;
    max-width: var(--breakpoint-wide);
    margin: auto;
    padding: 3rem;
  }
  nav {
    max-width: var(--breakpoint-wide);
  }

/* Mobile-specific overrides below 480px */
@media (max-width: var(--breakpoint-mobile)) {
  #logo {
    max-width: 80%;
  }
  .profile-content,
  .profile-header,
  .profile-info {
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
  }
  
  #theme-selection-form {
    padding: 0.5rem;
  }

  .theme-container label {
    font-size: 0.95rem;
  }
  
  .logout-container {
    top: 5px;
    right: 5px;
  }
  
  #logout-btn {
    font-size: 0.75rem;
    padding: 5px 5px;
    line-height: 1;
    height: auto;
    border: none;
    border-radius: 5px;
    background-color: #dc3545;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  
  #logout-btn:hover {
    background-color: #c82333;
  }
  
  form {
    width: 90%;
  }
  
  .summary-cards {
    flex-direction: column;
  }
  
  .minifig {
    max-width: 100%;
    margin: 5px 0;
  }
  
  .pagination {
    flex-wrap: wrap;
  }
  
  .pagination button {
    padding: 6px 10px;
  }