/* Loading Screen Styles */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2c5530 0%, #6b8e23 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Fondo animado del loading */
.loading-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.loading-shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.loading-shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.loading-shape-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    right: 10%;
    animation-delay: 2s;
}

.loading-shape-3 {
    width: 150px;
    height: 150px;
    top: 20%;
    right: -75px;
    animation-delay: 4s;
}

.loading-shape-4 {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 5%;
    animation-delay: 1s;
}

.loading-leaf {
    position: absolute;
    font-size: 2rem;
    opacity: 0.3;
    animation: float-leaf 8s ease-in-out infinite;
}

.loading-leaf-1 {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.loading-leaf-2 {
    top: 60%;
    right: 15%;
    animation-delay: 3s;
}

.loading-leaf-3 {
    bottom: 10%;
    left: 20%;
    animation-delay: 6s;
}

/* Contenido del loading */
.loading-content {
    text-align: center;
    color: white;
    z-index: 2;
}

/* .loading-logo {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
} */

.loading-logo {
    width: 450px;
    height: 200px;
    margin: 0 auto 10px auto; /* Centrado horizontal */
    animation: pulse 2s ease-in-out infinite;
    display: block; /* Asegura que funcione margin auto */
}

.loading-logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.loading-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    font-family: 'Montserrat', sans-serif;
}

.loading-subtitle {
    font-size: 1.8rem;
    margin-bottom: 40px;
    font-weight: 700;
    opacity: 0.9;
    font-family: 'Montserrat', sans-serif;
}

/* Spinner personalizado */
.forest-spinner {
    width: 80px;
    height: 80px;
    position: relative;
    margin: 0 auto 30px;
}

.spinner-tree {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    color: #d4af37;
    animation: tree-grow 2s ease-in-out infinite;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top: 3px solid #d4af37;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(3) {
    width: 70%;
    height: 70%;
    border-top: 3px solid #6b8e23;
    animation: spin 1s linear infinite reverse;
}

.spinner-ring:nth-child(4) {
    width: 40%;
    height: 40%;
    border-top: 3px solid #2c5530;
    animation: spin 0.5s linear infinite;
}

/* Barra de progreso */
.progress-container {
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin: 20px auto;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #d4af37, #6b8e23);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progress-grow 3s ease-in-out;
}

/* Mensajes de carga aleatorios */
.loading-messages {
    margin-top: 20px;
    min-height: 40px;
}

.loading-message {
    font-size: 0.9rem;
    opacity: 0.8;
    animation: message-fade 3s ease-in-out infinite;
}

/* Animaciones */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes tree-grow {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2);
    }
}

@keyframes progress-grow {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

@keyframes message-fade {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

@keyframes float-leaf {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    33% {
        transform: translateY(-30px) rotate(120deg) scale(1.1);
    }

    66% {
        transform: translateY(15px) rotate(240deg) scale(0.9);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Efectos de partículas para loading */
.loading-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: particle-float 3s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .loading-title {
        font-size: 2rem;
    }

    .loading-subtitle {
        font-size: 1.2rem;
    }

    .progress-container {
        width: 250px;
    }

    .forest-spinner {
        width: 60px;
        height: 60px;
    }

    .spinner-tree {
        font-size: 2rem;
    }
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .loading-logo {
        width: 80%;
        max-width: 200px;
        margin: 0 auto 15px;
    }
    
    .loading-logo img {
        width: 100%;
        height: auto;
        object-fit: contain;
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    }
    
    .loading-title {
        font-size: 2rem;
    }
    
    .loading-subtitle {
        font-size: 1.2rem;
    }
    
    .forest-spinner {
        width: 60px;
        height: 60px;
    }
    
    .progress-container {
        width: 250px;
    }
}

@media (max-width: 480px) {
    .loading-logo {
        width: 70%;
        max-width: 150px;
        margin-bottom: 10px;
    }
    
    .loading-logo img {
        width: 100%;
        height: auto;
    }
    
    .loading-title {
        font-size: 1.8rem;
    }
    
    .loading-subtitle {
        font-size: 1.0rem;
    }
    
    .progress-container {
        width: 200px;
    }
}
