/* === DASHBOARD 3D MOAI - LAYOUT UNIFICADO === */

/* Base mantida do original */
.dashboard-3d {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #0a4b78 0%, #1e3a5f 50%, #2c5f7c 100%);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* === LOADING SCREEN MELHORADO === */
.loading-screen-3d {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0a4b78 0%, #1e3a5f 30%, #2c5f7c 70%, #0a4b78 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.8s ease-out;
  overflow: hidden;
}

/* Ondas de fundo animadas */
.loading-screen-3d::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 200px;
  background: linear-gradient(0deg, rgba(0, 188, 212, 0.3) 0%, transparent 100%);
  animation: loadingWaves 4s ease-in-out infinite;
}

.loading-screen-3d::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
  background: linear-gradient(0deg, rgba(0, 150, 136, 0.2) 0%, transparent 100%);
  animation: loadingWaves 4s ease-in-out infinite reverse;
  animation-delay: 2s;
}

@keyframes loadingWaves {
  0%,
  100% {
    transform: translateY(0px) scaleY(1);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-20px) scaleY(1.1);
    opacity: 0.6;
  }
}

.loading-content {
  text-align: center;
  color: white;
  z-index: 10001;
  position: relative;
  max-width: 400px;
  padding: 40px 20px;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
  border-radius: 30px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Spinner MOAI temático */
.spinner-3d {
  width: 80px;
  height: 80px;
  margin: 0 auto 30px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-3d::before {
  content: "🗿";
  font-size: 40px;
  position: absolute;
  animation: moaiSpin 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.spinner-3d::after {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  border: 3px solid transparent;
  border-top: 3px solid #4fc3f7;
  border-right: 3px solid #29b6f6;
  border-radius: 50%;
  animation: spinRing 1.5s linear infinite;
  box-shadow: 0 0 20px rgba(79, 195, 247, 0.3);
}

@keyframes moaiSpin {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-10deg) scale(1.1);
  }
  50% {
    transform: rotate(0deg) scale(1.2);
  }
  75% {
    transform: rotate(10deg) scale(1.1);
  }
}

@keyframes spinRing {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Partículas flutuantes */
.loading-content::before {
  content: "";
  position: absolute;
  top: -50px;
  left: -50px;
  right: -50px;
  bottom: -50px;
  background: radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.1) 2px, transparent 2px),
    radial-gradient(circle at 80% 20%, rgba(0, 188, 212, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 60% 80%, rgba(76, 175, 80, 0.1) 1.5px, transparent 1.5px),
    radial-gradient(circle at 30% 70%, rgba(255, 215, 0, 0.08) 1px, transparent 1px);
  background-size: 100px 100px, 150px 150px, 120px 120px, 80px 80px;
  animation: floatingParticles 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes floatingParticles {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-10px) rotate(180deg);
    opacity: 1;
  }
}

/* Textos melhorados */
.loading-content p {
  font-size: 1.2rem;
  margin: 15px 0;
  opacity: 0.9;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  animation: textPulse 2s ease-in-out infinite;
  letter-spacing: 0.5px;
}

@keyframes textPulse {
  0%,
  100% {
    opacity: 0.9;
    transform: translateY(0px);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

/* Barra de progresso simulada */
.loading-content::after {
  content: "";
  position: absolute;
  bottom: 20px;
  left: 30px;
  right: 30px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.loading-content::after {
  background: linear-gradient(90deg, transparent 0%, #4fc3f7 25%, #29b6f6 50%, #03a9f4 75%, transparent 100%);
  animation: progressBar 3s ease-in-out infinite;
}

@keyframes progressBar {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Efeito de brilho no container */
.loading-content {
  position: relative;
  overflow: hidden;
}

.loading-content::before {
  background: radial-gradient(circle at 20% 30%, rgba(255, 215, 0, 0.1) 2px, transparent 2px),
    radial-gradient(circle at 80% 20%, rgba(0, 188, 212, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 60% 80%, rgba(76, 175, 80, 0.1) 1.5px, transparent 1.5px),
    radial-gradient(circle at 30% 70%, rgba(255, 215, 0, 0.08) 1px, transparent 1px),
    linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
  background-size: 100px 100px, 150px 150px, 120px 120px, 80px 80px, 200% 200%;
  animation: floatingParticles 6s ease-in-out infinite, shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
  0%,
  100% {
    background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, -200% -200%;
  }
  50% {
    background-position: 100% 100%, 50% 50%, 75% 75%, 25% 25%, 200% 200%;
  }
}

/* Responsividade do loading */
@media (max-width: 768px) {
  .loading-content {
    max-width: 350px;
    padding: 30px 15px;
    margin: 0 20px;
  }

  .spinner-3d {
    width: 70px;
    height: 70px;
    margin-bottom: 25px;
  }

  .spinner-3d::before {
    font-size: 35px;
  }

  .spinner-3d::after {
    width: 70px;
    height: 70px;
  }

  .loading-content p {
    font-size: 1.1rem;
    margin: 12px 0;
  }
}

@media (max-width: 480px) {
  .loading-content {
    max-width: 300px;
    padding: 25px 15px;
    border-radius: 20px;
  }

  .spinner-3d {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
  }

  .spinner-3d::before {
    font-size: 30px;
  }

  .spinner-3d::after {
    width: 60px;
    height: 60px;
    border-width: 2px;
  }

  .loading-content p {
    font-size: 1rem;
    margin: 10px 0;
    letter-spacing: 0.3px;
  }
}

/* === OCEANO === */
.ocean-background-smooth {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
  overflow: hidden;
  z-index: 1;
}

.ocean-wave-smooth {
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 200%;
  height: 60px;
  background: linear-gradient(90deg, transparent, rgba(0, 188, 212, 0.2), transparent);
  border-radius: 50%;
  animation: oceanWave 6s ease-in-out infinite;
}

.wave-smooth-1 {
  animation-delay: 0s;
  height: 50px;
}
.wave-smooth-2 {
  animation-delay: 1.5s;
  height: 40px;
  opacity: 0.7;
}
.wave-smooth-3 {
  animation-delay: 3s;
  height: 30px;
  opacity: 0.5;
}
.wave-smooth-4 {
  animation-delay: 4.5s;
  height: 20px;
  opacity: 0.3;
}

@keyframes oceanWave {
  0%,
  100% {
    transform: translateX(0) scaleY(1);
  }
  50% {
    transform: translateX(50%) scaleY(1.1);
  }
}

/* === EFEITOS DE EVOLUÇÃO === */
.moai-evolution-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5000;
}

.evolution-mystic-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
  animation: mysticPulse 3s ease-in-out infinite;
}

@keyframes mysticPulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.6;
  }
}

.evolution-golden-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="%23ffd700" opacity="0.8"><animate attributeName="opacity" values="0;1;0" dur="2s" repeatCount="indefinite"/></circle><circle cx="80" cy="30" r="1" fill="%23ffd700" opacity="0.6"><animate attributeName="opacity" values="0;1;0" dur="3s" repeatCount="indefinite"/></circle><circle cx="60" cy="70" r="1" fill="%23ffd700" opacity="0.7"><animate attributeName="opacity" values="0;1;0" dur="2.5s" repeatCount="indefinite"/></circle></svg>');
  animation: particleFloat 4s ease-in-out infinite;
}

@keyframes particleFloat {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.evolution-status-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.status-icon-glorioso {
  font-size: 2rem;
  margin-bottom: 10px;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.status-text-glorioso {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 15px;
}

.status-progress-ring {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(255, 215, 0, 0.3);
  border-top: 3px solid #ffd700;
  border-radius: 50%;
  animation: spin 2s linear infinite;
  margin: 0 auto;
}

/* === BOTÃO DE UPGRADE MELHORADO === */
.upgrade-btn-3d-enhanced {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
  border: none;
  border-radius: 15px;
  padding: 12px 20px;
  cursor: pointer;
  z-index: 2000;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: white;
  font-weight: bold;
  min-width: 80px;
}

.upgrade-btn-3d-enhanced:hover {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 12px 35px rgba(255, 107, 53, 0.6);
}

.btn-icon-enhanced {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upgrade-tool-icon {
  width: 28px;
  height: 28px;
  filter: brightness(0) invert(1);
}

.btn-text-enhanced {
  font-size: 0.8rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* === HUD OVERLAY MELHORADA === */
.hud-overlay-enhanced {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

.hud-overlay-enhanced > * {
  pointer-events: auto;
}

/* === ISLAND BADGE - TOPO CENTRO === */
.island-badge-tropical-enhanced {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(0, 150, 136, 0.9) 0%, rgba(0, 121, 107, 0.9) 100%);
  backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
  color: white;
  z-index: 1001;
}

.tropical-leaf,
.tropical-palm {
  font-size: 1.2rem;
  animation: leafSway 3s ease-in-out infinite;
}

.tropical-palm {
  animation-delay: 1.5s;
}

@keyframes leafSway {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(5deg);
  }
}

.island-info-tropical {
  text-align: center;
}

.island-name-tropical {
  display: block;
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.island-subtitle-tropical {
  display: block;
  font-size: 0.8rem;
  opacity: 0.8;
  letter-spacing: 1px;
}

/* === BARRA DE RECURSOS UNIFICADA === */
.all-resources-bar-enhanced {
  position: absolute;
  top: 120px; /* Aumentado de 100px para 120px */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 1001;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 90%;
}

.resource-item-unified {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 60px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  color: white;
  justify-content: center;
}

.resource-item-unified:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.resource-item-unified.pulsing {
  animation: resourcePulse 0.6s ease-in-out;
}

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

.resource-icon-unified {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.resource-value-unified {
  font-size: 0.9rem;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-variant-numeric: tabular-nums;
}

.resource-label-unified {
  font-size: 0.7rem;
  opacity: 0.8;
  margin-left: 2px;
}

/* Cores específicas para recursos principais */
.resource-item-unified.moaicoins {
  border-color: rgba(255, 215, 0, 0.4);
  background: rgba(255, 215, 0, 0.15);
}

.resource-item-unified.moaimoney {
  border-color: rgba(76, 175, 80, 0.4);
  background: rgba(76, 175, 80, 0.15);
}

.resource-item-unified.experience {
  border-color: rgba(156, 39, 176, 0.4);
  background: rgba(156, 39, 176, 0.15);
}

/* Recursos secundários mantêm estilo padrão */
.resource-item-unified.energia,
.resource-item-unified.ferramenta,
.resource-item-unified.criatividade {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

/* === BOTTOM HUD === */
.bottom-hud-safe-enhanced {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1001;
}

.level-progress-tropical-enhanced {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  padding: 18px 30px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  min-width: 360px;
}

.level-badge-tropical-enhanced {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.1) 100%);
  border: 2px solid rgba(255, 215, 0, 0.3);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  position: relative;
  animation: levelGlow 3s ease-in-out infinite;
}

@keyframes levelGlow {
  0%,
  100% {
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
  }
}

.level-icon-img {
  width: 24px;
  height: 24px;
  /* SEM filtro branco - mantém cor original */
  margin-bottom: 2px;
}

.level-number-compact {
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.progress-bar-tropical-enhanced {
  flex: 1;
  height: 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-fill-tropical-enhanced {
  height: 100%;
  background: linear-gradient(90deg, #4fc3f7 0%, #29b6f6 50%, #03a9f4 100%);
  border-radius: 6px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-shine {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.xp-info-tropical-enhanced {
  text-align: right;
  color: white;
  min-width: 100px;
}

.xp-info-tropical-enhanced span {
  display: block;
  font-size: 1rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.tropical-text {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 2px;
}

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {
  .island-badge-tropical-enhanced {
    top: 15px;
    padding: 12px 24px;
    gap: 12px;
  }

  .island-name-tropical {
    font-size: 1.1rem;
  }

  .island-subtitle-tropical {
    font-size: 0.75rem;
  }

  .all-resources-bar-enhanced {
    top: 95px; /* Aumentado de 80px para 95px */
    gap: 6px;
    max-width: 95%;
  }

  .resource-item-unified {
    min-width: 55px;
    padding: 6px 10px;
    gap: 4px;
  }

  .resource-icon-unified {
    width: 18px;
    height: 18px;
  }

  .resource-value-unified {
    font-size: 0.8rem;
  }

  .resource-label-unified {
    font-size: 0.65rem;
  }

  .level-progress-tropical-enhanced {
    min-width: 320px;
    padding: 15px 25px;
    gap: 15px;
  }

  .level-badge-tropical-enhanced {
    width: 55px;
    height: 55px;
  }

  .level-icon-img {
    width: 22px;
    height: 22px;
  }

  .level-number-compact {
    font-size: 1.1rem;
  }

  .upgrade-btn-3d-enhanced {
    padding: 10px 16px;
    min-width: 70px;
  }

  .btn-icon-enhanced {
    width: 28px;
    height: 28px;
  }

  .upgrade-tool-icon {
    width: 24px;
    height: 24px;
  }

  .btn-text-enhanced {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .island-badge-tropical-enhanced {
    top: 10px;
    padding: 10px 20px;
    gap: 10px;
  }

  .island-name-tropical {
    font-size: 1rem;
  }

  .island-subtitle-tropical {
    font-size: 0.7rem;
  }

  .all-resources-bar-enhanced {
    top: 85px; /* Aumentado de 70px para 85px */
    gap: 4px;
    max-width: 98%;
  }

  .resource-item-unified {
    min-width: 50px;
    padding: 5px 8px;
    gap: 3px;
  }

  .resource-icon-unified {
    width: 16px;
    height: 16px;
  }

  .resource-value-unified {
    font-size: 0.75rem;
  }

  .resource-label-unified {
    font-size: 0.6rem;
  }

  .level-progress-tropical-enhanced {
    min-width: 280px;
    padding: 12px 20px;
    gap: 12px;
  }

  .level-badge-tropical-enhanced {
    width: 50px;
    height: 50px;
  }

  .level-icon-img {
    width: 20px;
    height: 20px;
  }

  .level-number-compact {
    font-size: 1rem;
  }

  .bottom-hud-safe-enhanced {
    bottom: 70px;
  }

  .upgrade-btn-3d-enhanced {
    padding: 8px 12px;
    min-width: 60px;
  }

  .btn-icon-enhanced {
    width: 24px;
    height: 24px;
  }

  .upgrade-tool-icon {
    width: 20px;
    height: 20px;
  }

  .btn-text-enhanced {
    font-size: 0.7rem;
  }
}

/* === OTIMIZAÇÕES DE PERFORMANCE === */
.dashboard-3d,
.hud-overlay-enhanced,
.ocean-background-smooth,
.moai-evolution-effects {
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
}

.ocean-wave-smooth,
.progress-fill-tropical-enhanced {
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
