/* GPlay — Google Photos slideshow, themed to match language.css / index.html */

.container {
  width: 100%;
  max-width: 1100px;
  box-sizing: border-box;
}

.hidden { display: none !important; }

.card { transition: all 0.3s; }
.card:hover { border-color: #38bdf8; }

/* ---------- Setup form ---------- */

#albumUrl {
  width: 100%;
  padding: 14px;
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #374151;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  box-sizing: border-box;
  margin-bottom: 16px;
}
#albumUrl:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: #c9d1d9;
}
.setting-row input[type="number"] {
  width: 70px;
  margin-left: auto;
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 4px 8px;
  font-family: 'JetBrains Mono', monospace;
}
.setting-row select {
  margin-left: auto;
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 4px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  cursor: pointer;
}
.setting-row select:focus {
  outline: none;
  border-color: #38bdf8;
}
.setting-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #38bdf8;
}

button {
  padding: 12px 24px;
  cursor: pointer;
  background: #38bdf8;
  color: #0d1117;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  font-family: 'JetBrains Mono', monospace;
  transition: transform 0.2s, background-color 0.2s;
}
button:hover { background: #7dd3fc; transform: translateY(-1px); }
button:disabled { background: #374151; color: #6b7280; cursor: not-allowed; transform: none; }

#loadBtn { width: 100%; }

#statusMsg {
  margin-top: 14px;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  border: 1px solid #374151;
  background: rgba(17, 24, 39, 0.7);
}
#statusMsg.info    { color: #38bdf8; border-color: rgba(56, 189, 248, 0.4); }
#statusMsg.error   { color: #f87171; border-color: rgba(248, 113, 113, 0.4); }
#statusMsg.success { color: #5eead4; border-color: rgba(94, 234, 212, 0.4); }

/* ---------- Bookmarklet ---------- */

.bookmarklet-block {
  margin-top: 20px;
  border: 1px dashed #374151;
  border-radius: 8px;
  padding: 14px;
  background: rgba(17, 24, 39, 0.35);
}
.bookmarklet-btn {
  display: inline-block;
  padding: 10px 18px;
  background: #38bdf8;
  color: #0d1117 !important;
  font-weight: bold;
  border-radius: 8px;
  text-decoration: none;
  cursor: grab;
  font-family: 'JetBrains Mono', monospace;
  transition: background-color 0.2s, transform 0.2s;
  user-select: none;
}
.bookmarklet-btn:hover { background: #7dd3fc; transform: translateY(-1px); }
.bookmarklet-btn:active { cursor: grabbing; }

/* ---------- Manual fallback ---------- */

.manual-block {
  margin-top: 20px;
  border: 1px dashed #374151;
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(17, 24, 39, 0.35);
}
.manual-block summary {
  cursor: pointer;
  color: #38bdf8;
  font-size: 0.9rem;
  outline: none;
  user-select: none;
}
.manual-block summary:hover { color: #7dd3fc; }
.manual-block kbd {
  background: #0d1117;
  border: 1px solid #374151;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.75rem;
  color: #c9d1d9;
}
#manualInput {
  width: 100%;
  height: 160px;
  padding: 12px;
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #374151;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  resize: vertical;
  box-sizing: border-box;
  margin-bottom: 12px;
}
#manualInput:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}
#manualBtn { width: 100%; }

/* ---------- Slideshow ---------- */

#slideshow { margin-top: 1rem; }

#stage {
  position: relative;
  background: #000;
  border: 1px solid #374151;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Two overlapping <img> layers so we can crossfade / slide / zoom / wipe
   between them purely in CSS. See gplay.js showSlide(). */
#stage .layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform, opacity, clip-path;
}

@keyframes gp-fade-in       { from { opacity: 0; } to { opacity: 1; } }
@keyframes gp-fade-out      { from { opacity: 1; } to { opacity: 0; } }
@keyframes gp-slide-in-right  { from { transform: translateX(100%);  opacity: 1; } to { transform: translateX(0);     opacity: 1; } }
@keyframes gp-slide-out-left  { from { transform: translateX(0);     opacity: 1; } to { transform: translateX(-100%); opacity: 1; } }
@keyframes gp-slide-in-left   { from { transform: translateX(-100%); opacity: 1; } to { transform: translateX(0);     opacity: 1; } }
@keyframes gp-slide-out-right { from { transform: translateX(0);     opacity: 1; } to { transform: translateX(100%);  opacity: 1; } }
@keyframes gp-slide-in-bottom { from { transform: translateY(100%);  opacity: 1; } to { transform: translateY(0);     opacity: 1; } }
@keyframes gp-slide-out-top   { from { transform: translateY(0);     opacity: 1; } to { transform: translateY(-100%); opacity: 1; } }
@keyframes gp-slide-in-top    { from { transform: translateY(-100%); opacity: 1; } to { transform: translateY(0);     opacity: 1; } }
@keyframes gp-slide-out-bottom{ from { transform: translateY(0);     opacity: 1; } to { transform: translateY(100%);  opacity: 1; } }
@keyframes gp-zoom-in         { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1);    opacity: 1; } }
@keyframes gp-zoom-out        { from { transform: scale(1);    opacity: 1; } to { transform: scale(1.15); opacity: 0; } }
@keyframes gp-wipe-in         { from { clip-path: inset(0 100% 0 0); opacity: 1; } to { clip-path: inset(0 0 0 0); opacity: 1; } }

#stageHint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: #6b7280;
  background: rgba(13, 17, 23, 0.7);
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
#stage:hover #stageHint { opacity: 1; }
#stage:fullscreen #stageHint { display: none; }

#recIndicator {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: bold;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.05em;
}
#recIndicator::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  animation: recBlink 1s infinite;
}
@keyframes recBlink { 50% { opacity: 0.25; } }

/* ---------- Music player (bottom-right floating panel) ---------- */

#musicPlayer {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  font-family: 'JetBrains Mono', monospace;
}

#musicToggle {
  padding: 10px 16px;
  background: #38bdf8;
  color: #0d1117;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: background 0.2s, transform 0.2s;
  display: none;
}
#musicToggle:hover { background: #7dd3fc; transform: translateY(-1px); }
#musicPlayer.collapsed #musicToggle { display: inline-block; }
#musicPlayer.collapsed #musicPanel { display: none; }

#musicPanel {
  width: 340px;
  max-width: calc(100vw - 40px);
  background: rgba(13, 17, 23, 0.97);
  border: 1px solid #374151;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  color: #c9d1d9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #38bdf8;
  font-weight: bold;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}
.mp-close {
  background: transparent;
  color: #6b7280;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  padding: 0 6px;
  transition: color 0.2s;
  width: auto;
}
.mp-close:hover { color: #f87171; background: transparent; transform: none; }

.mp-row {
  display: flex;
  gap: 6px;
}
#playlistInput {
  flex: 1;
  min-width: 0;
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 6px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  box-sizing: border-box;
}
#playlistInput:focus { outline: none; border-color: #38bdf8; }
#loadPlaylistBtn {
  padding: 6px 12px;
  font-size: 0.85rem;
  width: auto;
}

.mp-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mp-controls button {
  padding: 6px 10px;
  font-size: 1rem;
  background: rgba(17, 24, 39, 0.7);
  color: #c9d1d9;
  border: 1px solid #374151;
  width: auto;
}
.mp-controls button:hover { background: #38bdf8; color: #0d1117; }
#volumeSlider {
  flex: 1;
  accent-color: #38bdf8;
  cursor: pointer;
}

#trackInfo {
  font-size: 0.85rem;
  color: #5eead4;
  padding: 6px 10px;
  background: rgba(17, 24, 39, 0.5);
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-tip {
  font-size: 0.7rem;
  color: #6b7280;
  line-height: 1.4;
  margin: 0;
}
.mp-tip a { color: #38bdf8; text-decoration: underline; }

/* The iframe is functional but visually hidden — audio-only usage. */
#ytPlayer {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
}

#controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  justify-content: center;
}
#controls button {
  min-width: 52px;
  padding: 10px 16px;
  font-size: 1rem;
}

#counter {
  text-align: center;
  margin-top: 10px;
  color: #38bdf8;
  font-size: 0.9rem;
}

#liveControls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  color: #c9d1d9;
  font-size: 0.9rem;
}
#liveControls label {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 6px 12px;
}
#liveControls select {
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 4px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  cursor: pointer;
}
#liveControls select:focus {
  outline: none;
  border-color: #38bdf8;
}

.speed-control input[type="range"] {
  width: 90px;
  accent-color: #38bdf8;
  cursor: pointer;
}
#speedLabel {
  min-width: 42px;
  color: #38bdf8;
  font-size: 0.8rem;
  text-align: right;
}

/* ---------- Fullscreen ---------- */

#stage:fullscreen {
  border: none;
  border-radius: 0;
  aspect-ratio: auto;
  width: 100vw;
  height: 100vh;
}
#stage:fullscreen #slideImg {
  max-width: 100vw;
  max-height: 100vh;
}
