/**
 * Folder Photo Gallery - CSS Stylesheet
 * Design moderno e responsivo para galerias de fotos
 */

/* ===================================
   CONTAINER PRINCIPAL
   =================================== */
.fpg-gallery-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

/* ===================================
   CARDS DE ÁLBUNS
   =================================== */
.fpg-album-card {
    position: relative;
    height: 280px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.fpg-album-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* Imagem de capa do álbum */
.fpg-album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.fpg-album-card:hover .fpg-album-cover {
    transform: scale(1.1);
}

/* Placeholder para álbuns sem fotos */
.fpg-album-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: rgba(255, 255, 255, 0.8);
}

/* Informações do álbum (overlay) */
.fpg-album-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
    color: white;
}

.fpg-album-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.fpg-album-count {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
}

/* ===================================
   HEADER DO ÁLBUM
   =================================== */
.fpg-album-header {
    margin-bottom: 30px;
}

.fpg-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    margin-bottom: 20px;
}

.fpg-back-button:hover {
    background: #5568d3;
    transform: translateX(-3px);
}

.fpg-back-button svg {
    transition: transform 0.2s ease;
}

.fpg-back-button:hover svg {
    transform: translateX(-2px);
}

.fpg-current-album-title,
.fpg-album-title-static {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 10px 0;
}

/* ===================================
   GRADE DE FOTOS
   =================================== */
.fpg-photo-item {
    position: relative;
    height: 250px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.fpg-photo-item:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.fpg-photo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===================================
   LIGHTBOX
   =================================== */
.fpg-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fpgFadeIn 0.3s ease;
}

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

.fpg-lightbox-image {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    animation: fpgZoomIn 0.3s ease;
}

@keyframes fpgZoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Botão fechar */
.fpg-lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2.5rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.fpg-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Botões de navegação */
.fpg-lightbox-prev,
.fpg-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.fpg-lightbox-prev {
    left: 20px;
}

.fpg-lightbox-next {
    right: 20px;
}

.fpg-lightbox-prev:hover,
.fpg-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fpg-lightbox-prev:hover {
    transform: translateY(-50%) translateX(-3px);
}

.fpg-lightbox-next:hover {
    transform: translateY(-50%) translateX(3px);
}

/* Caption (legenda) */
.fpg-lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 0.95rem;
    text-align: center;
    max-width: 80%;
    backdrop-filter: blur(10px);
}

/* ===================================
   LOADING STATE
   =================================== */
.fpg-loading {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.1rem;
    color: #667eea;
}

.fpg-loading::after {
    content: '...';
    display: inline-block;
    animation: fpgDots 1.5s infinite;
}

@keyframes fpgDots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* ===================================
   RESPONSIVIDADE - MOBILE
   =================================== */
@media (max-width: 768px) {
    /* Cards de álbuns menores */
    .fpg-album-card {
        height: 220px;
    }

    .fpg-album-title {
        font-size: 1.1rem;
    }

    .fpg-album-count {
        font-size: 0.8rem;
    }

    /* Grade de fotos menor */
    .fpg-photo-item {
        height: 200px;
    }

    /* Título do álbum menor */
    .fpg-current-album-title,
    .fpg-album-title-static {
        font-size: 1.5rem;
    }

    /* Lightbox ajustado */
    .fpg-lightbox-image {
        max-width: 95%;
        max-height: 80vh;
    }

    .fpg-lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }

    .fpg-lightbox-prev,
    .fpg-lightbox-next {
        width: 40px;
        height: 40px;
    }

    .fpg-lightbox-prev {
        left: 10px;
    }

    .fpg-lightbox-next {
        right: 10px;
    }

    .fpg-lightbox-prev svg,
    .fpg-lightbox-next svg {
        width: 20px;
        height: 20px;
    }

    .fpg-lightbox-caption {
        bottom: 15px;
        padding: 8px 16px;
        font-size: 0.85rem;
        max-width: 90%;
    }

    /* Botão voltar menor */
    .fpg-back-button {
        padding: 8px 16px;
        font-size: 0.875rem;
    }
}

/* ===================================
   RESPONSIVIDADE - TABLET
   =================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .fpg-album-card {
        height: 250px;
    }

    .fpg-photo-item {
        height: 220px;
    }

    .fpg-current-album-title,
    .fpg-album-title-static {
        font-size: 1.75rem;
    }
}

/* ===================================
   MELHORIAS DE ACESSIBILIDADE
   =================================== */
.fpg-album-card:focus,
.fpg-photo-item:focus,
.fpg-back-button:focus,
.fpg-lightbox-close:focus,
.fpg-lightbox-prev:focus,
.fpg-lightbox-next:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ===================================
   TRANSIÇÕES SUAVES
   =================================== */
.fpg-albums-view,
.fpg-photos-view {
    animation: fpgSlideIn 0.4s ease;
}

@keyframes fpgSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   ESTADOS VAZIOS E ERROS
   =================================== */
.fpg-gallery-container .alert {
    margin: 20px 0;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
}

.fpg-gallery-container .alert-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.fpg-gallery-container .alert-info {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

.fpg-gallery-container .alert code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

/* ===================================
   PERFORMANCE - WILL-CHANGE
   =================================== */
.fpg-album-card:hover,
.fpg-photo-item:hover,
.fpg-lightbox-image {
    will-change: transform;
}

/* ===================================
   PREVENÇÃO DE SELEÇÃO DE TEXTO
   =================================== */
.fpg-album-card,
.fpg-photo-item,
.fpg-lightbox-close,
.fpg-lightbox-prev,
.fpg-lightbox-next {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
