/* PHOTO BOOTH ENGINE — BASE STYLES */

/* GLOBAL */
.photo-booth {
  --pb-bg: #0f0f0f;
  --pb-surface: #2a2a2a;
  --pb-border: rgba(255, 255, 255, 0.35);
  --pb-text: #ffffff;
  --pb-text-muted: rgba(255, 255, 255, 0.65);
  --pb-radius: 12px;
  --pb-gap: 20px;

  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  font-family: 'Poppins', sans-serif;
  color: var(--pb-text);
  box-sizing: border-box;
}

/* LAYOUT */
.pb-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--pb-gap);
  align-items: start;
}

.pb-layout__left,
.pb-layout__right {
  display: flex;
  flex-direction: column;
  min-width: 0; /* prevent grid column from expanding to content width */
  gap: var(--pb-gap);
}
/* LAYOUT END */

/* .photo-booth *,
.photo-booth *::before,
.photo-booth *::after {
  box-sizing: inherit;
} */
/* GLOBAL END */

/* SECTION */
.pb-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--pb-gap);
}
.pb-section-title {
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}
/* SECTION END */

/* UPLOAD SECTION */
.pb-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pb-upload-grid[data-slots="1"] { grid-template-columns: 1fr; }
.pb-upload-grid[data-slots="2"] { grid-template-columns: repeat(2, 1fr); }

.pb-upload-item {
  position: relative;
}

.pb-upload-label {
  display: block;
  position: relative;
  aspect-ratio: 1;
  min-height: 80px;
  background: var(--pb-surface);
  border: 2px dashed var(--pb-border);
  border-radius: var(--pb-radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.pb-upload-label:hover,
.pb-upload-label:focus-within {
  border-color: var(--primary);
  background: #333333;
}

.pb-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.pb-upload-prompt {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
  transition: opacity 0.18s;
}

.pb-upload-icon {
  font-size: 32px;
  font-weight: 300;
  line-height: 1;
  color: var(--pb-text);
}

.pb-upload-text {
  font-size: 11px;
  font-weight: 600;
  color: var(--pb-text-muted);
  letter-spacing: 0.04em;
}

.pb-upload-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  pointer-events: none;
  z-index: 1;
}

.pb-reset-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 3;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background 0.18s;
}

.pb-reset-btn:hover {
  background: var(--primary);
}

.pb-reset-btn[hidden] {
  display: none;
}

.pb-drag-hint {
  font-size: 16px;
  color: var(--pb-text-muted);
  margin: 8px 0 0;
  text-align: center;
  color: #333
}
/* UPLOAD SECTION END */

/* SCREEN TIME SECTION */
.pb-screentime {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pb-hours,
.pb-minutes {
  appearance: none;
  -webkit-appearance: none;
  background: var(--pb-surface);
  border: 1px solid var(--pb-border);
  border-radius: 8px;
  color: var(--pb-text);
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  min-width: 90px;
  text-align: center;
  transition: border-color 0.18s;
}

.pb-hours:focus,
.pb-minutes:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-color: var(--primary);
}

.pb-screentime-sep {
  font-size: 20px;
  font-weight: 700;
  color: var(--pb-text-muted);
  flex-shrink: 0;
}
/* SCREEN TIME SECTION END */

/* PREVIEW SECTION */
.pb-preview-scaler {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.pb-preview {
  position: relative;
  transform-origin: top left;
  background: #111;
}
/* PREVIEW SECTION END */

/* SLOT */
.pb-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  /* z-index: 11; */
  -webkit-user-select: none;
}

.pb-slot-hint {
  color: rgba(255, 255, 255, 0.25);
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
  pointer-events: none;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.04em;
}

.pb-slot-image {
  position: absolute;
  display: block;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  will-change: left, top, width, height;
}

.pb-slot-image:active {
  cursor: grabbing;
}

.pb-frame-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  object-fit: fill;
  z-index: 10;
}

.pb-result-text {
  position: absolute;
  pointer-events: none;
  z-index: 11;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}
/* SLOT END */

/* ACTIONS SECTION */
.pb-section--actions {
  display: flex;
  gap: 12px;
}

.pb-section--actions .tgv-btn {
  flex: 1;
}
/* ACTIONS SECTION END */

/* SAVE MODAL */
.pb-save-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pb-save-modal {
  background: #1a1a1a;
  border-radius: 16px;
  padding: 24px;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.pb-save-modal-hint {
  color: #fff;
  font-size: 15px;
  margin: 0;
  line-height: 1.5;
}

.pb-save-modal-img {
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  border-radius: 8px;
  -webkit-touch-callout: default;
}

.pb-save-modal-close {
  width: 100%;
}
/* SAVE MODAL END */

/* LOADING OVERLAY */
.pb-loading {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 9999;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pb-loading[hidden] {
  display: none !important;
}

.pb-loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: pb-spin 0.75s linear infinite;
}

.pb-loading-text {
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  margin: 0;
}

@keyframes pb-spin {
  to { transform: rotate(360deg); }
}
/* LOADING OVERLAY END */

/* RESPONSIVE */
@media (max-width: 640px) {
  .pb-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .pb-upload-grid {
    gap: 6px;
  }

  .pb-hours,
  .pb-minutes {
    font-size: 14px;
    padding: 8px 10px;
    min-width: 76px;
  }
}
/* RESPONSIVE END */

/* PHOTO BOOTH ENGINE END */
