/**
 * Estilos do Sistema de Quartos/Ambientes
 */

/* Background dos quartos */
.room-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  transition: background 0.6s ease-in-out, opacity 0.3s ease;
  will-change: background, opacity;
}

.room-background.room-transitioning {
  opacity: 0.5;
}

/* Decorações dos quartos */
.room-decorations {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none;
}

.room-decoration {
  position: absolute;
  font-size: 48px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
  animation: decorationAppear 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  opacity: 0.7;
}

@keyframes decorationAppear {
  from {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(0deg);
    opacity: 0.7;
  }
}

/* Alguns elementos têm animação flutuante */
.room-decoration:nth-child(odd) {
  animation: decorationAppear 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55),
             decorationFloat 4s ease-in-out infinite;
  animation-delay: 0s, 0.8s;
}

@keyframes decorationFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(5deg);
  }
}

/* Navegação dos quartos */
.room-navigation {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 30px;
  padding: 0.8rem 1.5rem;
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: navSlideUp 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes navSlideUp {
  from {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.room-navigation__title {
  text-align: center;
  font-size: 0.75rem;
  font-weight: bold;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  opacity: 0.7;
}

.room-navigation__buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* Botões de navegação */
.room-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.8rem 1rem;
  border: none;
  background: rgba(122, 131, 255, 0.1);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  overflow: hidden;
}

.room-nav-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.room-nav-btn:hover::before {
  opacity: 1;
}

.room-nav-btn:hover {
  background: rgba(122, 131, 255, 0.2);
  transform: translateY(-5px) scale(1.05);
  box-shadow: 
    0 8px 20px rgba(122, 131, 255, 0.3),
    0 0 0 2px rgba(122, 131, 255, 0.1);
}

.room-nav-btn:active {
  transform: translateY(-2px) scale(1.02);
}

.room-nav-btn--active {
  background: linear-gradient(135deg, #7a83ff, #5a60f8);
  box-shadow: 
    0 8px 20px rgba(122, 131, 255, 0.4),
    0 0 0 3px rgba(122, 131, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-5px);
}

.room-nav-btn--active .room-nav-btn__icon,
.room-nav-btn--active .room-nav-btn__label {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.room-nav-btn--active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 3px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 2px;
}

.room-nav-btn__icon {
  font-size: 28px;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.room-nav-btn:hover .room-nav-btn__icon {
  transform: scale(1.2) rotate(5deg);
}

.room-nav-btn--active .room-nav-btn__icon {
  animation: iconBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes iconBounce {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.3) rotate(10deg);
  }
}

.room-nav-btn__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #7a83ff;
  white-space: nowrap;
  transition: color 0.3s ease;
}

/* Estilos específicos para cada quarto */
[data-room="living"] {
  --room-accent: #ffd43b;
}

[data-room="bedroom"] {
  --room-accent: #a29bfe;
}

[data-room="bathroom"] {
  --room-accent: #74b9ff;
}

[data-room="garden"] {
  --room-accent: #55efc4;
}

/* Efeito de brilho no quarto ativo */
.room-background[data-room="bedroom"]::after {
  content: '';
  position: absolute;
  top: 10%;
  right: 10%;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent 70%);
  border-radius: 50%;
  animation: moonGlow 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes moonGlow {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.room-background[data-room="garden"]::before {
  content: '';
  position: absolute;
  top: 15%;
  right: 15%;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255, 220, 100, 0.4), transparent 70%);
  border-radius: 50%;
  animation: sunGlow 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes sunGlow {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.15) rotate(180deg);
  }
}

/* Partículas ambiente do banheiro */
.room-background[data-room="bathroom"]::after {
  content: '💧';
  position: absolute;
  top: 20%;
  left: 30%;
  font-size: 24px;
  opacity: 0;
  animation: waterDrop 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes waterDrop {
  0% {
    transform: translateY(-20px);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(100px);
    opacity: 0;
  }
}

/* Responsividade */
@media (max-width: 768px) {
  .room-navigation {
    bottom: 10px;
    padding: 0.6rem 1rem;
    border-radius: 25px;
  }
  
  .room-navigation__title {
    font-size: 0.65rem;
    margin-bottom: 0.3rem;
  }
  
  .room-navigation__buttons {
    gap: 0.3rem;
  }
  
  .room-nav-btn {
    padding: 0.6rem 0.8rem;
    border-radius: 16px;
  }
  
  .room-nav-btn__icon {
    font-size: 24px;
  }
  
  .room-nav-btn__label {
    font-size: 0.65rem;
  }
  
  .room-decoration {
    font-size: 36px;
  }
}

@media (max-width: 480px) {
  .room-navigation {
    width: 95%;
    max-width: 350px;
  }
  
  .room-navigation__buttons {
    gap: 0.2rem;
    justify-content: space-around;
  }
  
  .room-nav-btn {
    padding: 0.5rem 0.6rem;
    gap: 0.2rem;
  }
  
  .room-nav-btn__icon {
    font-size: 20px;
  }
  
  .room-nav-btn__label {
    font-size: 0.6rem;
  }
  
  .room-decoration {
    font-size: 28px;
  }
}

/* Animação ao trocar de quarto */
@keyframes roomChange {
  0% {
    opacity: 1;
    filter: blur(0);
  }
  50% {
    opacity: 0.3;
    filter: blur(10px);
  }
  100% {
    opacity: 1;
    filter: blur(0);
  }
}

.dashboard--changing-room {
  animation: roomChange 0.6s ease-in-out;
}

/* Hint de contexto do quarto */
.room-context-hint {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 2rem;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 100;
  animation: hintFadeIn 0.5s ease-out, hintFadeOut 0.5s ease-in 2.5s;
  animation-fill-mode: forwards;
  pointer-events: none;
}

@keyframes hintFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes hintFadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
}

.room-context-hint h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  color: #7a83ff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.room-context-hint p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}
