/**
 * Estilos do Sistema Dia/Noite
 */

/* Overlay de iluminação */
.day-night-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  pointer-events: none;
  transition: all 2s ease-in-out;
  will-change: background, opacity;
}

/* Corpo celestial (sol/lua) */
.celestial-body {
  position: fixed;
  z-index: -1;
  font-size: 80px;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8));
  transition: all 1s ease-in-out;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.celestial-body--sun {
  animation: sunRotate 20s linear infinite, sunPulse 4s ease-in-out infinite;
}

.celestial-body--moon {
  animation: moonFloat 6s ease-in-out infinite, moonGlow 3s ease-in-out infinite;
}

@keyframes sunRotate {
  from {
    filter: drop-shadow(0 0 20px rgba(255, 220, 100, 0.8)) hue-rotate(0deg);
  }
  to {
    filter: drop-shadow(0 0 20px rgba(255, 220, 100, 0.8)) hue-rotate(360deg);
  }
}

@keyframes sunPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
  }
}

@keyframes moonFloat {
  0%, 100% {
    transform: translate(-50%, -50%) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) translateY(-10px);
  }
}

@keyframes moonGlow {
  0%, 100% {
    filter: drop-shadow(0 0 20px rgba(200, 200, 255, 0.6));
  }
  50% {
    filter: drop-shadow(0 0 30px rgba(200, 200, 255, 1));
  }
}

/* Estrelas da noite */
.night-stars {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none;
  animation: starsAppear 2s ease-in-out;
}

@keyframes starsAppear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.night-star {
  position: absolute;
  width: 3px;
  height: 3px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
  animation: starTwinkle 2s ease-in-out infinite;
}

.night-star:nth-child(odd) {
  width: 2px;
  height: 2px;
}

.night-star:nth-child(3n) {
  width: 4px;
  height: 4px;
  box-shadow: 0 0 6px rgba(255, 255, 255, 1);
}

@keyframes starTwinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Ajustes por período */
.period-morning .dashboard__header {
  background: linear-gradient(135deg, rgba(255, 234, 167, 0.9), rgba(253, 203, 110, 0.9));
  box-shadow: 0 4px 20px rgba(255, 234, 167, 0.3);
}

.period-afternoon .dashboard__header {
  background: linear-gradient(135deg, rgba(116, 185, 255, 0.9), rgba(162, 155, 254, 0.9));
  box-shadow: 0 4px 20px rgba(116, 185, 255, 0.3);
}

.period-evening .dashboard__header {
  background: linear-gradient(135deg, rgba(253, 121, 168, 0.9), rgba(253, 203, 110, 0.9));
  box-shadow: 0 4px 20px rgba(253, 121, 168, 0.3);
}

.period-night .dashboard__header {
  background: linear-gradient(135deg, rgba(12, 36, 97, 0.9), rgba(30, 55, 153, 0.9));
  box-shadow: 0 4px 20px rgba(12, 36, 97, 0.5);
  color: #e0e0e0;
}

/* Indicador de período */
.period-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 0.8rem 1.2rem;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  z-index: 100;
  animation: indicatorSlideIn 0.5s ease-out;
}

@keyframes indicatorSlideIn {
  from {
    transform: translateX(100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.period-indicator__icon {
  font-size: 1.5rem;
  animation: iconBob 2s ease-in-out infinite;
}

.period-indicator__text {
  color: #333;
}

.period-night .period-indicator {
  background: rgba(30, 55, 153, 0.95);
}

.period-night .period-indicator__text {
  color: #e0e0e0;
}

/* Efeitos no Pukito baseado no período */
.period-night .pukito-character {
  filter: brightness(0.8);
}

.period-night .pukito-character::after {
  content: '💤';
  position: absolute;
  top: -30px;
  right: -20px;
  font-size: 24px;
  animation: zzz 2s ease-in-out infinite;
}

@keyframes zzz {
  0% {
    opacity: 0;
    transform: translateY(0) translateX(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-10px) translateX(5px);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px) translateX(10px);
  }
}

.period-morning .pukito-character {
  filter: brightness(1.1);
}

/* Efeitos nos botões */
.period-night .btn--primary {
  background: linear-gradient(145deg, #4a69bd, #3c5aa6);
  border-bottom-color: #2c4789;
}

.period-morning .btn--primary {
  background: linear-gradient(145deg, #ffeaa7, #fdcb6e);
  border-bottom-color: #e5b55d;
  color: #333;
}

/* Transição de período */
.period-transition {
  animation: periodTransition 2s ease-in-out;
}

@keyframes periodTransition {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
    filter: blur(2px);
  }
}

/* Responsividade */
@media (max-width: 768px) {
  .celestial-body {
    font-size: 60px;
  }
  
  .period-indicator {
    top: 10px;
    right: 10px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  .period-indicator__icon {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .celestial-body {
    font-size: 50px;
  }
  
  .period-indicator {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .period-indicator__icon {
    font-size: 1rem;
  }
  
  .night-star {
    width: 2px;
    height: 2px;
  }
}
