/* ==========================================================================
   Estilos Gerais (Body e Base)
   ========================================================================== */
body {
    background: #1A2525;
    color: #F5F5F5;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    overflow: hidden;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==========================================================================
   Transição de Página
   ========================================================================== */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1A2525;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

.page-transition.fade-in {
    opacity: 1;
    pointer-events: auto;
}

.page-transition.fade-out {
    opacity: 0;
}

/* ==========================================================================
   Animação de Fundo
   ========================================================================== */
.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    opacity: 0;
    transform: scale(1.15);
    animation: 
        driftZoom 54s infinite linear,
        fadeLoop 18s infinite ease-in-out;
}

/* Delays para sincronização */
#bg-image1 { animation-delay: 0s, 0s; }
#bg-image2 { animation-delay: -6s, -9s; }
#bg-image3 { animation-delay: -12s, -18s; }

@keyframes fadeLoop {
    0% { opacity: 0; }
    5% { opacity: 0.4; }
    15% { opacity: 1; }
    35% { opacity: 1; }
    50% { opacity: 0.7; }
    65% { opacity: 0.3; }
    80% { opacity: 0; }
    100% { opacity: 0; }
}

#bg-image1 {
    animation: 
        fadeLoop 18s 0s infinite ease-in-out,
        driftZoom 54s linear infinite;
}

#bg-image2 {
    animation: 
        fadeLoop 18s -6s infinite ease-in-out,
        driftZoom 54s linear reverse infinite;
}

#bg-image3 {
    animation: 
        fadeLoop 18s -12s infinite ease-in-out,
        driftZoom 54s linear alternate infinite;
}

@keyframes driftZoom {
    0% { transform: scale(1.15) translate(0,0) rotate(0deg); }
    25% { transform: scale(1.20) translate(2%,1%) rotate(1deg); }
    50% { transform: scale(1.23) translate(-1%,-1.5%) rotate(-0.5deg); }
    75% { transform: scale(1.18) translate(1.5%,0.8%) rotate(0.7deg); }
    100% { transform: scale(1.15) translate(0,0) rotate(0deg); }
}

/* ==========================================================================
   Navegação (nav-flow)
   ========================================================================== */
.nav-flow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.nav-flow a {
    position: absolute;
    color: #F5F5F5;
    text-decoration: none;
    font-size: 1.5em;
    font-weight: 300;
    padding: 8px 12px;
    border-radius: 15% 40% 25% 55%;
    transition: all 0.5s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.0);
}

.nav-flow a:hover {
    color: #FFD700;
}

.nav-flow a.chaos1 { animation: chaos1 100s infinite ease-in-out !important; }
.nav-flow a.chaos2 { animation: chaos2 96s infinite ease-in-out !important; }
.nav-flow a.chaos6 { animation: chaos6 102s infinite ease-in-out !important; }
.nav-flow a.chaos7 { animation: chaos7 97s infinite ease-in-out !important; }

/* ==========================================================================
   Texto Flutuante (floating-text)
   ========================================================================== */
.floating-text {
    position: absolute;
    font-size: 1.5em;
    font-weight: 300;
    z-index: 2;
    color: #F5F5F5;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 15% 40% 25% 55%;
    transition: color 0.5s ease, background 0.5s ease;
}

.floating-text:hover {
    color: #FFD700;
}

.floating-text.chaos10 { 
    bottom: 20%;
    left: 20%;
    animation: chaos10 98s infinite ease-in-out !important;
}

.floating-text.chaos11 { animation: chaos11 96s infinite ease-in-out !important; }
.floating-text.chaos12 { animation: chaos12 94s infinite ease-in-out !important; }
.floating-text.chaos13 { animation: chaos13 104s infinite ease-in-out !important; }
.floating-text.chaos14 { animation: chaos14 98s infinite ease-in-out !important; }

.floating-text.chaos15 { 
    bottom: 15%;
    left: 5%;
    animation: subtleChaos15 98s infinite ease-in-out !important;
}

/* ==========================================================================
   Animações de Navegação
   ========================================================================== */
@keyframes chaos1 {
    0% { top: 15%; left: 25%; transform: rotate(0deg); }
    20% { top: 40%; left: 60%; transform: rotate(20deg); }
    40% { top: 70%; left: 20%; transform: rotate(-15deg); }
    60% { top: 30%; left: 10%; transform: rotate(10deg); }
    80% { top: 50%; left: 50%; transform: rotate(-5deg); }
    100% { top: 15%; left: 25%; transform: rotate(0deg); }
}

@keyframes chaos2 {
    0% { top: 35%; right: 20%; transform: rotate(0deg); }
    20% { top: 60%; right: 50%; transform: rotate(-25deg); }
    40% { top: 20%; right: 10%; transform: rotate(15deg); }
    60% { top: 50%; right: 30%; transform: rotate(-10deg); }
    80% { top: 10%; right: 60%; transform: rotate(20deg); }
    100% { top: 35%; right: 20%; transform: rotate(0deg); }
}

@keyframes chaos3 {
    0% { bottom: 25%; right: 15%; transform: rotate(0deg); }
    20% { bottom: 50%; right: 40%; transform: rotate(10deg); }
    40% { bottom: 10%; right: 60%; transform: rotate(-20deg); }
    60% { bottom: 70%; right: 20%; transform: rotate(15deg); }
    80% { bottom: 30%; right: 10%; transform: rotate(-5deg); }
    100% { bottom: 25%; right: 15%; transform: rotate(0deg); }
}

@keyframes chaos4 {
    0% { bottom: 20%; left: 30%; transform: rotate(0deg); }
    20% { bottom: 60%; left: 10%; transform: rotate(-15deg); }
    40% { bottom: 40%; left: 50%; transform: rotate(25deg); }
    60% { bottom: 10%; left: 70%; transform: rotate(-10deg); }
    80% { bottom: 50%; left: 20%; transform: rotate(20deg); }
    100% { bottom: 20%; left: 30%; transform: rotate(0deg); }
}

@keyframes chaos6 {
    0% { top: 25%; left: 35%; transform: rotate(0deg); }
    20% { top: 50%; left: 15%; transform: rotate(-20deg); }
    40% { top: 65%; left: 55%; transform: rotate(15deg); }
    60% { top: 20%; left: 65%; transform: rotate(-15deg); }
    80% { top: 45%; left: 25%; transform: rotate(10deg); }
    100% { top: 25%; left: 35%; transform: rotate(0deg); }
}

@keyframes chaos7 {
    0% { bottom: 30%; left: 20%; transform: rotate(0deg); }
    20% { bottom: 45%; left: 60%; transform: rotate(25deg); }
    40% { bottom: 15%; left: 30%; transform: rotate(-10deg); }
    60% { bottom: 60%; left: 10%; transform: rotate(20deg); }
    80% { bottom: 25%; left: 50%; transform: rotate(-5deg); }
    100% { bottom: 30%; left: 20%; transform: rotate(0deg); }
}

@keyframes chaos10 {
    0% { bottom: 20%; left: 20%; transform: rotate(0deg); }
    20% { bottom: 50%; left: 40%; transform: rotate(15deg); }
    40% { bottom: 30%; left: 60%; transform: rotate(-10deg); }
    60% { bottom: 60%; left: 30%; transform: rotate(20deg); }
    80% { bottom: 40%; left: 10%; transform: rotate(-5deg); }
    100% { bottom: 20%; left: 20%; transform: rotate(0deg); }
}

@keyframes chaos11 {
    0% { top: 15%; right: 20%; transform: rotate(0deg); }
    20% { top: 40%; right: 50%; transform: rotate(-15deg); }
    40% { top: 60%; right: 30%; transform: rotate(20deg); }
    60% { top: 20%; right: 60%; transform: rotate(-10deg); }
    80% { top: 50%; right: 40%; transform: rotate(15deg); }
    100% { top: 15%; right: 20%; transform: rotate(0deg); }
}

@keyframes chaos12 {
    0% { top: 30%; right: 10%; transform: rotate(0deg); }
    20% { top: 60%; right: 30%; transform: rotate(20deg); }
    40% { top: 20%; right: 50%; transform: rotate(-15deg); }
    60% { top: 50%; right: 20%; transform: rotate(10deg); }
    80% { top: 40%; right: 60%; transform: rotate(-5deg); }
    100% { top: 30%; right: 10%; transform: rotate(0deg); }
}

@keyframes chaos13 {
    0% { bottom: 30%; right: 20%; transform: rotate(0deg); }
    20% { bottom: 50%; right: 40%; transform: rotate(10deg); }
    40% { bottom: 10%; right: 60%; transform: rotate(-20deg); }
    60% { bottom: 70%; right: 20%; transform: rotate(15deg); }
    80% { bottom: 30%; right: 10%; transform: rotate(-5deg); }
    100% { bottom: 30%; right: 20%; transform: rotate(0deg); }
}

@keyframes chaos14 {
    0% { bottom: 25%; left: 15%; transform: rotate(0deg); }
    20% { bottom: 60%; left: 10%; transform: rotate(-15deg); }
    40% { bottom: 40%; left: 50%; transform: rotate(25deg); }
    60% { bottom: 10%; left: 70%; transform: rotate(-10deg); }
    80% { bottom: 50%; left: 20%; transform: rotate(20deg); }
    100% { bottom: 25%; left: 15%; transform: rotate(0deg); }
}

@keyframes subtleChaos15 {
    0% { bottom: 15%; left: 5%; transform: rotate(0deg); }
    20% { bottom: 17%; left: 7%; transform: rotate(-4deg); }
    40% { bottom: 19%; left: 6%; transform: rotate(3deg); }
    60% { bottom: 16%; left: 8%; transform: rotate(-5deg); }
    80% { bottom: 18%; left: 6%; transform: rotate(2deg); }
    100% { bottom: 15%; left: 5%; transform: rotate(0deg); }
}

/* ==========================================================================
   Palavras Flutuantes (word-sea, usado em index.html)
   ========================================================================== */
.word-sea {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    box-sizing: border-box;
}

.word {
    position: absolute;
    color: #F5F5F5;
    white-space: nowrap;
    opacity: 0.7;
    transform-origin: center;
    will-change: transform;
}

.word.entering {
    opacity: 0;
    transition: opacity 2s ease-in-out;
}

.word.entering:not(.exiting) {
    opacity: 0.7;
}

.word.exiting {
    opacity: 0;
    transition: opacity 2s ease-out;
}

@keyframes wave {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -10px) rotate(5deg); }
    50% { transform: translate(-10px, 10px) rotate(-5deg); }
    75% { transform: translate(10px, 10px) rotate(3deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* ==========================================================================
   Pop-up Inicial (index.html)
   ========================================================================== */
.intro-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 37, 37, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.intro-popup.visible {
    opacity: 1;
}

.intro-popup .popup-content {
    background: rgba(42, 53, 53, 0.5);
    padding: 30px;
    border-radius: 15px;
    max-width: 650px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto; /* Enable vertical scrolling */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.intro-popup .popup-text {
    color: #F5F5F5;
    font-size: 1.2em;
    font-weight: 300;
    line-height: 1.6;
    text-align: justify;
    margin-bottom: 20px;
    opacity: 0.85;
}

.intro-popup .popup-text h1 {
    font-size: 1.8em;
    font-weight: 400;
    text-align: center;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.intro-popup .popup-text p {
    margin-bottom: 15px;
}

.intro-popup .popup-text em {
    font-style: italic;
}

.intro-popup .popup-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.intro-popup .explore-popup {
    background: none;
    color: #F5F5F5;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 5px 15px;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.intro-popup .explore-popup:hover {
    color: #FFD700;
    border-color: #FFD700;
}

/* ==========================================================================
   Pop-ups (Dissolucao.php)
   ========================================================================== */
.dissolucao-popup#popup-1,
.dissolucao-popup#popup-2,
.dissolucao-popup#popup-3,
.dissolucao-popup#popup-4,
.dissolucao-popup#popup-5,
.dissolucao-popup#popup-6,
.dissolucao-popup#popup-7 {
    justify-content: center;
    align-items: center;
}

/* #popup-1 (imagens verticais) */
.dissolucao-popup#popup-1 .popup-content {
    height: 80vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.dissolucao-popup#popup-1 .popup-image-container {
    position: relative;
    width: 100%;
    height: calc(100% - 50px);
    max-height: calc(80vh - 90px);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.dissolucao-popup#popup-1 .popup-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-height: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
}

/* #popup-2 (imagens horizontais) */
.dissolucao-popup#popup-2 .popup-content {
    height: 80vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.dissolucao-popup#popup-2 .popup-image-container {
    position: relative;
    width: 100%;
    height: calc(100% - 50px);
    max-height: calc(80vh - 90px);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.dissolucao-popup#popup-2 .popup-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: calc(100% - 40px);
    max-height: 100%;
    height: auto;
    width: auto;
    object-fit: contain;
}

/* #popup-3 a #popup-7 (textos) */
.dissolucao-popup#popup-3 .popup-content,
.dissolucao-popup#popup-4 .popup-content,
.dissolucao-popup#popup-5 .popup-content,
.dissolucao-popup#popup-6 .popup-content,
.dissolucao-popup#popup-7 .popup-content {
    height: 80vh;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* ==========================================================================
   Animações de Imagens (Pop-ups)
   ========================================================================== */
.dissolucao-popup#popup-1 .popup-image-1,
.dissolucao-popup#popup-2 .popup-image-1 {
    animation: fadeImage1 14s infinite ease-in-out;
}

.dissolucao-popup#popup-1 .popup-image-2,
.dissolucao-popup#popup-2 .popup-image-2 {
    animation: fadeImage2 14s infinite ease-in-out;
}

@keyframes fadeImage1 {
    0% { opacity: 1; }
    25% { opacity: 0; }
    50% { opacity: 0; }
    75% { opacity: 1; }
    100% { opacity: 1; }
}

@keyframes fadeImage2 {
    0% { opacity: 0; }
    25% { opacity: 1; }
    50% { opacity: 1; }
    75% { opacity: 0; }
    100% { opacity: 0; }
}