
/* T3SG Upload UI — Concept 2 (card) */
:root{
  --t3sg-upload-card-bg: #F5F6F7;
  --t3sg-upload-card-border: #E5E7EB;
  --t3sg-upload-progress: #111827;
  --t3sg-upload-progress-bg: #D1D5DB;
}

/* Shared wrapper (guest + logged-in upload tab) */
.t3sg-guest-upload-wrapper,
.t3sg-upload-box{
  border: 0;
}

/* Card */
.t3sg-upload-card{
  background: var(--t3sg-upload-card-bg);
  border: 1px solid var(--t3sg-upload-card-border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.t3sg-upload-card__icon{
  width: 86px;
  height: 86px;
  border-radius: 20px;
  /* No background behind the icon (requested) */
  background: transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.t3sg-upload-card__icon img{
  width: 48px;
  height: 48px;
  object-fit: contain;
  display:block;
}

.t3sg-upload-card__title{
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 700;
}
.t3sg-upload-card__hint{
  margin: 0 0 12px 0;
  font-size: 13px;
  opacity: .85;
}

.t3sg-guest-allowed{
  margin-top: 8px;
  font-size: 13px;
  opacity: 0.85;
}

.t3sg-upload-card__actions{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items:center;
  justify-content: center;
}

.t3sg-upload-file{
  position: relative;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.8);
  cursor: pointer;
  font-weight: 600;
  line-height: 1;
}
.t3sg-upload-file:hover{ filter: brightness(0.98); }
.t3sg-upload-file > input[type=file]{
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}


/* Make the whole card feel interactive */
.t3sg-upload-card{ cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.t3sg-upload-card:hover{ box-shadow: 0 8px 22px rgba(0,0,0,0.08); transform: translateY(-1px); }
.t3sg-upload-card.t3sg-dragover{ box-shadow: 0 10px 26px rgba(0,0,0,0.12); }

/* Visually hide the real file input (theme-proof) */
#t3sg_images.t3sg-upload-card__input,
.t3sg-upload-card__input{
  position: fixed !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

/* Picker button + file name */
.t3sg-upload-card__pick{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.85);
  font-weight: 700;
  cursor: pointer;
}
.t3sg-upload-card__pick:hover{ filter: brightness(0.98); }
.t3sg-upload-card__filecount{
  font-size: 13px;
  opacity: .85;
  min-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Selected files list (before upload) */
.t3sg-upload-card__filelist{
  width: 100%;
  max-width: 720px;
  margin-top: 0;
  margin-bottom: 10px;
  display: none;
  max-height: 320px; /* ~5 items */
  overflow: auto;
  padding-right: 6px;
}
.t3sg-upload-card.t3sg-has-files .t3sg-upload-card__filelist{
  display: block;
}
.t3sg-upload-card__filelist ul{
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.t3sg-upload-card__fileitem{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.80);
}

.t3sg-upload-card__thumb{
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 44px;
  background: rgba(0,0,0,0.06);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.t3sg-upload-card__thumb img,
.t3sg-upload-card__thumb video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.t3sg-upload-card__thumb--video::after{
  content: "▶";
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: rgba(0,0,0,0.75);
  position: absolute;
}
.t3sg-upload-card__fileleft{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.t3sg-upload-card__filename{
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 13px;
}
.t3sg-upload-card__filesize{
  font-size: 12px;
  opacity: 0.7;
  white-space: nowrap;
}
.t3sg-upload-card__remove{
  border: 0;
  background: transparent;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  line-height: 1;
}
.t3sg-upload-card__remove:hover{
  background: rgba(0,0,0,0.06);
}

/* Keep the legacy label style if still present somewhere */
.t3sg-upload-file{ display:none !important; }
/* Buttons (keep native IDs for JS compatibility) */
#t3sg_guest_upload_btn,
#t3sg_upload_btn{
  padding: 10px 14px !important;
  border-radius: 12px !important;
  font-weight: 700 !important;
}

/* Progress bar */
#t3sg-guest-bar-container,
#t3sg-progress-container{
  margin-top: 12px;
  height: 14px;
  background: var(--t3sg-upload-progress-bg);
  border-radius: 999px;
  overflow:hidden;
}
#t3sg-guest-progress-bar,
#t3sg-progress-bar{
  height: 100%;
  width: 0%;
  background: var(--t3sg-upload-progress);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  line-height: 14px;
}

/* Errors + summary spacing */
.t3sg-guest-errors{ margin-top: 10px; }
#t3sg-guest-upload-summary{ margin-top: 12px; }

/* Compact on small screens */
@media (max-width: 520px){
  .t3sg-upload-card{
    gap: 8px;
  }
  .t3sg-upload-card__icon{
    width: 72px; height: 72px;
  }
}

/* Mobile responsiveness */
.t3sg-upload-card,
.t3sg-upload-card *{
  box-sizing: border-box;
}
.t3sg-upload-card{ max-width: 100%; }
.t3sg-upload-card__filelist{ max-width: 100%; }

@media (max-width: 600px){
  .t3sg-upload-card{
    padding: 14px 12px;
    border-radius: 14px;
    gap: 8px;
  }
  .t3sg-upload-card__icon{
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }
  .t3sg-upload-card__icon img{ width: 44px; height: 44px; }

  .t3sg-upload-card__actions{
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
  }
  .t3sg-upload-card__pick{
    width: 100%;
  }
  .t3sg-upload-card__filecount{
    min-width: 0;
    width: 100%;
    white-space: normal;
    text-align: center;
  }
  #t3sg_guest_upload_btn,
  #t3sg_upload_btn{
    width: 100% !important;
  }

  .t3sg-upload-card__filelist{
    max-height: 260px;
    padding-right: 4px;
  }
  .t3sg-upload-card__fileitem{
    padding: 8px 10px;
  }

  /* Mobile: show only thumbnail + remove (no filename/size) to avoid overflow */
  .t3sg-upload-card__filename,
  .t3sg-upload-card__filesize{
    display: none !important;
  }
  .t3sg-upload-card__fileleft{
    flex: 1;
  }
  .t3sg-upload-card__fileitem{
    justify-content: space-between;
  }
}


/* Detailed upload progress (MB sent / total MB) */
.t3sg-upload-progress-detail{
  width: 100%;
  margin-top: 14px;
  margin-bottom: 6px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: #111827;
}
.t3sg-upload-progress-detail[hidden],
#t3sg-guest-bar-container[hidden]{
  display: none !important;
}
.t3sg-upload-card__body{
  width: 100%;
}
#t3sg-guest-bar-container{
  width: 100% !important;
}
