/* ==========================================================================
   Quem Como Deus! — Photo Mosaic Simulation Stylesheet
   ========================================================================== */

/* Layout & Grid Page Structure */
.simulacao-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  padding: 3rem 0;
  align-items: start;
}

@media (min-width: 992px) {
  .simulacao-container {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

/* Back Link styling */
.back-nav {
  margin-bottom: 2rem;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-gold);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.back-btn:hover {
  color: var(--color-gold-light);
  transform: translateX(-4px);
}

/* Mosaic Section */
.simulation-visual-card {
  background-color: var(--color-bg-light);
  border: var(--border-gold-subtle);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4);
  position: relative;
  width: 100%;
}

.mosaic-simulation-grid-container {
  position: relative;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  aspect-ratio: 2 / 3;
  background-color: var(--color-bg-dark);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: var(--shadow-gold);
}

/* CSS Grid structure dynamically loaded */
.mosaic-sim-grid {
  display: grid;
  grid-template-columns: repeat(40, 1fr);
  grid-template-rows: repeat(60, 1fr);
  width: 100%;
  height: 100%;
  background-color: var(--color-bg-dark);
}

/* Cell Style */
.mosaic-sim-cell {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.2s ease, outline 0.1s ease;
}

/* Grid lines helper */
.mosaic-sim-grid.show-lines .mosaic-sim-cell {
  outline: 0.5px solid rgba(255, 255, 255, 0.08);
}

/* Hover Zoom Effect */
.mosaic-sim-cell:hover {
  transform: scale(4.5);
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.9), 0 0 15px rgba(var(--color-gold-rgb), 0.8);
  border: 1px solid var(--color-gold);
  border-radius: 2px;
  outline: none !important;
}

/* Blending Image Overlay */
.mosaic-sim-overlay {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  pointer-events: none;
  z-index: 5;
  opacity: 0.5;
  mix-blend-mode: multiply;
  transition: opacity 0.3s ease;
}

/* Control Panel Card */
.control-panel-card {
  background-color: var(--color-bg-light);
  border: var(--border-gold-strong);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4), var(--shadow-gold);
  position: sticky;
  top: 100px;
}

.panel-title {
  font-family: var(--font-serif);
  color: var(--color-gold);
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  border-bottom: var(--border-gold-subtle);
  padding-bottom: 0.5rem;
}

.control-group {
  margin-bottom: 2rem;
}

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-light);
}

.control-value {
  color: var(--color-gold);
  font-weight: 600;
}

/* Premium Range Slider styling */
input[type="range"].premium-slider {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

input[type="range"].premium-slider:focus {
  outline: none;
}

input[type="range"].premium-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  border: 1px solid rgba(212, 175, 55, 0.1);
}

input[type="range"].premium-slider::-webkit-slider-thumb {
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: var(--color-gold);
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -6px;
  box-shadow: 0 0 10px rgba(var(--color-gold-rgb), 0.5);
  transition: transform 0.1s ease;
}

input[type="range"].premium-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  background: var(--color-gold-light);
}

/* Premium Toggle Switch styling */
.switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.switch-wrapper {
  position: relative;
  width: 48px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: background-color 0.3s ease;
}

.switch-wrapper::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background-color: var(--color-text-light);
  border-radius: 50%;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

input[type="checkbox"].premium-toggle {
  display: none;
}

input[type="checkbox"].premium-toggle:checked + .switch-wrapper {
  background-color: var(--color-gold);
}

input[type="checkbox"].premium-toggle:checked + .switch-wrapper::after {
  transform: translateX(24px);
  background-color: var(--color-bg-dark);
}

/* Live Detail View styling */
.live-detail-panel {
  background: rgba(7, 7, 8, 0.6);
  border: var(--border-gold-subtle);
  border-radius: 6px;
  padding: 1.25rem;
  margin-top: 1.5rem;
}

.live-detail-title {
  font-family: var(--font-serif);
  color: var(--color-gold-light);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-detail-content {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.live-detail-img-wrapper {
  width: 90px;
  height: 90px;
  background-color: var(--color-bg-dark);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-detail-info {
  flex: 1;
}

.live-detail-filename {
  font-family: monospace;
  font-size: 0.8rem;
  word-break: break-all;
  color: var(--color-text-light);
  margin-bottom: 0.3rem;
}

.live-detail-year {
  font-size: 0.85rem;
  color: var(--color-gold);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Color match display */
.color-comparison {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.color-swatch-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.color-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 0.5px solid rgba(255, 255, 255, 0.2);
}

/* Stats Card List */
.stats-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.stat-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 0.75rem;
  text-align: center;
}

.stat-val {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-gold);
  font-family: var(--font-serif);
}

.stat-lbl {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Lightbox Modal (Glassmorphic) */
.premium-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(7, 7, 8, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.premium-lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-dialog {
  position: relative;
  max-width: 90%;
  max-height: 85%;
  background: var(--color-bg-light);
  border: var(--border-gold-strong);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), var(--shadow-gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.9);
  transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.premium-lightbox.active .lightbox-dialog {
  transform: scale(1);
}

.lightbox-close-btn {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--color-gold);
  color: var(--color-bg-dark);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  transition: var(--transition-fast);
  z-index: 10;
}

.lightbox-close-btn:hover {
  transform: scale(1.1) rotate(90deg);
  background-color: var(--color-gold-light);
}

.lightbox-close-btn svg {
  width: 20px;
  height: 20px;
}

.lightbox-img-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 6px;
  background-color: var(--color-bg-dark);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.lightbox-full-img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.lightbox-details {
  width: 100%;
  margin-top: 1.25rem;
  text-align: center;
}

.lightbox-title {
  font-family: var(--font-serif);
  color: var(--color-gold);
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
}

.lightbox-filename {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Spinner Loader */
.mosaic-loader {
  position: absolute;
  inset: 0;
  background-color: var(--color-bg-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: opacity 0.5s ease;
}

.mosaic-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

.spinner-gold {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(212, 175, 55, 0.1);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 15px rgba(var(--color-gold-rgb), 0.2);
}

.loader-text {
  font-family: var(--font-serif);
  color: var(--color-gold-light);
  font-size: 1.1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
