/* Google Photos Gallery Pro - Frontend Styles */

.gpgp-gallery {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Estados de Loading */
.gpgp-loading {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.gpgp-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e3e3e3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: gpgp-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes gpgp-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.gpgp-loading p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Grid da Galeria */
.gpgp-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    margin-top: 20px;
}

.gpgp-grid.columns-2 { grid-template-columns: repeat(2, 1fr); }
.gpgp-grid.columns-3 { grid-template-columns: repeat(3, 1fr); }
.gpgp-grid.columns-4 { grid-template-columns: repeat(4, 1fr); }
.gpgp-grid.columns-5 { grid-template-columns: repeat(5, 1fr); }
.gpgp-grid.columns-6 { grid-template-columns: repeat(6, 1fr); }

/* Item da Galeria */
.gpgp-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: #fff;
    aspect-ratio: 1;
}

.gpgp-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.gpgp-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

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

/* Loading placeholder para imagens */
.gpgp-item.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: gpgp-shimmer 2s infinite;
}

@keyframes gpgp-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Overlay de informações */
.gpgp-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 20px 15px 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gpgp-item:hover .gpgp-overlay {
    transform: translateY(0);
}

/* Estados de Erro */
.gpgp-error {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #c33;
    margin: 20px 0;
}

/* Lightbox */
.gpgp-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.gpgp-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.gpgp-lightbox-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.gpgp-lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* Controles do Lightbox */
.gpgp-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.gpgp-lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

.gpgp-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.gpgp-lightbox-nav:hover {
    background: rgba(0,0,0,0.8);
    transform: translateY(-50%) scale(1.1);
}

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

.gpgp-lightbox-counter {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    background: rgba(0,0,0,0.7);
    padding: 8px 16px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Design Responsivo */
@media (max-width: 1024px) {
    .gpgp-grid.columns-6 { grid-template-columns: repeat(4, 1fr); }
    .gpgp-grid.columns-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .gpgp-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 15px;
    }
    
    .gpgp-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .gpgp-lightbox-prev { left: -50px; }
    .gpgp-lightbox-next { right: -50px; }
}

@media (max-width: 480px) {
    .gpgp-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    .gpgp-item {
        border-radius: 8px;
    }
    
    .gpgp-loading {
        padding: 40px 15px;
    }
    
    .gpgp-lightbox-nav {
        position: fixed;
        top: 50%;
    }
    
    .gpgp-lightbox-prev { left: 20px; }
    .gpgp-lightbox-next { right: 20px; }
    
    .gpgp-lightbox-close {
        top: 20px;
        right: 20px;
        position: fixed;
    }
    
    .gpgp-lightbox-container {
        max-width: 95vw;
        max-height: 80vh;
    }
}

/* Acessibilidade */
.gpgp-item:focus,
.gpgp-lightbox-close:focus,
.gpgp-lightbox-nav:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Animações de entrada */
@keyframes gpgp-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gpgp-item {
    animation: gpgp-fadeInUp 0.6s ease-out;
}

.gpgp-item:nth-child(even) {
    animation-delay: 0.1s;
}

.gpgp-item:nth-child(3n) {
    animation-delay: 0.2s;
}

/* Print styles */
@media print {
    .gpgp-lightbox {
        display: none !important;
    }
    
    .gpgp-grid {
        display: block !important;
    }
    
    .gpgp-item {
        display: inline-block;
        width: 200px;
        margin: 10px;
        page-break-inside: avoid;
    }
}