/* Etsy-style Media Grid */
.attachments[data-type="photos"] ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  padding: 0;
  list-style: none;
}

.attachments[data-type="photos"] ul li.add {
  border: 2px dashed #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  height: 100px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

/* Creator Badge Styling */
.creator-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  color: white;
  font-size: 12px;
  margin-left: 8px;
  vertical-align: middle;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.creator-badge:hover {
  transform: scale(1.1);
}

/* Product Limit Progress Bar */
.product-limit-progress {
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  height: 8px;
  margin-top: 8px;
}

.product-limit-progress-bar {
  background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
  height: 100%;
  transition: width 0.3s ease;
}

.product-limit-progress-bar.warning {
  background: linear-gradient(90deg, #ffc107 0%, #fd7e14 100%);
}

.product-limit-progress-bar.danger {
  background: linear-gradient(90deg, #dc3545 0%, #e83e8c 100%);
}

.attachments[data-type="photos"] ul li.add:hover {
  border-color: #007bff;
  background-color: #f8f9fa;
}

/* Make the uploader form cover the entire tile */
.attachments[data-type="photos"] ul li.add .x-uploader,
.attachments[data-type="photos"] ul li.add .x-uploader input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 5;
}

.attachments[data-type="photos"] ul li.add .x-uploader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachments[data-type="photos"] ul li.add .x-uploader input[type="file"] {
    opacity: 0;
    z-index: 6;
}

.attachments[data-type="photos"] ul li.item {
  position: relative;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eee;
}

.attachments[data-type="photos"] ul li.item .img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.attachments[data-type="photos"] ul li.item .btn-close {
  position: absolute;
  top: 5px;
  right: 5px;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 5px;
  border-radius: 50%;
  font-size: 10px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.attachments[data-type="photos"] ul li.item:hover .btn-close {
  opacity: 1;
}

/* Video specific */
.attachments[data-type="video"] ul {
    list-style: none;
    padding: 0;
}
.attachments[data-type="video"] ul li.add {
    width: 100px;
    height: 100px;
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
}
.attachments[data-type="video"] ul li.item {
    width: 100px;
    height: 100px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}
.attachments[data-type="video"] ul li.item .img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #000;
}

/* Video Uploader Click Fix */
.attachments[data-type="video"] ul li.add .x-uploader,
.attachments[data-type="video"] ul li.add .x-uploader input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 5;
}
.attachments[data-type="video"] ul li.add .x-uploader {
    display: flex;
    align-items: center;
    justify-content: center;
}
.attachments[data-type="video"] ul li.add .x-uploader input[type="file"] {
    opacity: 0;
    z-index: 6;
}

/* Fix x-image file input overlay */
.x-image {
    position: relative;
    overflow: hidden;
}

.x-image .js_x-image-file {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2; /* Ensure it's above other elements */
}

.x-image .btn-close {
    z-index: 3; /* Ensure delete button is above input */
}

/* File Uploader Styles */
.attachments[data-type="file"] ul {
    list-style: none;
    padding: 0;
}
.attachments[data-type="file"] ul li.add { /* Same as video/photos for now */
    width: 100px;
    height: 100px;
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 8px;
    position: relative;
    background-color: #f8f9fa;
}
/* Ensure clickability of file uploader */
.attachments[data-type="file"] ul li.add .x-uploader,
.attachments[data-type="file"] ul li.add .x-uploader input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 5;
}
.attachments[data-type="file"] ul li.add .x-uploader {
    display: flex;
    align-items: center;
    justify-content: center;
}
.attachments[data-type="file"] ul li.add .x-uploader input[type="file"] {
    opacity: 0;
    z-index: 6;
}

.attachments[data-type="file"] ul li.item {
    width: 100px;
    height: 100px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    background-color: #fff;
}
.attachments[data-type="file"] ul li.item .img {
    width: 100%;
    height: 100%;
    background-size: contain; /* Different for file icons */
    background-repeat: no-repeat;
    background-position: center;
}
.attachments[data-type="file"] ul li.item .name {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 10px;
    padding: 2px;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Product Media Slider */
.product-media-wrapper {
  overflow: hidden;
}
.product-media-slider .product-media-item {
  position: relative;
  text-align: center;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  height: 400px;
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.product-media-slider .product-media-item img,
.product-media-slider .product-media-item video {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.product-media-slider .slick-arrow {
  z-index: 10;
  width: 30px;
  height: 30px;
  border-radius: 50%;
}
.product-media-slider .slick-prev {
  left: 10px;
}
.product-media-slider .slick-next {
  right: 10px;
}

/* Product Media Nav */
.product-media-nav {
  margin-top: 10px;
  margin-left: -5px;
  margin-right: -5px;
}
.product-media-nav .media-nav-item {
  padding: 0 5px;
  cursor: pointer;
  height: 140px;
  position: relative;
  outline: none;
}
.product-media-nav .media-nav-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.product-media-nav .slick-current .media-nav-item img {
  border-color: #0d6efd;
}
.product-media-nav .media-nav-item.video-thumb {
  background: #000;
  color: #fff;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 2px solid transparent;
}
.product-media-nav .slick-current .media-nav-item.video-thumb {
  border-color: #0d6efd;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .product-media-slider .product-media-item {
    height: 300px;
  }
}
/* Module Lock Overlay (Skool Style) */
.module-card {
    transition: transform 0.2s ease;
}

.module-card:hover {
    transform: translateY(-5px);
}

.module-img-container {
    position: relative;
    overflow: hidden;
}

.module-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 10;
    text-align: center;
    padding: 15px;
    transition: background 0.3s ease;
}

.module-lock-overlay:hover {
    background: rgba(0, 0, 0, 0.5);
}

.module-lock-overlay .lock-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.module-lock-overlay .lock-text {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    text-transform: capitalize;
}

.module-lock-overlay .btn-lock-action {
    background-color: var(--bs-primary);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.module-lock-overlay .btn-lock-action:hover {
    transform: scale(1.05);
    background-color: var(--bs-primary-dark, #0056b3);
    color: white;
}

.module-img-blurred {
    filter: blur(5px);
    transform: scale(1.1); /* Prevent white edges from blur */
}

.module-lock-private {
    background: linear-gradient(180deg, rgba(13, 80, 75, 0.8) 0%, rgba(13, 80, 75, 0.9) 100%);
}
