/* Container principal da galeria */
.gallery-container {
    width: 100%;
    margin: 0 auto; /* Centralizar se necessário */
}

/* Header da galeria com contador e botão de download */
.gallery-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    gap: 15px;
    flex-wrap: wrap;
}

.photo-counter {
    color: #747474;
    font-family: "Inter", Sans-serif;
    font-size: 13px;
    font-weight: 500;
    margin-right: auto; /* Empurra os botões para a direita */
}

.gallery-buttons-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.download-all-button {
    background-color: #F0F0F0;
    font-family: "Inter", Sans-serif;
    font-size: 13px;
    font-weight: 600;
    fill: #111111;
    color: #111111;
    border-style: solid;
    border-width: 1px 1px 1px 1px;
    border-color: #414141;
    border-radius: 80px;
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.download-all-button:hover {
    background-color: #FFFFFF;
    transform: translateY(-2px);
}

.download-all-button svg {
    width: 16px;
    height: 16px;
}

.download-info {
    color: #747474;
    font-family: "Inter", Sans-serif;
    font-size: 13px;
    font-weight: 400;
}

/* Progress bar para download */
#download-progress {
    margin: 15px 0;
    padding: 10px;
    border-radius: 5px;
    background-color: rgba(0,0,0,0.1);
}

.progress-text {
    margin-bottom: 5px;
    font-family: "Inter", Sans-serif;
    font-size: 14px;
    color: #f0f0f0;
}

.progress-bar {
    height: 10px;
    background-color: #333;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background-color: var(--e-global-color-accent);
    transition: width 0.3s ease-in-out;
}

/* Grid da galeria */
.masonry-gallery {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 fotos por linha em telas grandes */
    grid-gap: 15px;
    padding: 15px;
}

/* Ajustes responsivos */
@media (max-width: 1200px) {
    .masonry-gallery {
        grid-template-columns: repeat(4, 1fr); /* 4 fotos por linha em telas médias */
    }
}

@media (max-width: 992px) {
    .masonry-gallery {
        grid-template-columns: repeat(3, 1fr); /* 3 fotos por linha em telas pequenas */
    }
}

@media (max-width: 768px) {
    .masonry-gallery {
        grid-template-columns: repeat(3, 1fr); /* 3 fotos por linha em telas pequenas */
    }
    
    .gallery-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .photo-counter {
        margin-bottom: 10px;
    }
    
    .gallery-buttons-group {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: space-between;
    }
    
    .download-all-button {
        flex: 1;
        min-width: 160px;
        justify-content: center;
    }
    
    .download-info {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .masonry-gallery {
        grid-template-columns: repeat(3, 1fr) !important;
        padding: 0px !important;
        grid-gap: 5px !important;
    }
    
    .gallery-buttons-group {
        flex-direction: column;
        width: 100%;
    }
    
    .download-all-button {
        width: 100%;
        justify-content: center;
    }
}

/* Itens da galeria */
.gallery-item {
    width: 100%;
    position: relative;
    display: none; /* Todos começam ocultos, serão mostrados via JS */
    overflow: hidden;
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* Efeito hover com borda branca, como na imagem do meio */
.gallery-item:hover {
    box-shadow: 0 0 0 3px white;
    transform: scale(1.01);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    border-radius: 10px !important;
    transition: opacity 0.3s ease;
}

/* Ajuste da video-container se necessária */
.video-container {
    position: relative;
    width: 100%;
    background-color: #000;
    overflow: hidden;
    border-radius: 10px !important;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px !important;
}

/* Ações da galeria */
.gallery-actions {
    display: flex;
    position: absolute;
    bottom: 10px;
    right: 10px; /* Alinhado à direita como mostrado na imagem */
    z-index: 10;
    gap: 10px; /* Espaço entre os botões */
    opacity: 0; /* Inicialmente invisível */
    transition: opacity 0.3s ease; /* Transição suave */
}

/* Mostrar ações ao passar o mouse */
.gallery-item:hover .gallery-actions {
    opacity: 1; /* Mostrar ao passar o mouse */
}

/* Botões gerais - estilo base comum para todos os botões */
.gallery-item .remove-photo-btn,
.gallery-item .send-video-btn,
.gallery-item .download-photo-btn,
.gallery-item .download-video-btn {
    font-family: "Inter", Sans-serif;
    font-size: 13px;
    font-weight: 600;

    border-radius: 80px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

/* Botão remover foto (Excluir) - botão escuro */
.gallery-item .remove-photo-btn {
    background-color: #111111;
    fill: #F0F0F0;
    color: #F0F0F0;
    border-color: #414141;
}
.gallery-item .remove-photo-btn:hover {
    background-color: #222222;
    transform: translateY(-2px);
}

/* Botão download de foto (Baixar) - botão claro */
.gallery-item .download-photo-btn {
    background-color: #F0F0F0;
    fill: #111111;
    color: #111111;
    border-color: #414141;
}
.gallery-item .download-photo-btn:hover {
    background-color: #FFFFFF;
    transform: translateY(-2px);
}

/* Botão enviar vídeo - botão escuro */
.gallery-item .send-video-btn {
    background-color: #111111;
    fill: #F0F0F0;
    color: #F0F0F0;
    border-color: #414141;
}
.gallery-item .send-video-btn:hover {
    background-color: #222222;
    transform: translateY(-2px);
}

/* Botão download de vídeo - botão claro */
.gallery-item .download-video-btn {
    background-color: #F0F0F0;
    fill: #111111;
    color: #111111;
    border-color: #414141;
}
.gallery-item .download-video-btn:hover {
    background-color: #FFFFFF;
    transform: translateY(-2px);
}

/* Responsividade para botões no mobile */
@media (max-width: 768px) {
    .gallery-item .remove-photo-btn,
    .gallery-item .send-video-btn,
    .gallery-item .download-photo-btn,
    .gallery-item .download-video-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* Filtros */
.event-folder-filter ul {
    list-style: none;
    padding: 0;
}

.event-folder-filter ul li {
    display: inline-block;
    margin-right: 5px;
}

.event-folder-filter ul li a {
    background-color: #FFFFFF24;
    fill: #FFFFFFDB;
    color: #FFFFFFDB;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "sohne", Sans-serif;
    font-size: 11px;
    font-weight: 400;
    border-radius: 10px;
    padding: 10px;
    display: inline-block;
}

.event-folder-filter ul li a:hover {
    background-color: var(--e-global-color-accent);
}

.filter[data-event-folder="all"] {
    font-family: "sohne", Sans-serif;
    font-size: 11px;
    font-weight: 400;
    border-radius: 10px;
    padding: 10px;
    background-color: var(--e-global-color-accent);
    display: inline-block;
}

/* Rolagem horizontal no mobile para filtros */
@media (max-width: 768px) {
    .event-folder-filter ul {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        align-items: center;
    }
    .event-folder-filter ul::-webkit-scrollbar {
        display: none;
    }
    .event-folder-filter ul li {
        flex: 0 0 auto;
    }
}

/* Indicador de carregamento e ícone de rolagem infinita */
.loading-gallery,
.processing-mensage {
    text-align: center;
    padding: 20px;
}

/* Utilitários */
.hide { display: none; }
.show { display: block; }

/* Botões customizados do SweetAlert */
.custom-confirm-button,
.custom-cancel-button {
    color: white !important;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 16px;
    border: none !important;
    transition: background-color 0.3s ease;
}

.custom-confirm-button {
    background-color: #4CAF50 !important;
}
.custom-confirm-button:hover {
    background-color: #45a049 !important;
}

.custom-cancel-button {
    background-color: #f44336 !important;
}
.custom-cancel-button:hover {
    background-color: #e53935 !important;
}

.elementor-lightbox .elementor-lightbox-item {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 30px!important;
    box-sizing: border-box;
    height: 100%;
    margin: auto;
}

.elementor-lightbox .elementor-lightbox-image {
    box-shadow: 0 0 30px rgba(0, 0, 0, .3), 0 0 8px -5px rgba(0, 0, 0, .3);
    border-radius: 12px!important;
}

/* Estilos para modo impressão */
.gallery-item {
    position: relative;
}

.impressao-select {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

.impressao-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Estilo para fotos selecionadas */
.foto-selecionada {
    position: relative;
}

.foto-selecionada::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 4px solid #0073aa;
    background: rgba(0, 115, 170, 0.1);
    z-index: 1;
    pointer-events: none;
}

.foto-selecionada::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 25px;
    height: 25px;
    background: #0073aa;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 2;
}

/* Estilo para imagens selecionadas para impressão */
.gallery-item.selected-for-print {
    position: relative;
}

.gallery-item.selected-for-print::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 6px solid #0073aa;
    z-index: 1;
    pointer-events: none;
    border-radius:10px
}

.gallery-item.selected-for-print img {
    opacity: 0.9;
}

/* Modal de impressão */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
    position: relative;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.close {
    position: absolute;
    right: 0;
    top: 0;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #000;
}

.modal-body {
    padding: 20px 0;
}

/* Formulário de endereço */
.impressao-form {
    height: 100%;
    overflow-y: auto;
}

.impressao-form .form-group {
    margin-bottom: 15px;
}

.impressao-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.impressao-form input {
    width: 100%;
    border: 1px solid #ddd;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 14px;
}

.impressao-form input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

.impressao-form button {
    width: 100%;
    background: #0073aa;
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
}

.impressao-form button:hover {
    background: #005177;
}

/* Título do modal */
.modal-title {
    font-size: 24px;
    color: #333;
    margin: 0;
    padding-right: 40px;
}

/* Contador de fotos */
.photos-counter {
    background: #f0f0f0;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 10px 0;
    font-weight: bold;
    color: #333;
    text-align: center;
}

/* Remover estilos antigos do grid */
.modal-left-column,
.selected-photos-grid,
.grid-pagination {
    display: none;
}

/* Mensagem de instrução para rolagem */
.scroll-instruction {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(17, 17, 17, 0.9);
    color: #F0F0F0;
    padding: 15px 20px;
    border-radius: 30px;
    font-family: "Inter", Sans-serif;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    animation: fadeInUp 0.5s ease-out, fadeOutDown 0.5s ease-out 5s forwards;
    pointer-events: none;
}

.scroll-instruction.visible {
    animation: fadeInUp 0.5s ease-out;
}

.scroll-instruction.hidden {
    animation: fadeOutDown 0.5s ease-out forwards;
}

.scroll-instruction svg {
    width: 20px;
    height: 20px;
    fill: #F0F0F0;
    animation: bounceDown 1.5s infinite;
}

@keyframes bounceDown {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes fadeOutDown {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
}