/* ===================================
   FIRST-TIME USER GUIDE STYLES
   =================================== */

/* ===== MODAL DE BOAS-VINDAS ===== */
.guide-welcome-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.4s ease-out;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}

.guide-welcome-modal.guide-welcome-show {
  opacity: 1;
}

.guide-welcome-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  padding: 40px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  color: white;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transform: translateY(30px);
  transition: transform 0.4s ease-out;
  overflow-y: auto;
  margin: auto;
  display: flex;
  flex-direction: column;
}

.guide-welcome-show .guide-welcome-content {
  transform: translateY(0);
}

.guide-welcome-header h2 {
  font-size: 2.2em;
  margin: 0 0 15px 0;
  font-weight: bold;
}

.guide-welcome-header p {
  font-size: 1.1em;
  opacity: 0.9;
  margin: 0 0 30px 0;
  line-height: 1.5;
}

/* ===== FEATURES GRID ===== */
.guide-welcome-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 30px 0;
}

.guide-feature {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 12px;
  text-align: left;
}

.guide-feature-icon {
  font-size: 2em;
  flex-shrink: 0;
}

.guide-feature-text strong {
  display: block;
  font-size: 1.1em;
  margin-bottom: 5px;
}

.guide-feature-text p {
  margin: 0;
  opacity: 0.8;
  font-size: 0.9em;
}

/* ===== BOTÕES DO MODAL ===== */
.guide-welcome-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 30px 0 20px 0;
  flex-wrap: wrap;
}

.guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  min-width: 140px;
  justify-content: center;
}

.guide-btn-primary {
  background: #4CAF50;
  color: white;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.guide-btn-primary:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.guide-btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #333;
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
}

.guide-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #222;
  transform: translateY(-2px);
}

.guide-btn-icon {
  font-size: 1.1em;
}

.guide-welcome-note {
  opacity: 0.7;
  font-size: 0.9em;
  margin-top: 20px;
}

/* Estilos específicos para botões no modal de boas-vindas */
.guide-welcome-actions .guide-btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border: 1px solid rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.guide-welcome-actions .guide-btn-secondary:hover {
  background: rgba(255, 255, 255, 1);
  color: #222;
  transform: translateY(-2px);
}

/* ===== OVERLAY DO TOUR ===== */
.guide-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9998;
  opacity: 0;
  animation: guideOverlayFadeIn 0.3s ease-out forwards;
}

@keyframes guideOverlayFadeIn {
  to { opacity: 1; }
}

/* ===== SPOTLIGHT ===== */
.guide-spotlight {
  position: fixed;
  border: 3px solid #4CAF50;
  border-radius: 8px;
  z-index: 9999;
  pointer-events: none;
  box-shadow: 
    0 0 0 9999px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(76, 175, 80, 0.6),
    inset 0 0 20px rgba(76, 175, 80, 0.2);
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.guide-spotlight-show {
  opacity: 1;
  transform: scale(1);
}

/* Animação pulsante para o spotlight */
.guide-spotlight::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border: 2px solid rgba(76, 175, 80, 0.6);
  border-radius: 8px;
  animation: guideSpotlightPulse 2s ease-in-out infinite;
}

@keyframes guideSpotlightPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.7;
  }
}

/* ===== TOOLTIP DO GUIDE ===== */
.guide-tooltip {
  position: fixed;
  z-index: 10001;
  max-width: 350px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.guide-tooltip-show {
  opacity: 1;
  transform: translateY(0);
}

.guide-tooltip-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.guide-tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 0 20px;
}

.guide-tooltip-header h3 {
  margin: 0;
  font-size: 1.3em;
  color: #333;
  font-weight: 600;
}

.guide-close-btn {
  background: none;
  border: none;
  font-size: 1.5em;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.guide-close-btn:hover {
  background: #f5f5f5;
  color: #333;
}

.guide-tooltip-body {
  padding: 15px 20px 20px 20px;
}

.guide-tooltip-body p {
  margin: 0;
  color: #666;
  line-height: 1.6;
  font-size: 1em;
}

/* ===== BARRA DE PROGRESSO ===== */
.guide-tooltip-progress {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 20px 20px 20px;
}

.guide-progress-bar {
  flex: 1;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}

.guide-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #45a049);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.guide-progress-text {
  font-size: 0.9em;
  color: #999;
  font-weight: 500;
  min-width: 60px;
}

/* ===== AÇÕES DO TOOLTIP ===== */
.guide-tooltip-actions {
  display: flex;
  gap: 10px;
  padding: 0 20px 20px 20px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.guide-tooltip-actions .guide-btn {
  min-width: auto;
  padding: 8px 16px;
  font-size: 0.9em;
}

.guide-tooltip-actions .guide-btn-secondary {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
}

.guide-tooltip-actions .guide-btn-secondary:hover {
  background: #e9e9e9;
  color: #333;
  border-color: #ccc;
}

/* ===== POSICIONAMENTO DOS TOOLTIPS ===== */
.guide-tooltip-center {
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%);
  max-width: 400px;
}

.guide-tooltip-center.guide-tooltip-show {
  transform: translate(-50%, -50%);
}

/* Setas dos tooltips */
.guide-tooltip-bottom::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid white;
}

.guide-tooltip-top::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid white;
}

.guide-tooltip-left::before {
  content: '';
  position: absolute;
  top: 50%;
  right: -8px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid white;
}

.guide-tooltip-right::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -8px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid white;
}

/* ===== MENSAGEM DE CONCLUSÃO ===== */
.guide-completion-message {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 10002;
  animation: guideCompletionSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.guide-completion-content {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
  max-width: 300px;
  text-align: center;
}

.guide-completion-content h3 {
  margin: 0 0 10px 0;
  font-size: 1.2em;
}

.guide-completion-content p {
  margin: 0 0 15px 0;
  opacity: 0.9;
  font-size: 0.9em;
}

@keyframes guideCompletionSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== ELEMENTOS TEMPORÁRIOS ===== */
.guide-temp-show {
  opacity: 0.7 !important;
  pointer-events: none !important;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
  .guide-welcome-modal {
    padding: 15px;
    align-items: flex-start;
    padding-top: 5vh;
  }
  
  .guide-welcome-content {
    padding: 25px 20px;
    margin: 0;
    max-height: 85vh;
    width: 100%;
    max-width: 100%;
  }
  
  .guide-welcome-header h2 {
    font-size: 1.8em;
    margin-bottom: 10px;
  }
  
  .guide-welcome-header p {
    font-size: 1em;
    margin-bottom: 20px;
  }
  
  .guide-welcome-actions {
    flex-direction: column;
    align-items: center;
    margin: 20px 0 15px 0;
  }
  
  .guide-btn {
    width: 100%;
    max-width: 250px;
  }
  
  .guide-tooltip {
    max-width: 90vw;
    left: 5vw !important;
    right: 5vw !important;
  }
  
  .guide-tooltip-center {
    max-width: 90vw;
  }
  
  .guide-completion-message {
    bottom: 20px;
    right: 20px;
    left: 20px;
  }
  
  .guide-completion-content {
    max-width: none;
  }
  
  .guide-welcome-features {
    gap: 15px;
  }
  
  .guide-feature {
    padding: 12px;
  }
  
  .guide-feature-icon {
    font-size: 1.5em;
  }
}

@media (max-width: 480px) {
  .guide-welcome-modal {
    padding: 10px;
    padding-top: 3vh;
  }
  
  .guide-welcome-content {
    padding: 20px 15px;
    max-height: 90vh;
    border-radius: 15px;
  }
  
  .guide-welcome-header h2 {
    font-size: 1.6em;
    margin-bottom: 8px;
  }
  
  .guide-welcome-header p {
    font-size: 0.95em;
    margin-bottom: 15px;
  }
  
  .guide-welcome-features {
    margin: 15px 0;
  }
  
  .guide-welcome-actions {
    margin: 15px 0 10px 0;
  }
  
  .guide-welcome-note {
    font-size: 0.8em;
    margin-top: 15px;
  }
  
  .guide-tooltip-actions {
    flex-direction: column;
  }
  
  .guide-tooltip-actions .guide-btn {
    width: 100%;
  }
  
  .guide-feature {
    flex-direction: column;
    text-align: center;
    gap: 10px;
    padding: 10px;
  }
  
  .guide-feature-text {
    text-align: center;
  }
  
  .guide-feature-icon {
    font-size: 1.3em;
  }
}

/* ===== TELAS BAIXAS (LANDSCAPE MOBILE) ===== */
@media (max-height: 600px) and (orientation: landscape) {
  .guide-welcome-modal {
    padding: 5px;
    padding-top: 2vh;
    align-items: flex-start;
  }
  
  .guide-welcome-content {
    max-height: 95vh;
    padding: 15px;
    margin: 0;
  }
  
  .guide-welcome-header h2 {
    font-size: 1.5em;
    margin-bottom: 5px;
  }
  
  .guide-welcome-header p {
    font-size: 0.9em;
    margin-bottom: 10px;
  }
  
  .guide-welcome-features {
    margin: 10px 0;
    gap: 10px;
  }
  
  .guide-feature {
    padding: 8px;
  }
  
  .guide-welcome-actions {
    margin: 10px 0 5px 0;
    gap: 10px;
  }
  
  .guide-welcome-note {
    font-size: 0.75em;
    margin-top: 10px;
  }
}

/* ===== TELAS MUITO BAIXAS ===== */
@media (max-height: 500px) {
  .guide-welcome-modal {
    padding: 3px;
    padding-top: 1vh;
  }
  
  .guide-welcome-content {
    max-height: 98vh;
    padding: 10px;
    border-radius: 10px;
  }
  
  .guide-welcome-header h2 {
    font-size: 1.3em;
    margin-bottom: 3px;
  }
  
  .guide-welcome-header p {
    font-size: 0.85em;
    margin-bottom: 8px;
  }
  
  .guide-welcome-features {
    margin: 8px 0;
    gap: 8px;
  }
  
  .guide-feature {
    padding: 6px;
    gap: 8px;
  }
  
  .guide-feature-icon {
    font-size: 1.2em;
  }
  
  .guide-welcome-actions {
    margin: 8px 0 3px 0;
    gap: 8px;
  }
  
  .guide-btn {
    padding: 8px 16px;
    font-size: 0.9em;
  }
  
  .guide-welcome-note {
    font-size: 0.7em;
    margin-top: 8px;
  }
}

/* ===== ACESSIBILIDADE ===== */
@media (prefers-reduced-motion: reduce) {
  .guide-spotlight,
  .guide-tooltip,
  .guide-welcome-modal,
  .guide-completion-message {
    animation: none;
    transition: none;
  }
  
  .guide-spotlight::before {
    animation: none;
  }
}

/* ===== MODO ESCURO ===== */
@media (prefers-color-scheme: dark) {
  .guide-tooltip-content {
    background: #2d2d2d;
    border-color: #444;
  }
  
  .guide-tooltip-header h3 {
    color: #fff;
  }
  
  .guide-tooltip-body p {
    color: #ccc;
  }
  
  .guide-close-btn {
    color: #ccc;
  }
  
  .guide-close-btn:hover {
    background: #444;
    color: #fff;
  }
  
  .guide-progress-bar {
    background: #444;
  }
  
  .guide-progress-text {
    color: #ccc;
  }
  
  .guide-tooltip-actions .guide-btn-secondary {
    background: #444;
    color: #ccc;
    border-color: #555;
  }
  
  .guide-tooltip-actions .guide-btn-secondary:hover {
    background: #555;
    color: #fff;
    border-color: #666;
  }
}

/* ===== ESTADOS DE FOCO ===== */
.guide-btn:focus,
.guide-close-btn:focus {
  outline: 2px solid #4CAF50;
  outline-offset: 2px;
}

/* ===== ANIMAÇÕES ADICIONAIS ===== */
@keyframes guideGlow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
  }
  50% {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8);
  }
}

.guide-spotlight {
  animation: guideGlow 2s ease-in-out infinite;
}

/* ===== ESTILO DO BOTÃO WEBCAM (MESMO PADRÃO DO GUIDE) ===== */
#webcamButton {
  /* Reset dos estilos do Material Design */
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  
  /* Aplicar estilo do guide */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 25px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  min-width: 140px;
  justify-content: center;
  
  /* Estilo primário do guide */
  background: linear-gradient(135deg, #4CAF50, #45a049) !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3) !important;
  
  /* Posicionamento */
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

#webcamButton:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40) !important;
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4) !important;
}

#webcamButton:focus {
  outline: 2px solid #4CAF50;
  outline-offset: 2px;
}

#webcamButton:active {
  transform: translateX(-50%) translateY(0px);
  box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3) !important;
}

/* Estilo quando está no modo "Sair" */
#webcamButton.webcam-active {
  background: linear-gradient(135deg, #f44336, #d32f2f) !important;
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3) !important;
}

#webcamButton.webcam-active:hover {
  background: linear-gradient(135deg, #d32f2f, #c62828) !important;
  box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4) !important;
}

/* Ícone opcional no botão */
#webcamButton::before {
  content: '';
  width: 16px;
  height: 16px;
  background: currentColor;
  border-radius: 50%;
  margin-right: 8px;
  opacity: 0.8;
}

#webcamButton.webcam-active::before {
  content: '';
  width: 12px;
  height: 12px;
  background: currentColor;
  border-radius: 2px;
}

/* Remover ripple effect do Material Design */
#webcamButton .mdc-button__ripple {
  display: none !important;
}

/* Responsividade para o botão */
@media (max-width: 768px) {
  #webcamButton {
    padding: 12px 24px;
    font-size: 1em;
    min-width: 120px;
    top: 15px;
  }
}

@media (max-width: 480px) {
  #webcamButton {
    padding: 10px 20px;
    font-size: 0.95em;
    min-width: 100px;
    top: 12px;
  }
}

/* ===== ESTILO DOS BOTÕES DO MODAL DE CELEBRAÇÃO ===== */
#close-modal-btn,
#reset-score-btn {
  /* Reset dos estilos do Material Design */
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  
  /* Aplicar estilo do guide */
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  min-width: 140px;
  justify-content: center;
  margin: 5px;
}

/* Botão primário - Continuar Jogando */
#close-modal-btn {
  background: linear-gradient(135deg, #4CAF50, #45a049) !important;
  color: white !important;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3) !important;
}

#close-modal-btn:hover {
  background: linear-gradient(135deg, #45a049, #3d8b40) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4) !important;
}

#close-modal-btn:focus {
  outline: 2px solid #4CAF50;
  outline-offset: 2px;
}

#close-modal-btn:active {
  transform: translateY(0px);
  box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3) !important;
}

/* Botão secundário - Reset Pontuação */
#reset-score-btn {
  background: rgba(255, 255, 255, 0.9) !important;
  color: #333 !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  font-weight: 600;
}

#reset-score-btn:hover {
  background: rgba(255, 255, 255, 1) !important;
  color: #222 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3) !important;
}

#reset-score-btn:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

#reset-score-btn:active {
  transform: translateY(0px);
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.2) !important;
}

/* Ícones opcionais para os botões */
#close-modal-btn::before {
  content: '😊';
  font-size: 1em;
  margin-right: 6px;
}

#reset-score-btn::before {
  content: '🔄';
  font-size: 1em;
  margin-right: 6px;
}

/* Remover ripple effect do Material Design */
#close-modal-btn .mdc-button__ripple,
#reset-score-btn .mdc-button__ripple {
  display: none !important;
}

/* Container dos botões do modal */
#fullscreenModal .guide-btn,
#fullscreenModal button {
  margin: 8px;
}

/* Responsividade para os botões do modal */
@media (max-width: 768px) {
  #close-modal-btn,
  #reset-score-btn {
    padding: 10px 20px;
    font-size: 0.95em;
    min-width: 120px;
    margin: 4px;
  }
}

@media (max-width: 480px) {
  #close-modal-btn,
  #reset-score-btn {
    padding: 10px 18px;
    font-size: 0.9em;
    min-width: 100px;
    margin: 3px;
    width: calc(50% - 6px);
    max-width: 200px;
  }
  
  /* Stack vertical em telas muito pequenas */
  #fullscreenModal .celebration-content {
    flex-direction: column;
  }
}
