
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}


/* ------------------  */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #001040;
    color: white;
    flex-wrap: wrap;
}

#logo {
    flex: 1;
    max-width: 100px;
}

#menu-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}



/* Imagen de la bandera del Ecuador */
#ecuador-flag {
    max-width: 50px;
    margin: 0 10px;
}


#title {
    flex: 1;
    text-align: center;
    font-size: 24px;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav li {
    margin-left: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    border: 2px solid #000;  /* Borde negro */
    border-radius: 5px;  /* Bordes redondeados */
    background-color: #222222;  /* Color de fondo */
    font-weight: bold;
}

nav ul li a:hover {
    color: #fff;  /* Color del texto al pasar el mouse */
}


/* FILTROS */

#filters {
    display: flex;
    justify-content: center; /* Centra los filtros horizontalmente */
    gap: 20px; /* Espacio entre los filtros */
    margin: 20px 0; /* Espaciado vertical */
    text-align: center;
}

#filters label {
    margin: 20px 0; /* Espaciado vertical */
    font-size: 18px; /* Tamaño de fuente */
    font-weight: bold;
    color: #333;
}

#filters select {
    padding: 10px; /* Espaciado interno para hacer los selectores más grandes */
    font-size: 20px; /* Tamaño de fuente */
    border-radius: 8px; /* Bordes redondeados */
    border: 2px solid #333; /* Borde de los selectores */
    background-color: #f0f0f0; /* Color de fondo */
    cursor: pointer; /* Cambia el cursor al pasar sobre los selectores */
    transition: background-color 0.3s ease, border-color 0.3s ease; /* Transiciones suaves */
}

#filters select:hover {
    background-color: #e0e0e0; /* Cambia el color de fondo al pasar el mouse */
    border-color: #555; /* Cambia el color del borde al pasar el mouse */
}

#filters select:focus {
    outline: none;
    border-color: #007BFF; /* Color del borde al enfocar */
    background-color: #f7f7f7;
}



#prev, #next {
    background-color: #007BFF; /* Color de fondo azul */
    color: white; /* Color del texto */
    font-size: 18px; /* Aumenta el tamaño del texto */
    padding: 10px 20px; /* Añade espacio interno */
    border: none; /* Elimina el borde predeterminado */
    border-radius: 8px; /* Bordes redondeados */
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); /* Sombra ligera */
    cursor: pointer; /* Cambia el cursor al pasar sobre el botón */
    transition: background-color 0.3s, transform 0.3s; /* Añade transiciones suaves */
}

#prev:hover, #next:hover {
    background-color: #0056b3; /* Cambia el color al pasar el mouse */
    transform: translateY(-2px); /* Levanta ligeramente el botón */
}

#prev:active, #next:active {
    background-color: #004085; /* Cambia el color al hacer clic */
    transform: translateY(1px); /* Simula la presión del botón */
}




@media (max-width: 768px) {



#ecuador-flag {
        width: 25%; /* Aumenta el tamaño en pantallas más pequeñas */
        max-width: 70px; /* Ancho máximo en pantallas más pequeñas */
    }


#logo {
        margin-bottom: 10px;
    }

    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
    }
    
    nav ul.show {
        display: flex;
    }

    nav li {
        margin: 10px 0;
        text-align: center;
    }

    #menu-toggle {
        display: block;
    }

    header {
        flex-direction: column;
        align-items: center;
    }


    #gallery {
        grid-template-columns: repeat(2, 1fr);
    }

    #gallery img {
        height: 180px; /* Ajusta la altura de las imágenes */
    }

    #filters {
        flex-direction: column; /* Cambia a una disposición vertical */
        gap: 15px; /* Reduce el espacio entre los filtros */
    }

    #filters select {
        width: 80%; /* Los selectores ocupan el 80% del ancho del contenedor */
    }


}

main {
    text-align: center;
    padding: 20px;
}

#gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Define las columnas de la cuadrícula. repeat(3, 1fr) indica que la cuadrícula tendrá tres columnas, y cada columna ocupará una fracción igual del espacio disponible (1fr significa "una fracción del espacio disponible"). */
    gap: 10px;
    margin-bottom: 20px;
}

#gallery img {
    width: 100%; /* Ocupa todo el ancho del contenedor */
    height: 200px; /* Altura fija para todas las imágenes */
    object-fit: cover; /* Recorta la imagen para que se ajuste al contenedor sin distorsionarse */
    border-radius: 8px; /* Bordes redondeados */
    cursor: pointer;
    transition: transform 0.3s ease; /* Animación suave al pasar el mouse */
}

#gallery img:hover {
    transform: scale(1.05); /* Efecto de zoom suave al pasar el mouse */
}



#pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
}

footer {
    background-color: #001040;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
}

.footer-column {
    flex: 1;
    padding: 0 10px;
}


@media (max-width: 480px) {



#lightbox {


    display:flex;
    justify-content: center;
    align-items: center;

    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Permite el scroll si el contenido es muy largo */
    background-color: rgba(0, 0, 0, 0.9);

 /* justify-content: center;
    display: flex;
    z-index: 1000;
    */

}



#lightbox-content {

    top: 45%; /* top: 150px;  regular de acuerdo al tamaño dl texto*/

    position: relative;
    background: #fff;
    padding: 20px;
    max-width: 80%;
    text-align: center;
}







    #title {
        font-size: 20px;
    }

    #logo, #ecuador-flag {
        max-width: 40px;
    }



    header {
        flex-direction: column;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    #gallery {
        grid-template-columns: 1fr;
    }

    #gallery img {
        height: 150px; /* Ajusta la altura de las imágenes */
    }

    footer {
        flex-direction: column;
        align-items: center;
    }

    .footer-column {
        padding: 10px 0;
    }


        #filters select {
        width: 100%; /* Los selectores ocupan el 100% del ancho del contenedor */
        font-size: 14px; /* Tamaño de fuente ligeramente más pequeño */
        padding: 8px; /* Reduce un poco el padding */
    }

}







/* ----------------------------------------------------- */

/* Lightbox styles */

#lightbox {

    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Permite el scroll si el contenido es muy largo */
    background-color: rgba(0, 0, 0, 0.9);



 /* justify-content: center;
    display: flex;
    z-index: 1000;
    align-items: center;
    */

}


#lightbox p {
    text-align: center;
    margin-top: 20px;
}

#lightbox.hidden {
    display: none;
}



#lightbox-content {

 /* top: 45%;  regular de acuerdo al tamaño dl texto*/
    top: 45%;
    position: relative;
    background: #fff;
    padding: 20px;
    max-width: 80%;
    text-align: center;
}



#lightbox-close {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 30px;
    cursor: pointer;
}



#lightbox-video {
    width: 100%;
    height: 400px;
}



#lightbox-caption {
    margin-top: 10px;
    font-size: 18px;
}



/* Estilos para la página de visualización */
.image-view-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.viewed-image {
    max-width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 20px;
}

.image-details {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.image-details h2 {
    color: #001040;
    margin-top: 0;
}

.image-description {
    margin-top: 20px;
    line-height: 1.6;
}

.video-container {
    margin-top: 30px;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .image-view-container {
        padding: 10px;
    }
    
    .image-details {
        padding: 15px;
    }
}




/* 📌 Estilos generales para formularios de autenticación */
.auth-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 16, 64, 0.1);
    border: 1px solid #e1e4e8;
}

.auth-box {
    padding: 20px;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.auth-footer a {
    color: #001040;
    font-weight: bold;
}

/* 📌 Estilos para grupos de formulario */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    border-color: #001040;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 16, 64, 0.1);
}

/* 📌 Estilos para botones */
.submit-btn {
    width: 100%;
    padding: 12px;
    background-color: #001040;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #002060;
}

/* 📌 Estilos para mensajes de error */
.error {
    display: block;
    padding: 12px;
    margin-bottom: 1.5rem;
    background-color: #ffebee;
    color: #d32f2f;
    border-radius: 6px;
    border-left: 4px solid #d32f2f;
    font-size: 0.9rem;
}

/* 📌 Estilos para el header con información de usuario */
.user-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    font-weight: 500;
}

.logout-btn {
    padding: 6px 12px;
    background-color: #d9534f;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: background-color 0.3s;
}

.logout-btn:hover {
    background-color: #c9302c;
}

/* 📌 Media Queries para responsividad */
@media (max-width: 768px) {
    .auth-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .user-info {
        margin: 10px 0;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 1rem;
    }
    
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="password"] {
        padding: 10px;
    }
    
    .submit-btn {
        padding: 10px;
    }
}


/* Estilos para imágenes básicas (espacios vacíos) */
.image-item a {
    display: block;
    height: 100%;
    transition: transform 0.3s ease;
}

.image-item a:hover {
    transform: scale(1.02);
}

.image-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.image-item:hover img {
    opacity: 1;
}



/* Estilos para la galería */
#gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.anuncio-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.anuncio-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.anuncio-container img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.anuncio-detalles {
    padding: 15px;
}

.anuncio-detalles h3 {
    margin: 0 0 10px 0;
    color: #001040;
}

.anuncio-detalles p {
    margin: 5px 0;
    color: #555;
}

.fecha {
    font-size: 0.9em;
    color: #888;
}

.contacto {
    font-weight: bold;
    color: #0066cc;
}

.error {
    color: #d32f2f;
    text-align: center;
    grid-column: 1 / -1;
    padding: 20px;
}