/* public/style.css - Versão Otimizada */

/* Variáveis CSS Organizadas */
:root {
  /* Cores Principais */
  --primary: #6a5af9;
  --secondary: #d66efd;
  --accent: #4ce0b3;
  --dark: #2d2b55;
  --light: #f8f9ff;
  --text: #33334d;
  --error: #e74c3c;
  
  /* Espaçamentos */
  --space-xs: 5px;
  --space-sm: 10px;
  --space-md: 20px;
  --space-lg: 30px;
  --space-xl: 40px;
  
  /* Bordas */
  --radius-sm: 10px;
  --radius-md: 15px;
  --radius-lg: 20px;
  
  /* Sombras */
  --shadow-sm: 0 5px 15px rgba(106, 90, 249, 0.3);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.12);
}

/* Reset Melhorado */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base Styles */
body {
  font-family: 'Quicksand', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e7f1 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow-x: hidden;
  
  /* Prevenção de seleção */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Background Animado Otimizado */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 20%, rgba(106, 90, 249, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(214, 110, 253, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(76, 224, 179, 0.15) 0%, transparent 50%);
  opacity: 0.6;
  z-index: -1;
}

/* Container Principal Refatorado */
.container {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 700px;
  padding: var(--space-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-md);
}

.container:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* Borda Superior Colorida */
.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* Tipografia Consistente */
h1, h2 {
  color: var(--dark);
  margin-bottom: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.countdown-card h1 {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.countdown-card h1 i {
  color: var(--primary);
}

/* Contador Otimizado */
#countdown {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 var(--space-xs);
  display: inline-block;
  font-variant-numeric: tabular-nums; /* Melhor alinhamento de números */
}

/* Barra de Progresso Refatorada */
.loading-bar {
  width: 100%;
  height: 12px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 25px 0;
  position: relative;
}

.progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm);
  transition: width 0.3s ease;
  position: relative;
}

/* Área de Conteúdo Melhorada */
.content-area {
  width: 100%;
  background: rgba(248, 249, 255, 0.6);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-top: var(--space-md);
  border: 1px solid rgba(106, 90, 249, 0.1);
  text-align: left;
}

.content-area h2 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}

.scroll-hint {
  font-size: 0.9rem;
  color: #888;
  margin-top: var(--space-md);
  font-style: italic;
  text-align: center;
  animation: subtle-pulse 3s infinite;
}

/* Botão "Continuar" Refatorado */
.next-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  width: 100%;
  max-width: 300px;
  padding: 16px 35px;
  border-radius: 50px;
  font: 700 1.1rem 'Quicksand', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
  margin-top: var(--space-lg);
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* Efeito de brilho no hover */
.next-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.next-button:hover::before {
  left: 100%;
}

/* Estados do Botão */
.next-button:not(:disabled):hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(106, 90, 249, 0.5);
}

.next-button:disabled {
  background: #bdc3c7;
  color: #7f8c8d;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Popup de Alerta Otimizado */
.custom-alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.custom-alert-overlay.active {
  opacity: 1;
  visibility: visible;
}

.custom-alert-box {
  background: white;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
  max-width: 400px;
  width: 90%;
  transform: scale(0.8) translateY(-20px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-alert-overlay.active .custom-alert-box {
  transform: scale(1) translateY(0);
}

.custom-alert-box h3 {
  color: var(--error);
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.custom-alert-box .close-btn {
  margin-top: var(--space-md);
  padding: 12px 30px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

.custom-alert-box .close-btn:hover {
  background: var(--dark);
}

/* Animações Otimizadas */
@keyframes subtle-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes pulse-green {
  0% { box-shadow: 0 0 0 0 rgba(76, 224, 179, 0.7); }
  70% { box-shadow: 0 0 0 15px rgba(76, 224, 179, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 224, 179, 0); }
}

.pulse-animation {
  animation: pulse-green 2s infinite;
}

/* Footer e Elementos Decorativos */
.wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100px;
  background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1200 120" xmlns="http://www.w3.org/2000/svg"><path d="M0 0v46.29c47.79 22.2 103.59 32.17 158 28 70.36-5.37 136.33-33.31 206.8-37.5 73.84-4.36 147.54 16.88 218.2 35.26 69.27 18 138.3 24.88 209.4 13.08 36.15-6 69.85-17.84 104.45-29.34C989.49 25 1113-14.29 1200 52.47V0z" fill="%236a5af922"/></svg>');
  background-size: cover;
  opacity: 0.3;
  z-index: -1;
}

footer {
  margin-top: var(--space-lg);
  color: rgba(0,0,0,0.5);
  font-size: 0.85rem;
  text-align: center;
}

/* Responsividade Melhorada */
@media (max-width: 768px) {
  .container {
    padding: var(--space-lg) var(--space-md);
    margin-bottom: var(--space-sm);
  }
  
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.3rem; }
  
  #countdown {
    font-size: 2rem;
  }
  
  .content-area {
    padding: var(--space-md);
  }
}

@media (max-width: 480px) {
  body {
    padding: var(--space-sm);
  }
  
  .container {
    padding: var(--space-md) var(--space-sm);
    border-radius: var(--radius-md);
  }
  
  .countdown-card h1 {
    font-size: 1.3rem;
    flex-direction: column;
    gap: var(--space-xs);
  }
  
  #countdown {
    font-size: 1.8rem;
  }
  
  .next-button {
    padding: 14px 25px;
    font-size: 1rem;
  }
}

/* Acessibilidade - Foco Visível */
.next-button:focus-visible,
.close-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Performance - Reduz movimento para quem preferir */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}