/* Sky Photos extension styles (ext/skypics) */

.modal {
  display: none;
  position: fixed;
  z-index: 20;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #111;
  color: #fff;
  padding: 20px;
  width: 50%;
  max-width: 600px;
  height: 50%;
  max-height: 600px;
  border-radius: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.modal-content img {
  max-width: 100%;
  max-height: 60%;
  margin-bottom: 10px;
  border-radius: 8px;
}

.close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
}

.close:hover {
  color: #bbb;
}

.sky-photo-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 6px solid #fff;
  border-top: 6px solid #444;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.save-btn {
  margin-top: 12px;
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 20px;
  border: none;
  background: #1e88e5;
  color: white;
  cursor: pointer;
}

.save-btn:active {
  transform: scale(0.97);
}

.save-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.progress {
  width: 80%;
  max-width: 360px;
  margin: 16px auto;
  text-align: center;
}

.progress .bar {
  height: 6px;
  width: 0%;
  background: #4ea1ff;
  border-radius: 3px;
  transition: width 0.15s ease;
}

.progress .label {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.75;
}

.hidden {
  display: none;
}

#skyPhotosEarthGallery {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  overflow: hidden;
  pointer-events: none;
}

.sky-earth-photo-thumb {
  position: absolute;
  display: flex;
  transform: translate(-50%, -50%);
  transform-origin: center;
  border-radius: 8px;
  z-index: 5;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

#photo-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
  animation: photoPopupFadeIn 120ms ease-out;
}

@keyframes photoPopupFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#photo-popup img {
  max-width: 80vw;
  max-height: 80vh;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

:root {
  --sky-scroll-cross-size: calc(3 * var(--menu-icon-size));
  --sky-scroll-inset-top: 8px;
  --sky-scroll-select-border: 4px;
  --sky-scroll-gap: calc(5px / var(--dppx, 1));
  --bottom-scroller-clearance: 16px;
}

#skyPhotosScrollGallery {
  padding: var(--sky-scroll-select-border);
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  position: fixed;
  z-index: 20;
}

/* Portrait: under the menu row, full width */
#skyPhotosScrollGallery.horizontal {
  top: auto;
  bottom: var(--bottom-scroller-clearance);
  left: 0;
  right: 0;
  height: var(--sky-scroll-cross-size);
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-x;
}

/* Landscape: beside the menu column, full height (no filter row, unlike in the Weather extension). */
#skyPhotosScrollGallery.vertical {
  width: var(--sky-scroll-cross-size);
  top: 0;
  bottom: var(--bottom-scroller-clearance);
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
}

#skyPhotosScrollGallery.vertical.scroll-menu-right {
  right: var(--menu-corner-size, 56px);
  left: auto;
}

#skyPhotosScrollGallery.vertical.scroll-menu-left {
  left: var(--menu-corner-size, 56px);
  right: auto;
}

#skyPhotosScrollGallery::-webkit-scrollbar {
  display: none;
}

#skyPhotosScrollGallery.dragging {
  cursor: grabbing;
}

#skyPhotosScrollBox {
  display: flex;
  gap: var(--sky-scroll-gap);
}

.scroll-spacer {
  flex-shrink: 0;
  pointer-events: none;
}

.sky-scroll-photo-thumb {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
}

.sky-scroll-photo-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-sizing: border-box;
  border: var(--sky-scroll-select-border) solid transparent;
  display: block;
  scroll-snap-align: center;
  -webkit-user-drag: none;
  user-drag: none;
  user-select: none;
}

.sky-scroll-photo-thumb.is-selected img {
  border-color: rgba(255, 255, 255, 1);
}

#skyPhotosScrollGallery.horizontal #skyPhotosScrollBox {
  flex-direction: row;
  height: 100%;
  align-items: stretch;
}

#skyPhotosScrollGallery.horizontal .sky-scroll-photo-thumb {
  height: 100%;
  width: auto;
}

#skyPhotosScrollGallery.vertical #skyPhotosScrollBox {
  flex-direction: column;
  width: 100%;
}

#skyPhotosScrollGallery.vertical .sky-scroll-photo-thumb {
  width: 100%;
  height: auto;
}

.sky-photos-camera-btn {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  color: white;
  background: rgba(30, 136, 229, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

.sky-photos-camera-btn:hover,
.sky-photos-camera-btn:focus-visible {
  background: rgba(30, 136, 229, 1);
  border-color: rgba(255, 255, 255, 0.42);
}

.sky-photos-camera-btn img {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
}

#menuSkyPhotosDriveFolder {
  padding-left: 34px;
  padding-right: 34px;
  font-size: 14px;
}

#menuSkyPhotosDriveFolder .menu-item-icon {
  opacity: 0.85;
}
