/* ASEMOPT Gallery Manager - Frontend Styles */

.asemopt-gallery-frontend {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.asemopt-gallery-empty {
    text-align: center;
    padding: 60px 20px;
    background: #FFF8F0;
    border-radius: 8px;
    color: #666;
    font-size: 16px;
    border: 2px dashed #FFD700;
}

/* Filtros */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.filter-btn {
    padding: 12px 28px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
	outline: none; /* Quita el borde negro al hacer click */
}

.filter-btn:focus {
    outline: none; /* Asegura que no aparezca el outline al hacer focus */
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    /*background: linear-gradient(135deg, #FF8C00 0%, #ff6d2d 100%);*/
	background:#ff6d2d;
    transition: left 0.3s ease;
    z-index: -1;
	outline: none;
}

.filter-btn:hover {
    /*border-color: #ff6d2d;*/
    border-color: #ff6d2d;
    color: #FF8C00;
    transform: translateY(-2px);
    /*box-shadow: 0 4px 12px rgba(255, 140, 0, 0.2);*/
}

.filter-btn.active {
    /*background: linear-gradient(135deg, #FF8C00 0%, #ff6d2d 100%);*/
	background:#ff6d2d;
    border-color: #FF8C00;
    color: white;
    /*box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);*/
	outline: none;
}

.filter-btn.active::before {
    left: 0;
}

/* Masonry Grid */
.gallery-masonry {
    column-count: 4;
    column-gap: 20px;
}

.gallery-masonry-item {
    break-inside: avoid;
    margin-bottom: 20px;
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.gallery-masonry-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    height: 0;
    margin: 0;
    overflow: hidden;
}

.masonry-item-inner {
    position: relative;
    border-radius: 0;
    overflow: hidden;
    background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.masonry-item-inner:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.masonry-item-inner img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.masonry-item-inner:hover img {
    transform: scale(1.05);
}

.masonry-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0.2) 50%,
        rgba(0,0,0,0.85) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
}

.masonry-item-inner:hover .masonry-item-overlay {
    opacity: 1;
}

.masonry-item-content {
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.masonry-item-inner:hover .masonry-item-content {
    transform: translateY(0);
}

.masonry-item-content h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 700;
    color: white;
    line-height: 1.3;
}

.masonry-item-content p {
    margin: 0;
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.btn-view-image {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.masonry-item-inner:hover .btn-view-image {
    opacity: 1;
    transform: scale(1);
}

.btn-view-image:hover {
    background: white;
    transform: scale(1.1);
}

.btn-view-image .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #FF8C00;
}

/* Lightbox Modal */
.gallery-lightbox {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    display: block;
    margin: 0 auto;
}

.lightbox-info {
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.95) 0%, rgba(255, 165, 0, 0.95) 100%);
    padding: 20px 30px;
    border-radius: 0;
    text-align: center;
    margin-top: -4px;
}

.lightbox-info h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.lightbox-info p {
    margin: 0;
    font-size: 16px;
    color: rgba(255,255,255,0.95);
    line-height: 1.5;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 50px;
    font-weight: 300;
    color: white;
    background: rgba(255, 140, 0, 0.9);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255, 140, 0, 0.4);
	outline: none;
}

.lightbox-close:hover {
    background: #ff6d2d;
    transform: rotate(90deg) scale(1.1);
	outline: none;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 60px;
    font-weight: 300;
    color: white;
    background: rgba(255, 140, 0, 0.9);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255, 140, 0, 0.4);
	outline: none;
}

.lightbox-prev {
    left: 40px;
	outline: none;
}

.lightbox-next {
    right: 40px;
	outline: none;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: #ff6d2d;
    transform: translateY(-50%) scale(1.15);
	outline: none;
}

/* Animaciones de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-masonry-item {
    animation: fadeInUp 0.6s ease forwards;
}

.gallery-masonry-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-masonry-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-masonry-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-masonry-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-masonry-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-masonry-item:nth-child(6) { animation-delay: 0.3s; }
.gallery-masonry-item:nth-child(7) { animation-delay: 0.35s; }
.gallery-masonry-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-masonry-item:nth-child(n+9) { animation-delay: 0.45s; }

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-masonry {
        column-count: 3;
    }
}

@media (max-width: 900px) {
    .gallery-masonry {
        column-count: 2;
        column-gap: 15px;
    }
    
    .gallery-masonry-item {
        margin-bottom: 15px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 50px;
        height: 50px;
        font-size: 40px;
    }
    
    .lightbox-prev {
        left: 20px;
    }
    
    .lightbox-next {
        right: 20px;
    }
    
    .lightbox-close {
        top: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 40px;
    }
}

@media (max-width: 600px) {
    .asemopt-gallery-frontend {
        padding: 30px 15px;
    }
    
    .gallery-masonry {
        column-count: 1;
    }
    
    .gallery-filters {
        padding: 15px;
        gap: 8px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .masonry-item-content h3 {
        font-size: 16px;
    }
    
    .masonry-item-content p {
        font-size: 13px;
    }
    
    .lightbox-info h3 {
        font-size: 20px;
    }
    
    .lightbox-info p {
        font-size: 14px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 45px;
        height: 45px;
        font-size: 35px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
        font-size: 35px;
    }
    
    .lightbox-content {
        max-width: 95%;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.gallery-masonry-item.loading {
    animation: pulse 1.5s ease-in-out infinite;
}