/**
 * photosDesign.css
 */

:root {
  --thumb: 100px;
  --gap: 10px;
}

.photosContainer {
  max-width: 1000px;
  margin: auto;
  padding: 20px;
  background: #fff;
}

#photosUploadForm select {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 200px;
  flex: 1;
  background: #fff;
}


.privacyBadge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.25;
  padding: 4px 10px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  color: #1f2e34;
  background: #f4ecd8;
  user-select: none;
}
.privacyOnlyMe     { background: #f4ecd8; }
.privacyFamily     { background: #f4ecd8; }
.privacyConnections { background: #f4ecd8; }
.privacyPublic     { background: #f4ecd8; }


.privacyEditorSelect {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
}


form#photosUploadForm {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 15px;
}
#photosUploadForm input[type="file"], #photosUploadForm input[type="text"] {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  flex: 1;
  min-width: 200px;
}
.photosTagsContentEditable,
#photosUploadForm .photosTagsContentEditable {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  flex: 1;
  min-width: 200px;
  min-height: 38px;
  font-family: inherit;
  font-size: 14px;
  color: #2c3e50;
  background: #fff;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
}
.photosTagsContentEditable[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: #888;
}
.photosTagsContentEditable .socialTag {
  background: #f5f2eb;
  padding: 1px 6px;
  border-radius: 6px;
  color: #2c3e50;
}
#photosUploadForm input[type="text"]:focus,
#photosUploadForm input[type="file"]:focus,
#photosUploadForm .photosTagsContentEditable:focus,
#photosUploadForm select:focus {
  background: #fff;
  outline: none;
  border-color: #4a8bb5;
}

#photosUploadForm input[type="file"] {
  appearance: none;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s ease;
}
#photosUploadForm input[type="file"]::file-selector-button {
  background: #4a8bb5;
  color: #ffffff;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  margin-right: 10px;
  cursor: pointer;
  font-weight: 500;
}
#photosUploadForm input[type="file"]:hover::file-selector-button {
  background: #1f485a;
}
#photosUploadForm input[type="file"]:disabled {
  background: #eee;
  cursor: not-allowed;
  opacity: 0.6;
}

.photosDropArea {
  width: 100%;
  padding: 20px;
  border: 2px dashed #bbb;
  text-align: center;
  margin-bottom: 20px;
  border-radius: 8px;
  color: #777;
}
.photosDropArea.dragover {
  background-color: #e6f7ff;
  border-color: #007bff;
}

.photosFilterBar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.photosFilterBar input, .photosFilterBar select, .photosFilterBar .photosFilterTagsContentEditable {
  padding: 8px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
  flex: 1;
  min-width: 200px;
}

.photosPreviewGrid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}
.photosPreviewGrid:empty {
  display: none;
}
.photosPreviewItem {
  position: relative;
  width: var(--thumb);
  height: var(--thumb);
  border: 1px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
  background: #f9f9f9;
  filter: grayscale(100%) brightness(0.7);
}
.photosPreviewItem img, .photosPreviewItem video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photosProgressBar {
  position: absolute;
  bottom: 20px;
  left: 0;
  height: 5px;
  background: #4a8bb5;
  width: 0%;
}
.photosPreviewSize {
  position: absolute;
  bottom: 5px;
  width: 100%;
  text-align: center;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.7);
}
.photosControls {
  position: absolute;
  top: 5px;
  right: 5px;
  display: flex;
  gap: 4px;
}
.photosButton {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #ddd;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 4px;
}
.photosPreviewItem.uploaded {
  filter: none;
  border-color: #28a745;
}
.photosPreviewItem.failed {
  border-color: red;
}
.photosStatus {
  font-size: 11px;
  color: #666;
  margin-top: 2px;
  min-height: 1em;
}

.photosAlbums {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.photosAlbumPager {
  margin-top: 8px;
}

.photosAlbumGroup {
  border-top: 1px solid #eee;
  padding-top: 16px;
}
.photosAlbumTitle {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8f9fa;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 10px;
  cursor: default;
  text-align: left;
}
.photosAlbumTopRow {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.photosAlbumTitleRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.photosAlbumNameWrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.photosAlbumNameBlock {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.photosAlbumCounts {
  font-size: 12px;
  opacity: 0.8;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.photosAlbumActionsRow {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.photosAlbumMetaRow {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.photosAlbumPrivacyRow {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-left: auto;
}
@media (min-width: 769px) {
  .photosAlbumTitleRow .photosToggleIconMobile {
    display: none;
  }
  .photosAlbumTitleRow .photosToggleIconDesktop {
    display: inline-block;
  }
}
@media (max-width: 768px) {
  
  .photosAlbumTitleRow .photosToggleIconMobile { display: inline-block; margin-left: auto; }
  .photosAlbumTitleRow .photosToggleIconDesktop { display: none; }

  
  .photosAlbumTopRow {
    gap: 8px;
  }
  .photosAlbumTitleRow {
    display: contents;
  }
  .photosAlbumNameWrap {
    order: 1;
    width: 100%;
  }
  .photosAlbumMetaRow {
    order: 2;
    width: 100%;
  }
  .photosAlbumActionsRow {
    order: 3;
    width: 100%;
    justify-content: flex-end;
    padding-top: 6px;
  }
}
.photosAlbumName.editing {
  outline: 2px solid #007bff;
  border-radius: 4px;
  padding: 0 4px;
  background: #fff;
}
.photosAlbumName.photosAlbumNameUploading {
  cursor: default;
  opacity: 0.85;
}
.photosAlbumName.saving {
  opacity: 0.7;
}
.photosAlbumBody {
  display: none;
}
.photosAlbumUploadProgressWrap {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  height: 6px;
  background: #e9ecef;
  border-radius: 999px;
  overflow: hidden;
}
.photosAlbumUploadProgressBar {
  height: 100%;
  width: 0%;
  background: #4a8bb5;
  border-radius: 999px;
  transition: width 0.2s ease;
}
.photosAlbumActions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.photosToggleIcon {
  user-select: none;
}
.photosAlbumTitleCollapsed .photosToggleIcon i {
  display: inline-block;
  transform: rotate(-90deg);
}

.photosAlbumTags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  min-height: 28px;
  align-items: center;
  min-width: 0;
  justify-content: flex-start;
}
.photosAlbumTags.photosAlbumTagsEditing {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 480px;
}
@media (max-width: 768px) {
  .photosAlbumTags.photosAlbumTagsEditing {
    max-width: 120px;
  }
}
.tagChip {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #dee2e6;
  background: #fff;
  cursor: pointer;
}
.tagChip:hover {
  background: #f1f3f5;
}
.tagChip:focus {
  outline: 2px solid #007bff;
}
.tagChip .socialTag {
  display: inline;
  padding: 0.2em 0.5em;
  margin: 0;
  color: #4a8bb5;
  font-weight: 600;
  font-size: inherit;
  background: #f5f2eb;
  border-radius: 4px;
  cursor: pointer;
}
.tagChip .socialTag:hover {
  background: #ebe6dc;
}

.photosAlbumGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--thumb), 1fr));
  gap: var(--gap);
}
.photosAlbumItem {
  width: 100%;
  height: var(--thumb);
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
}
.photosAlbumItem:hover {
  transform: scale(1.02);
}

.photosPager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 0 0;
}
.photosPager button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #fff;
  cursor: pointer;
}
.photosPager button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.photosPageLabel {
  font-size: 13px;
  color: #555;
}

.photosSlideshowModal {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  z-index: 2147483647;
  isolation: isolate;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  box-sizing: border-box;
}
.photosSlideshowOpen {
  overflow: hidden;
}
.photosSlideshowModal img,
.photosSlideshowModal video {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  z-index: 1;
  object-fit: contain;
}
#photosCloseSlideshow {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  right: max(30px, env(safe-area-inset-right));
  font-size: 40px;
  color: #fff;
  cursor: pointer;
  z-index: 3;
}

.photosLightboxArrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border: none;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: manipulation;
  z-index: 2;
}
.photosLightboxArrow:hover {
  background: rgba(0, 0, 0, 0.5);
}
.photosLightboxPrev {
  left: 16px;
}
.photosLightboxNext {
  right: 16px;
}
.albumTagsPill {
  display: inline-block;
  max-width: 600px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.albumTagsPill.editing {
  outline: 2px solid #007bff;
  background: #fff;
  min-width: 120px;
  width: auto;
  max-width: 600px;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}
.albumTagsPill.saving {
  opacity: 0.7;
}
.albumTagsPill .socialTag {
  background: #f5f2eb;
  padding: 1px 6px;
  border-radius: 6px;
  color: #2c3e50;
}

.photoCard {
  position: relative;
}
.photoOverlay {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 6px;
}
.photoBtn {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #ddd;
  padding: 4px 6px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
}
.photoBtnDanger {
  border-color: #ffb3b3;
}
.photoEdit,
.photoTag,
.photoBin {
  width: 30px;
  height: 30px;
  padding: 0;              
  border: none;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;  
}

.photoEdit { background-image: url("../images/Photos/edit.png"); }
.photoTag  { background-image: url("../images/Photos/tag.png"); }
.photoBin  { background-image: url("../images/Photos/bin.png"); }


.photosAlbumActions .socialFeedItemIconButton {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  color: #5a6578;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.photosAlbumActions .socialFeedItemIconButton i {
  font-size: 14px;
}
.photosAlbumActions .socialFeedItemIconButton:hover {
  background: rgba(74, 139, 181, 0.08);
  color: #4a8bb5;
}
.photosAlbumActions .photosDeleteAlbum.socialFeedItemIconButton:hover {
  color: #b91c1c;
}
.photoOverlay .socialFeedItemIconButton {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.95);
  color: #5a6578;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.photoOverlay .socialFeedItemIconButton:hover {
  color: #b91c1c;
}
.photoOverlay .socialFeedItemIconButton i {
  font-size: 14px;
}


@media (min-width: 480px) {
  :root {
    --thumb: 110px;
  }
}
@media (min-width: 768px) {
  :root {
    --thumb: 120px;
  }
}
@media screen and (max-width: 767px) {
  .photosContainer {
    padding: 12px;
    margin: 0;
  }
  form#photosUploadForm {
    flex-direction: column;
    gap: 10px;
  }
  form#photosUploadForm input,
  form#photosUploadForm select {
    min-width: 0;
    width: 100%;
  }
  .photosFilterBar {
    flex-direction: column;
  }
  .photosFilterBar input,
  .photosFilterBar select,
  .photosFilterBar .photosFilterTagsContentEditable {
    min-width: 0;
  }
  .photosPreviewGrid {
    gap: 8px;
  }
  .photosLightboxArrow {
    width: 44px;
    height: 44px;
    font-size: 28px;
  }
  .photosAlbumGroup {
    padding-top: 12px;
  }
}