/* Minatrix.FM — photo albums and uploader */
.photo-uploader,
.album-grid,
.photo-gallery,
.photo-pages {
  --album-accent: var(--brand, #ff7818);
  --album-accent-2: var(--accent, #ff5a00);
  --album-surface: var(--bg-elev, #171a21);
  --album-surface-soft: var(--bg, #0b0e14);
  --album-text: var(--text, #fff);
  --album-muted: var(--muted, #9da5c0);
  --album-border: var(--border, #2b3444);
  --album-shadow: 0 14px 34px rgb(0 0 0 / .18);
}

.album-toolbar {
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}
.album-toolbar > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.album-toolbar__name { color: var(--muted); }
.album-save-ok {
  padding: 11px 14px;
  margin: 0 0 14px;
  border: 1px solid var(--ok-bd, rgb(47 170 90 / .35));
  border-radius: 12px;
  background: var(--ok-bg, rgb(47 170 90 / .13));
  color: var(--ok-fg, #55ce83);
  font-size: 13px;
  font-weight: 750;
}

/* Upload shell */
#formuplphoto.photo-uploader {
  display: none;
  position: relative;
  margin: 16px 0 24px;
  padding: clamp(12px, 2vw, 20px);
  overflow: hidden;
  border: 1px solid var(--album-border);
  border-radius: 18px;
  background:
    radial-gradient(600px 220px at 100% -80px, rgb(255 120 24 / .15), transparent 62%),
    linear-gradient(180deg, rgb(255 255 255 / .025), transparent 45%),
    var(--album-surface);
  box-shadow: var(--album-shadow), inset 0 1px 0 rgb(255 255 255 / .035);
}
#IdAlbum { display: none !important; }

#formuplphoto .photo-drop {
  position: relative;
  min-height: clamp(160px, 24vw, 230px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--album-border);
  border-color: color-mix(in srgb, var(--album-accent) 48%, var(--album-border));
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 20%, rgb(255 120 24 / .11), transparent 45%),
    linear-gradient(145deg, rgb(255 255 255 / .025), transparent 58%),
    var(--album-surface-soft);
  color: var(--album-text);
  text-align: center;
  transition: border-color .2s ease, transform .2s ease, background .2s ease, box-shadow .2s ease;
}
#formuplphoto .photo-drop::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .28;
  background-image: radial-gradient(circle, currentColor 1px, transparent 1.5px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
}
#formuplphoto .photo-drop:hover,
#formuplphoto .photo-drop.is-dragover {
  border-color: var(--album-accent);
  background:
    radial-gradient(circle at 50% 15%, rgb(255 120 24 / .19), transparent 48%),
    var(--album-surface-soft);
  box-shadow: inset 0 0 0 1px rgb(255 120 24 / .12), 0 12px 26px rgb(0 0 0 / .13);
  transform: translateY(-1px);
}
#formuplphoto .photo-drop.is-uploading {
  pointer-events: none;
  opacity: .68;
  transform: none;
}
#formuplphoto .photo-drop__content {
  position: relative;
  z-index: 1;
  width: min(100%, 620px);
  padding: clamp(20px, 4vw, 38px) 16px;
}
#formuplphoto .photo-drop__icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 13px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 120 24 / .28);
  border-radius: 18px;
  background: linear-gradient(135deg, rgb(255 138 31 / .18), rgb(255 90 0 / .08));
  color: var(--album-accent);
  font-size: 0 !important;
  box-shadow: 0 12px 26px rgb(255 90 0 / .12);
}
#formuplphoto .photo-drop__icon::before {
  content: "";
  width: 27px;
  height: 27px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2V5c0-1.1-.9-2-2-2Zm0 16H5V5h14v14ZM8.5 11.5l2.5 3.01L14.5 10l4.5 6H6l2.5-4.5Z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M19 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2V5c0-1.1-.9-2-2-2Zm0 16H5V5h14v14ZM8.5 11.5l2.5 3.01L14.5 10l4.5 6H6l2.5-4.5Z'/%3E%3C/svg%3E") center/contain no-repeat;
}
#formuplphoto .photo-drop__title {
  margin: 0 0 6px;
  padding: 0;
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.3;
  font-weight: 900;
  letter-spacing: -.01em;
}
#formuplphoto .photo-drop__hint {
  max-width: 520px;
  margin: 0 auto 16px;
  padding: 0;
  color: var(--album-muted);
  font-size: 12px;
  line-height: 1.55;
}
#formuplphoto .photo-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
}
#formuplphoto label.pill {
  min-height: 40px;
  padding: 0 17px;
  border-radius: 11px;
  color: #241200;
  font-size: 13px;
  line-height: 1;
  box-shadow: 0 9px 22px rgb(255 90 0 / .22);
}

/* Local queue */
#formuplphoto #uploaded-holder {
  display: none;
  position: relative;
  margin: 14px 0 0;
}
#formuplphoto #dropped-files.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 11px;
  width: 100%;
  margin: 0;
}
#formuplphoto .photo-preview {
  position: relative;
  min-width: 0;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--album-border);
  border-radius: 13px;
  background: var(--album-surface-soft);
  box-shadow: 0 8px 20px rgb(0 0 0 / .14);
  isolation: isolate;
}
#formuplphoto .photo-preview::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 48%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(transparent, rgb(0 0 0 / .78));
}
#formuplphoto .photo-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .22s ease, filter .22s ease;
}
#formuplphoto .photo-preview:hover img { transform: scale(1.035); filter: brightness(1.04); }
#formuplphoto .photo-preview__meta {
  position: absolute;
  left: 9px;
  right: 42px;
  bottom: 8px;
  z-index: 2;
  color: #fff;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgb(0 0 0 / .8);
}
#formuplphoto .photo-preview__remove,
#formuplphoto .photo-result__delete {
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / .16);
  border-radius: 50%;
  background: rgb(7 9 13 / .78);
  color: #fff;
  font: 700 0/1 Arial, sans-serif !important;
  cursor: pointer;
  backdrop-filter: blur(7px);
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
#formuplphoto .photo-preview__remove::before,
#formuplphoto .photo-result__delete::before {
  content: "";
  width: 13px;
  height: 13px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18.3 5.71 12 12l6.3 6.29-1.41 1.42L10.59 13.4l-6.3 6.31-1.42-1.42L9.17 12l-6.3-6.29 1.42-1.42 6.3 6.31 6.3-6.31 1.41 1.42Z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M18.3 5.71 12 12l6.3 6.29-1.41 1.42L10.59 13.4l-6.3 6.31-1.42-1.42L9.17 12l-6.3-6.29 1.42-1.42 6.3 6.31 6.3-6.31 1.41 1.42Z'/%3E%3C/svg%3E") center/contain no-repeat;
}
#formuplphoto .photo-preview__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
}
#formuplphoto .photo-preview__remove:hover,
#formuplphoto .photo-result__delete:hover {
  border-color: rgb(255 255 255 / .3);
  background: #d92c2c;
  transform: scale(1.06);
}

#formuplphoto #upload-button.photo-upload-actions {
  display: none;
  min-height: 56px;
  margin: 12px 0 0;
  padding: 9px 10px 9px 13px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid var(--album-border);
  border-radius: 13px;
  background: linear-gradient(180deg, rgb(255 255 255 / .025), transparent), var(--album-surface-soft);
}
#formuplphoto .photo-upload-count {
  color: var(--album-muted);
  font-size: 12px;
  font-weight: 800;
}
#formuplphoto .photo-upload-actions__buttons { display: flex; gap: 8px; flex-wrap: wrap; }
#formuplphoto #upload-button button {
  min-height: 36px;
  padding: 0 13px;
  font-size: 12px;
  line-height: 1;
}
#formuplphoto #upload-button button:disabled { opacity: .55; cursor: wait; transform: none; }

/* Progress */
#formuplphoto #loading.photo-progress {
  display: none;
  width: 100%;
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid var(--album-border);
  border-radius: 13px;
  background: var(--album-surface-soft);
}
#formuplphoto #loading-bar.photo-progress__track {
  width: 100%;
  height: 8px;
  padding: 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(128 128 128 / .22);
  box-shadow: inset 0 1px 3px rgb(0 0 0 / .28);
}
#formuplphoto .loading-color.photo-progress__bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--album-accent-2), var(--album-accent), #ffc14b);
  box-shadow: 0 0 16px rgb(255 120 24 / .38);
  transition: width .2s ease;
}
#formuplphoto #loading-content.photo-progress__text {
  position: static;
  width: auto;
  margin: 8px 0 0;
  color: var(--album-muted);
  font-size: 11px;
  line-height: 1.45;
  font-weight: 700;
  text-align: left;
  overflow-wrap: anywhere;
}

/* Successfully uploaded items */
#formuplphoto #file-name-holder {
  float: none;
  width: 100%;
  margin: 14px 0 0;
}
#formuplphoto #uploaded-files.photo-uploaded-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin: 0;
  padding: 0;
}
#formuplphoto .photo-result {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 10px;
  overflow: hidden;
  border: 1px solid var(--album-border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgb(255 255 255 / .025), transparent), var(--album-surface-soft);
  box-shadow: 0 8px 22px rgb(0 0 0 / .10);
}
#formuplphoto .photo-result > img {
  width: 112px;
  height: 112px;
  display: block;
  object-fit: cover;
  border-radius: 10px;
  background: #111;
}
#formuplphoto .photo-result > div { min-width: 0; }
#formuplphoto .photo-result__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  margin: 0 0 8px;
}
#formuplphoto .photo-result__head strong {
  min-width: 0;
  color: var(--album-text);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#formuplphoto .photo-result__delete { position: static; flex: 0 0 30px; }
#formuplphoto .photo-result textarea.input {
  width: 100%;
  min-height: 70px;
  max-height: 150px;
  margin: 0;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid var(--album-border);
  border-radius: 9px;
  background: var(--album-surface);
  color: var(--album-text);
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
  outline: none;
}
#formuplphoto .photo-result textarea.input:focus {
  border-color: rgb(255 120 24 / .62);
  box-shadow: 0 0 0 3px rgb(255 120 24 / .10);
}
#formuplphoto #sb.album-save-row {
  display: none;
  margin: 12px 0 0;
  text-align: right;
}

/* Albums */
#albumlist.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 12px 0 20px;
}
#albumlist .album-card {
  position: relative;
  display: block;
  min-width: 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--album-border);
  border-radius: 15px;
  background: var(--album-surface-soft);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 24px rgb(0 0 0 / .14), inset 0 1px 0 rgb(255 255 255 / .04);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
#albumlist .album-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .025);
}
#albumlist .album-card:hover {
  transform: translateY(-3px);
  border-color: rgb(255 120 24 / .44);
  box-shadow: 0 16px 34px rgb(0 0 0 / .20), 0 0 22px rgb(255 90 0 / .07);
}
#albumlist .album-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .3s ease, filter .3s ease;
}
#albumlist .album-card:hover img { transform: scale(1.045); filter: brightness(1.06); }
#albumlist .album-card__name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 42px 13px 12px;
  background: linear-gradient(transparent, rgb(0 0 0 / .88));
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 4px rgb(0 0 0 / .9);
}

/* Mini photo grid */
#gallery.photo-gallery,
.gallerys.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 9px;
  margin: 12px 0 18px;
}
#gallery .photo-gallery__item {
  position: relative;
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--album-border);
  border-radius: 11px;
  background: var(--album-surface-soft);
  cursor: zoom-in;
  box-shadow: 0 7px 18px rgb(0 0 0 / .12);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
#gallery .photo-gallery__item:hover {
  transform: translateY(-2px);
  border-color: rgb(255 120 24 / .44);
  box-shadow: 0 12px 24px rgb(0 0 0 / .19), 0 0 16px rgb(255 90 0 / .06);
}
#gallery .photo-gallery__item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .24s ease, filter .24s ease;
}
#gallery .photo-gallery__item:hover img { transform: scale(1.05); filter: brightness(1.06); }
#gallery .photo-gallery__empty { grid-column: 1 / -1; }

.photo-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 17px 0;
}
.photo-pages a,
.photo-pages__current {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--album-border);
  border-radius: 9px;
  background: var(--album-surface);
  color: var(--album-text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
}
.photo-pages a:hover { border-color: rgb(255 120 24 / .48); color: var(--album-accent); }
.photo-pages__current {
  border-color: transparent;
  background: linear-gradient(135deg, var(--album-accent-2), var(--album-accent));
  color: #241200;
  box-shadow: 0 6px 16px rgb(255 90 0 / .22);
}
.photo-pages__dots { color: var(--album-muted); padding: 0 3px; }

@media (max-width: 980px) {
  #formuplphoto #uploaded-files.photo-uploaded-grid { grid-template-columns: 1fr; }
  #gallery.photo-gallery,
  .gallerys.photo-gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  #formuplphoto.photo-uploader { margin-left: -2px; margin-right: -2px; border-radius: 14px; }
  #formuplphoto #dropped-files.photo-preview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  #formuplphoto .photo-upload-actions { align-items: stretch; }
  #formuplphoto .photo-upload-count { width: 100%; }
  #formuplphoto .photo-upload-actions__buttons { width: 100%; }
  #formuplphoto .photo-upload-actions__buttons button { flex: 1 1 0; }
  #albumlist.album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  #gallery.photo-gallery,
  .gallerys.photo-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
}
@media (max-width: 460px) {
  #formuplphoto .photo-drop { min-height: 155px; border-radius: 13px; }
  #formuplphoto .photo-drop__content { padding: 20px 10px; }
  #formuplphoto .photo-drop__icon { width: 50px; height: 50px; border-radius: 15px; }
  #formuplphoto #dropped-files.photo-preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  #formuplphoto .photo-result { grid-template-columns: 82px minmax(0, 1fr); gap: 9px; padding: 8px; }
  #formuplphoto .photo-result > img { width: 82px; height: 82px; }
  #formuplphoto .photo-result textarea.input { min-height: 52px; }
  #albumlist .album-card__name { padding: 32px 9px 9px; font-size: 11px; }
  #gallery.photo-gallery,
  .gallerys.photo-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  #gallery .photo-gallery__item { border-radius: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  #formuplphoto *, #albumlist *, #gallery * { transition: none !important; }
}
