/* Base reset */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: sans-serif;
  background: #f0f0f0;
  padding: 20px;
  overflow-y: scroll;
}

.container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}
#cardContainer {
  max-width: 1000px;
  margin: 0 auto;
}

.card {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  width: 300px;
  cursor: pointer;
  overflow: hidden;
  transition: 0.3s;
  background: var(--main-middark);
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;

}

.card canvas {
  width: 100% !important;
  height: 280px !important;
  display: block;
}

.card:hover canvas {
    scale: 1.1;
    transition: 0.3s;
}

canvas {
    transition: 0.3s;
}
.card-content {
  padding: 20px;
  text-align: center;
  background: var(--main-middark);
      position: relative;
          height: 100%;
              display: flex
;
    flex-direction: column;
    justify-content: center;
}

.card-title {
  font-size: 18px;
  font-weight: bold;
}

.overlay {
  position: fixed;
  inset: 0;
  background: #0000009a;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(9px);
}

.overlay.active {
  display: flex;
}

.overlay-content {
  background: white;
  border-radius: 10px;
  max-width: 95vw;
  max-height: 95vh;
  width: 900px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
}

#pdfContainer {
  overflow-y: auto;
  overflow-x: auto;
  height: 100%;
  position: relative;
  background:#292929;
      padding-bottom: 190px;
}



.pdf-canvas {
  display: block;
  margin: 10px auto;
  box-shadow: 0 0 8px rgba(0,0,0,0.2);
  user-select: none;
  border-radius: 8px;
}

.close-btn {
  position: absolute;
    top: 10px;
    right: 10px;
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    z-index: 10;
    background: #ffffff70;
    border-radius: 999px;
    width: 30px;
    height: 30px;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
}

.caption-overlay {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: rgba(40,40,40,0.75);
  color: white;
  border-radius: 10px;
  padding: 16px;
  overflow: hidden;
  z-index: 15;
  transition: max-height 0.3s ease, padding 0.3s ease;
  backdrop-filter: blur(3px);
  text-align: start ;
  padding-bottom:40px;
}

.caption-overlay.collapsed {
  padding-bottom: 40px;
}

.caption-overlay.show-all {
  max-height: 70vh;
  overflow-y: auto;
}

.caption-overlay h2,
.caption-overlay p {
  margin-bottom: 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: all 0.3s ease;
}

.caption-overlay.show-all h2,
.caption-overlay.show-all p {
  -webkit-line-clamp: unset;
  overflow: visible;
  display: block;
}

.caption-toggle {
  display: inline-block;
  background: rgba(255,255,255,0.8);
  color: #111;
  border: none;
  border-radius: 5px;
  padding: 6px 14px;
  font-weight: bold;
  margin-top: 8px;
  cursor: pointer;
}

.buttons-row {
  position: absolute;
  bottom: 30px;
  right: 30px;
  display: flex;
  gap: 10px;
  z-index: 20;
}

.btn {
  background: rgba(255,255,255,0.8);
  border: none;
  border-radius: 5px;
  padding: 6px 14px;
  font-weight: bold;
  cursor: pointer;
}

#pdfContainer::-webkit-scrollbar {
  width: 8px;
}

#pdfContainer::-webkit-scrollbar-thumb {
  background-color: #4d5156;
  border-radius: 100px;
}

#pdfContainer::-webkit-scrollbar-track {
  background-color: transparent;
  border-radius: 110px;
}

.caption-overlay.show-all::-webkit-scrollbar-thumb {
  background-color: #888;
}

.used-font-cards-container {
    display: flex;
    flex-wrap: wrap; /* Allows cards to wrap to the next line */
    gap: 10px; /* Space between cards */
    margin-top: 10px;
    margin-bottom: 20px; /* Add some space below the font section */
}

.used-font-card {
    background-color: #00000047; /* Light background for the card */
    border: 1px solid #e9ecef; /* Subtle border */
    border-radius: 5px; /* Slightly rounded corners */
    padding: 10px 15px; /* Inner spacing */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* Soft shadow */
    font-size: 0.9em; /* Slightly smaller text */
    display: flex;
    flex-direction: column; /* Stack name and style vertically */
    gap: 5px; /* Space between name and style */
}

.used-font-card .used-font-name {
    font-weight: bold; /* Make the font name stand out */
    color: #343a40; /* Darker text color */
}

.used-font-card .used-font-name a {
    color: #fff;
}

.used-font-card .used-font-style {
    color: #ffffff9c; /* Slightly lighter color for the style */
}



.caption-overlay #zipContainer {
  border: 1px solid #ffffff;
  border-radius: 10px;
  padding: 10px;

  max-height: 500px; /* Ensure this is large enough for all content */
  overflow: hidden;

  /*
   * TRANSITION FOR EXPANDING:
   * A bit faster (0.5s).
   * max-height and padding transition with an 'ease-in-out' for smoother start/end.
   * Opacity transitions over 0.3s with 'ease-in-out', starting immediately.
   * Visibility becomes visible immediately.
   */
  transition:
    max-height 0.5s ease-in-out,
    padding 0.5s ease-in-out,
    opacity 0.3s ease-in-out, /* Content fades in quickly */
    visibility 0s 0s; /* Visibility becomes visible immediately */

  opacity: 1; /* Fully visible when expanded */
  visibility: visible;
}

.caption-overlay.collapsed #zipContainer {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;

  /*
   * TRANSITION FOR COLLAPSING:
   * max-height and padding transition with 'ease-in-out' over 0.5s.
   * Opacity transitions very quickly to 0 (0.2s) with 'ease-out'.
   * Visibility becomes hidden *after* the max-height transition finishes (0.5s delay).
   */
  transition:
    max-height 0.5s ease-in-out,
    padding 0.5s ease-in-out,
    opacity 0.2s ease-out, /* Content fades out very quickly */
    visibility 0s 0.5s;   /* Visibility becomes hidden after 0.5s (max-height finishes) */

  opacity: 0; /* Fully transparent when collapsed */
  visibility: hidden;
}

#zipContainer a {
    color: #fff;
    word-break: break-all;
}

.zip-folder {
  
}
.zip-items {
    column-count: 2;
}

.zip-item {
  cursor: pointer;
  padding: 5px 5px;
}

.zip-children .zip-item {
    margin-left: 5px;
}

.zip-item:hover {
  background-color: #ffffff34;
  border-radius: 5px;
  
}

.zip-item.folder {
  font-weight: bold;
  color: #ffd700;
}

.zip-item.file a {
  color: #eee;
  text-decoration: none;
}

.zip-children {
  margin-left: 10px;
  border-inline-start: 2px solid #ffffff40;
}




@media screen and (max-width: 768px) {
  .zip-items {
    column-count: 1;
}
  
}