/* ============================
   GALERIA DE FOTOS 
===============================*/

.galeria-container {
    padding: 3%;
    border-radius: 15px;
    box-shadow: 0 4px 18px rgba(15, 39, 71, 0.15);
    margin: 2rem auto;
}

.galeria-container h1 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.galeria-container h1 i {
    color: #e74c3c;
    margin-right: 10px;
}

.page-description {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* ============================
   TOOLBAR
===============================*/
.galeria-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.search-box i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 1.1rem;
    transition: color 0.3s;
    z-index: 2;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 0.85rem 1.2rem 0.85rem 3rem;
    border: 2px solid #e8edf2;
    border-radius: 14px;
    font-size: 1rem;
    background: #f8fafc;
    transition: all 0.3s ease;
    color: #2c3e50;
}

.search-box input::placeholder {
    color: #b0b8c1;
}

.search-box input:focus {
    border-color: #e74c3c;
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.08);
}

.filter-ano {
    padding: 0.85rem 1.5rem;
    border: 2px solid #e8edf2;
    border-radius: 14px;
    font-size: 1rem;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #2c3e50;
    font-weight: 500;
    min-width: 160px;
}

.filter-ano:hover {
    border-color: #cbd5e0;
}

.filter-ano:focus {
    border-color: #e74c3c;
    outline: none;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.08);
}

/* ============================
   LOADING
===============================*/
.loading-spinner {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}

.loading-spinner i {
    font-size: 3rem;
    color: #e74c3c;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    margin-top: 1.2rem;
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* ============================
   GRID DE ÁLBUNS
===============================*/
.albuns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.8rem;
}

.no-albuns {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: #7f8c8d;
    font-size: 1.2rem;
    background: #f8fafc;
    border-radius: 16px;
    border: 2px dashed #e2e8f0;
}

/* ============================
   CARD DO ÁLBUM - CORRIGIDO
===============================*/
.album-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 380px;
    /* Remove o background padrão */
    background-color: #1a1a2e;
}

.album-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
}

/* Camada da imagem - filho direto */
.album-card > .album-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

.album-card:hover > .album-bg {
    transform: scale(1.08);
}

/* Overlay gradiente */
.album-card > .album-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65%;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.5) 45%,
        rgba(0, 0, 0, 0.1) 75%,
        transparent 100%
    );
    z-index: 2;
    transition: height 0.4s ease;
    pointer-events: none;
}

.album-card:hover > .album-overlay {
    height: 75%;
}

/* Badge de tipo */
.album-tipo {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    z-index: 5;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

/* Contador de fotos */
.album-contador {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    z-index: 5;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.album-contador i {
    font-size: 0.85rem;
    color: #f39c12;
}

/* Conteúdo do card */
.album-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    z-index: 3;
    pointer-events: none;
}

.album-info h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.album-data {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.album-data i {
    color: #f39c12;
    font-size: 0.9rem;
}

/* Botão de ação */
.album-btn {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
    backdrop-filter: blur(8px);
    font-size: 1rem;
}

.album-btn:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.5);
}

/* ============================
   LIGHTBOX - VISUALIZAÇÃO TELA CHEIA
===============================*/
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.96);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    animation: lightboxFadeIn 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-overlay.active {
    display: flex;
}

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

.lightbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 80px 20px 60px;
}

.lightbox-img {
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease, opacity 0.2s ease;
    cursor: default;
}

.lightbox-img.swipe-left {
    transform: translateX(-40px);
    opacity: 0.2;
}

.lightbox-img.swipe-right {
    transform: translateX(40px);
    opacity: 0.2;
}

/* Botão fechar */
.lightbox-close {
    position: absolute;
    top: 24px;
    right: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.lightbox-close:hover {
    background: rgba(231, 76, 60, 0.8);
    transform: rotate(90deg);
    border-color: rgba(231, 76, 60, 0.8);
}

/* Botões de navegação */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.8rem;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

/* Contador */
.lightbox-counter {
    position: absolute;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.15);
    letter-spacing: 1px;
}

/* Legenda */
.lightbox-caption {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 24px;
    border-radius: 20px;
    max-width: 80%;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ============================
   RESPONSIVO
===============================*/
@media (max-width: 768px) {
    .galeria-container h1 {
        font-size: 1.5rem;
    }

    .page-description {
        font-size: 0.95rem;
    }

    .albuns-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .galeria-toolbar {
        flex-direction: column;
        gap: 0.8rem;
    }

    .search-box {
        min-width: 100%;
    }

    .filter-ano {
        width: 100%;
    }

    .album-card {
        height: 320px;
    }

    .album-info h3 {
        font-size: 1.1rem;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .lightbox-prev { left: 12px; }
    .lightbox-next { right: 12px; }

    .lightbox-close {
        width: 38px;
        height: 38px;
        font-size: 1.4rem;
        top: 16px;
        right: 16px;
    }

    .lightbox-counter {
        font-size: 0.8rem;
        padding: 5px 14px;
        top: 20px;
    }

    .lightbox-caption {
        font-size: 0.85rem;
        padding: 6px 18px;
        bottom: 20px;
        max-width: 90%;
    }

    .album-btn {
        width: 38px;
        height: 38px;
        bottom: 1.2rem;
        right: 1.2rem;
    }

    .album-info {
        padding: 1.2rem;
    }
}

@media (max-width: 480px) {
    .album-card {
        height: 280px;
    }

    .album-tipo {
        font-size: 0.7rem;
        padding: 0.25rem 0.7rem;
        top: 12px;
        right: 12px;
    }

    .album-contador {
        font-size: 0.7rem;
        padding: 0.25rem 0.7rem;
        top: 12px;
        left: 12px;
    }
}