/* =====================================================
   CAMERA PRO — Interface Profissional
   Curso de Fotografia — Alfabetização do Olhar
   ===================================================== */

.camera-pro-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* ---------- VIEWER PRINCIPAL ---------- */
.camera-viewfinder {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--border-radius-grande);
  overflow: hidden;
  box-shadow: var(--sombra-forte);
  border: 2px solid rgba(232, 167, 53, 0.15);
}

.camera-viewfinder video,
.camera-viewfinder canvas,
.camera-viewfinder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- OVERLAYS DE COMPOSIÇÃO (estritamente desativados por padrão) ---------- */
.composition-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  display: none !important;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.composition-overlay.active {
  display: block !important;
  opacity: 1;
}

/* Regra dos Terços */
.overlay-thirds {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 33.33% 33.33%;
  background-position: -1px -1px;
}

.overlay-thirds .intersection-dots {
  position: absolute;
  inset: 0;
}

.overlay-thirds .intersection-dots .dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(232, 167, 53, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.9);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(232, 167, 53, 0.5);
}

/* Proporção Áurea / Golden Ratio */
.overlay-golden .golden-line {
  position: absolute;
  background: rgba(232, 167, 53, 0.7);
}

/* Linhas verticais da proporção áurea */
.overlay-golden .golden-line.v1 {
  left: 38.2%;
  top: 0;
  bottom: 0;
  width: 2px;
}

.overlay-golden .golden-line.v2 {
  left: 61.8%;
  top: 0;
  bottom: 0;
  width: 2px;
}

/* Linhas horizontais */
.overlay-golden .golden-line.h1 {
  top: 38.2%;
  left: 0;
  right: 0;
  height: 2px;
}

.overlay-golden .golden-line.h2 {
  top: 61.8%;
  left: 0;
  right: 0;
  height: 2px;
}

/* Espiral de Fibonacci (só aparece quando .active) */
.overlay-fibonacci.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.overlay-fibonacci svg {
  width: 100%;
  height: 100%;
  opacity: 0.8;
}

.overlay-fibonacci svg path {
  stroke: var(--cor-primaria);
  stroke-width: 2;
  fill: none;
}

.overlay-fibonacci svg rect {
  stroke: rgba(232, 167, 53, 0.4);
  stroke-width: 1.5;
  fill: none;
}

/* Linha do Horizonte (só aparece quando .active) */
.overlay-horizon.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.overlay-horizon .horizon-line {
  width: 80%;
  height: 2px;
  background: rgba(78, 205, 196, 0.85);
  box-shadow: 0 0 8px rgba(78, 205, 196, 0.6);
}

.overlay-horizon .horizon-label {
  position: absolute;
  right: 5%;
  top: calc(50% - 30px);
  font-size: 0.85rem;
  color: var(--cor-sucesso);
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(0,0,0,0.6);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
}

/* Simetria / Central (só aparece quando .active) */
.overlay-center.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.overlay-center .center-cross-h {
  position: absolute;
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
}

.overlay-center .center-cross-v {
  position: absolute;
  height: 100%;
  width: 1px;
  background: rgba(255, 255, 255, 0.3);
}

.overlay-center .center-box {
  width: 120px;
  height: 120px;
  border: 1.5px solid rgba(232, 167, 53, 0.5);
  border-radius: 4px;
}

/* ---------- CONTROLES DA CÂMERA ---------- */
.camera-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem 0;
  justify-content: center;
}

/* Control Group (ISO, SPEED, EV, FOCUS, WB) */
.control-group {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  padding: 1rem 1.5rem;
  min-width: 130px;
  text-align: center;
  cursor: pointer;
  transition: var(--transicao);
  backdrop-filter: blur(10px);
}

.control-group:hover {
  border-color: var(--cor-primaria);
  background: rgba(232, 167, 53, 0.1);
}

.control-group.active {
  border-color: var(--cor-primaria);
  background: rgba(232, 167, 53, 0.15);
  box-shadow: 0 0 20px rgba(232, 167, 53, 0.2);
}

.control-group .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.35rem;
}

.control-group .value {
  font-family: 'Courier New', monospace;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cor-primaria);
}

.control-group .unit {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.25rem;
}

/* ---------- SLIDERS ---------- */
.camera-slider-container {
  width: 100%;
  padding: 1.5rem 2rem;
  display: none;
}

.camera-slider-container.visible {
  display: block;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.slider-label {
  min-width: 80px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.6);
}

.slider-track {
  flex: 1;
  position: relative;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  cursor: pointer;
}

.slider-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--cor-primaria);
  border-radius: 3px;
  transition: width 0.2s ease;
}

.slider-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  background: var(--cor-primaria);
  border: 3px solid white;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: transform 0.15s ease;
}

.slider-thumb:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.15);
}

.slider-value {
  min-width: 55px;
  text-align: right;
  font-family: 'Courier New', monospace;
  font-size: 1.15rem;
  color: var(--cor-primaria);
  font-weight: 600;
}

/* ---------- OVERLAY TOGGLES ---------- */
.overlay-toggles {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 1.5rem;
}

.overlay-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.4rem;
  border-radius: 50px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: rgba(255,255,255,0.05);
  color: var(--cor-texto);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transicao);
  backdrop-filter: blur(10px);
  user-select: none;
}

.overlay-toggle-btn:hover {
  border-color: var(--cor-primaria);
  background: rgba(232, 167, 53, 0.1);
}

.overlay-toggle-btn.active {
  background: var(--cor-primaria);
  color: var(--cor-secundaria);
  border-color: var(--cor-primaria);
  box-shadow: 0 4px 20px rgba(232, 167, 53, 0.35);
}

.overlay-toggle-btn .icon {
  font-size: 1.35rem;
}

.overlay-toggle-btn .label-text {
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ---------- FLASH TOGGLE ---------- */
.flash-toggle {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 20;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transicao);
}

.flash-toggle:hover {
  background: rgba(232, 167, 53, 0.3);
}

.flash-toggle.active {
  background: var(--cor-primaria);
  color: var(--cor-secundaria);
  box-shadow: 0 0 25px rgba(232, 167, 53, 0.5);
}

/* ---------- PERFIL DE COR ---------- */
.color-profile-panel {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.color-profile-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.15);
  cursor: pointer;
  transition: var(--transicao);
  position: relative;
  overflow: hidden;
}

.color-profile-btn:hover {
  transform: scale(1.12);
  border-color: var(--cor-primaria);
}

.color-profile-btn.active {
  border-color: var(--cor-primaria);
  box-shadow: 0 0 18px rgba(232, 167, 53, 0.4);
}

.color-profile-btn .name {
  position: absolute;
  bottom: -1.8rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

/* Perfis de cor */
.profile-auto       { background: linear-gradient(135deg, #e0e0e0, #f5f5f5); }
.profile-vivid      { background: linear-gradient(135deg, #ff6b6b, #ffa500, #4ecdc4); }
.profile-mono       { background: linear-gradient(135deg, #333, #999, #fff); }
.profile-warm       { background: linear-gradient(135deg, #ff6b35, #f7c948); }
.profile-cool       { background: linear-gradient(135deg, #667eea, #764ba2); }
.profile-film       { background: linear-gradient(135deg, #d4a574, #c9a96e, #8b7355); }
.profile-portrait   { background: linear-gradient(135deg, #ffecd2, #fcb69f); }
.profile-landscape  { background: linear-gradient(135deg, #56ab2f, #a8e063); }

/* ---------- VIEWER TOOLS (buttons overlay) ---------- */
.viewfinder-tools {
  position: absolute;
  top: 1.2rem;
  left: 1.2rem;
  z-index: 20;
  display: flex;
  gap: 0.65rem;
}

.vf-tool-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transicao);
}

.vf-tool-btn:hover {
  background: rgba(232, 167, 53, 0.4);
}

.vf-tool-btn.active {
  background: var(--cor-primaria);
  color: var(--cor-secundaria);
}

/* ---------- ZOOM SLIDER ---------- */
.zoom-control {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  padding: 0.65rem 1.5rem;
  border-radius: 50px;
}

.zoom-control .zoom-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transicao);
}

.zoom-control .zoom-btn:hover {
  background: var(--cor-primaria);
  color: var(--cor-secundaria);
}

.zoom-control .zoom-label {
  font-family: 'Courier New', monospace;
  color: white;
  font-size: 1.05rem;
  min-width: 45px;
  text-align: center;
}

/* ---------- SHUTTER BUTTON ---------- */
.shutter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem 0 1.5rem;
}

.shutter-btn {
  width: 85px;
  height: 85px;
  border-radius: 50%;
  border: 5px solid var(--cor-primaria);
  background: transparent;
  cursor: pointer;
  transition: var(--transicao);
  position: relative;
}

.shutter-btn::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--cor-primaria);
  transition: var(--transicao);
}

.shutter-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 35px rgba(232, 167, 53, 0.5);
}

.shutter-btn:active::after {
  transform: scale(0.88);
  background: var(--cor-secundaria);
}

.shutter-side-btn {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--cor-texto);
  transition: var(--transicao);
}

.shutter-side-btn:hover {
  border-color: var(--cor-primaria);
  background: rgba(232, 167, 53, 0.1);
}

/* ---------- PAINEL DE EXPLICAÇÃO (aula) ---------- */
.composition-info {
  background: rgba(232, 167, 53, 0.08);
  border: 1px solid rgba(232, 167, 53, 0.15);
  border-radius: var(--border-radius-grande);
  padding: 2.5rem;
  margin-top: 2.5rem;
}

.composition-info h3 {
  font-family: var(--fonte-titulos);
  font-size: 1.65rem;
  color: var(--cor-primaria);
  margin-bottom: 1.25rem;
}

.composition-info p {
  font-size: 1.15rem;
  line-height: 1.9;
  color: rgba(240,240,240,0.8);
  margin-bottom: 1rem;
}

.composition-info .tip {
  background: rgba(78, 205, 196, 0.1);
  border-left: 3px solid var(--cor-sucesso);
  padding: 1.25rem 1.5rem;
  border-radius: 0 12px 12px 0;
  margin-top: 1.5rem;
  font-style: italic;
}

/* ---------- RESPONSIVO CAMERA ---------- */
@media (max-width: 768px) {
  .camera-controls {
    gap: 0.65rem;
  }

  .control-group {
    min-width: 100px;
    padding: 0.75rem 1rem;
  }

  .control-group .value {
    font-size: 1.15rem;
  }

  .overlay-toggle-btn {
    padding: 0.65rem 1.1rem;
    font-size: 0.95rem;
  }

  .camera-viewfinder {
    aspect-ratio: 4/3;
    border-radius: var(--border-radius);
  }

  .shutter-btn {
    width: 70px;
    height: 70px;
  }

  .color-profile-panel {
    gap: 0.65rem;
  }

  .color-profile-btn {
    min-width: 65px;
    height: 48px;
  }
}

/* =====================================================
   ESTILOS DOS OVERLAYS & FILTROS ESTILO PUTER CAMERA
   ===================================================== */
.overlay-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  color: var(--cor-texto);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.overlay-toggle-btn:hover {
  background: rgba(232, 167, 53, 0.12);
  border-color: rgba(232, 167, 53, 0.4);
  transform: translateY(-2px);
}

.overlay-toggle-btn.active {
  background: linear-gradient(135deg, var(--cor-primaria) 0%, #d4922e 100%);
  color: var(--cor-secundaria);
  border-color: var(--cor-primaria);
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(232, 167, 53, 0.45);
}

.clear-overlays-btn {
  border-color: rgba(255, 100, 100, 0.35);
  color: rgba(255, 150, 150, 0.9);
}

.clear-overlays-btn:hover {
  background: rgba(255, 100, 100, 0.2);
  border-color: rgba(255, 100, 100, 0.6);
  color: #fff;
}

/* Carrossel de Filtros Horizontal (Estilo Puter Camera) */
.color-profile-panel {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  padding: 0.8rem 0.5rem 1.2rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  justify-content: flex-start;
}

.color-profile-panel::-webkit-scrollbar {
  height: 6px;
}

.color-profile-panel::-webkit-scrollbar-thumb {
  background: rgba(232, 167, 53, 0.3);
  border-radius: 4px;
}

.color-profile-btn {
  flex: 0 0 auto;
  min-width: 82px;
  height: 52px;
  padding: 0 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: rgba(240, 240, 240, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.color-profile-btn:hover {
  background: rgba(232, 167, 53, 0.12);
  border-color: var(--cor-primaria);
  color: var(--cor-primaria);
  transform: translateY(-2px);
}

.color-profile-btn.active {
  background: var(--cor-primaria);
  color: var(--cor-secundaria);
  border-color: var(--cor-primaria);
  box-shadow: 0 4px 16px rgba(232, 167, 53, 0.4);
}

/* Modal de Preview de Foto Capturada */
.photo-preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-card {
  background: var(--cor-terciaria);
  border: 2px solid rgba(232, 167, 53, 0.3);
  border-radius: var(--border-radius-grande);
  padding: 2rem;
  max-width: 680px;
  width: 100%;
  box-shadow: var(--sombra-forte);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-family: var(--fonte-titulos);
  font-size: 1.5rem;
  color: var(--cor-primaria);
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transicao);
}

.modal-close-btn:hover {
  background: var(--cor-primaria);
  color: var(--cor-secundaria);
}

.modal-body {
  border-radius: var(--border-radius);
  overflow: hidden;
  max-height: 55vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.modal-body img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}