@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

:root {
    --primary: #4285f4;
    --primary-hover: #357ae8;
    --accent: #ffca28;
}

html, body {
    font-family: 'Montserrat', sans-serif;
    scroll-behavior: smooth;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.bg-nexus {
    background: #101722;
    background: linear-gradient(180deg, #3d5561 0%, #101722 100%) no-repeat fixed;
    background-size: cover;
}

@property --rotate {
  syntax: "<angle>";
  initial-value: 132deg;
  inherits: false;
}

.animated-card {
  position: relative;
  z-index: 1;
}

.animated-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 3px; /* Espessura da borda solicitada */
  border-radius: 1.5rem; /* Match com o rounded-3xl do Tailwind */
  background-image: linear-gradient(var(--rotate), #5ddcff, #3c67e3 43%, #4e00c2);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: spin 2.5s linear infinite;
}

/* Fallback e refinamento para botões */
button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover {
    transform: translateY(-2px);
}

@keyframes spin {
  0% { --rotate: 0deg; }
  100% { --rotate: 360deg; }
}

/* Chaos to Harmony Animation Styles */
.chaos-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: var(--primary); /* Cor primária */
    border-radius: 50%;
    opacity: 0;
    transition: all 2.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.chaos-line {
    position: absolute;
    height: 1px;
    background: #ffca28;
    opacity: 0;
    transition: opacity 1s ease-in-out, background 2.5s ease-in-out;
    z-index: 1;
    transform-origin: 0 0; /* Importante para a rotação */
    pointer-events: none;
}

/* Estados para a Animação Caos para Harmonia */
.chaos-animation-container.chaos-state-emerge .chaos-particle {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1);
}
.chaos-animation-container.chaos-state-emerge .chaos-line {
    opacity: 0.4;
}

.chaos-animation-container.chaos-state-harmonize .chaos-particle {
    opacity: 1;
    background-color: var(--accent); /* Muda a cor para destaque quando harmonizado */
    transform: translate(-50%, -50%) scale(1.2);
}

.chaos-animation-container.chaos-state-harmonize .chaos-line {
    opacity: 0.4;
}

.chaos-animation-container.chaos-state-fade-out .chaos-particle,
.chaos-animation-container.chaos-state-fade-out .chaos-line {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.1); /* Diminui ao desaparecer */
}

/* Nexus Animation Styles */
.particle {
    position: absolute;
    transition: all 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    color: #94a3b8;
    z-index: 5;
    opacity: 0; /* Base invisível para o fade-in do loop */
}

.particle-inner {
    animation: float 5s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.data-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, #4285f4, transparent);
    width: 100%;
    opacity: 0;
    transition: opacity 1s;
}

/* Revelação suave no início do ciclo */
.state-start .particle {
    opacity: 1;
}

.state-nexus .data-line {
    opacity: 0.3;
}

.state-nexus .particle {
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}

.state-cd .particle {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
}

.state-fade-out .particle,
.state-fade-out .data-line {
    opacity: 0;
    transition: opacity 1.5s;
}

/* Estilos de Revelação Central */
.logo-reveal {
    opacity: 0;
    transform: scale(0.5); /* Inicia pequeno para o efeito zoom */
    transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1); /* Efeito elástico */
}

.state-nexus .nexus-reveal span {
    opacity: 1;
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px rgba(66, 133, 244, 0.8));
}

.state-cd .logo-reveal {
    opacity: 1;
    transform: scale(1);
}

.state-nexus .logo-reveal, 
.state-cd .nexus-reveal span,
.state-fade-out .nexus-reveal span,
.state-fade-out .logo-reveal {
    opacity: 0;
}

/* Modal Polish and Animations */
#nexus-modal.flex {
    animation: fadeIn 0.3s ease-out;
}

#nexus-modal > div {
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoomIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }