/* 
 * Estilos para la Galería
 * Este archivo contiene los estilos específicos para la galería de imágenes
 */

/* Estilos generales */
.galeria-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.galeria-header {
    text-align: center;
    margin-bottom: 30px;
}

.galeria-header h1 {
    font-size: 2.5rem;
    color: #4a7c59;
    margin-bottom: 10px;
}

.galeria-header p {
    font-size: 1.2rem;
    color: #666;
}

/* Filtros de categoría */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.category-filter {
    padding: 8px 16px;
    background-color: #f0f0f0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-filter:hover {
    background-color: #e0e0e0;
}

.category-filter.active {
    background-color: #4a7c59;
    color: white;
}

/* Galería de imágenes */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    position: relative;
}

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

.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.gallery-info {
    padding: 15px;
    background-color: white;
}

.gallery-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.gallery-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.gallery-category {
    font-size: 0.8rem;
    color: #4a7c59;
    font-weight: 600;
}

.gallery-date {
    font-size: 0.8rem;
    color: #999;
}

/* Admin controls */
.admin-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
}

.admin-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.admin-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Formulario de subida de imágenes */
.upload-form-container {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.upload-form-container h2 {
    font-size: 1.5rem;
    color: #4a7c59;
    margin-bottom: 15px;
}

.upload-form {
    display: grid;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 600;
}

.form-control {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
}

.form-control:focus {
    border-color: #4a7c59;
    outline: none;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.image-preview {
    margin-top: 15px;
    display: none;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 4px;
}

/* Botones */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #4a7c59;
    color: white;
}

.btn-primary:hover {
    background-color: #3a6349;
}

.btn-secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.btn-danger {
    background-color: #d9534f;
    color: white;
}

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

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 10px;
}

.pagination-item {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.pagination-item:hover {
    background-color: #f0f0f0;
}

.pagination-item.active {
    background-color: #4a7c59;
    color: white;
    border-color: #4a7c59;
}

/* Visor de imágenes */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.image-viewer-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.image-viewer img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.image-viewer-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
}

.image-viewer-title {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.image-viewer-description {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.image-viewer-category {
    font-size: 0.8rem;
    color: #aaa;
}

.image-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

.image-viewer-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.image-viewer-prev,
.image-viewer-next {
    color: white;
    font-size: 40px;
    cursor: pointer;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.image-viewer-prev:hover,
.image-viewer-next:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Formulario de inicio de sesión */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #4a7c59;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.invalid-feedback {
    color: #d9534f;
    font-size: 0.9rem;
    margin-top: 5px;
}

.is-invalid {
    border-color: #d9534f;
}

/* Mensajes de estado */
.loading,
.no-images,
.error {
    text-align: center;
    padding: 30px;
    color: #666;
}

.no-images {
    font-style: italic;
}

.error {
    color: #d9534f;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .galeria-header h1 {
        font-size: 2rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .category-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .category-filter {
        width: 100%;
        text-align: center;
    }
}
