/* Google Photo Album Plugin Styles */

.google-photo-album {
    margin: 20px 0;
    clear: both;
}

.gpa-loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.gpa-loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: gpa-spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes gpa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.gpa-error,
.gpa-error-message {
    background: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

/* Grid Layout */
.google-photo-album.grid .gpa-album-content {
    display: grid;
    gap: 15px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.google-photo-album.grid[data-columns="1"] .gpa-album-content {
    grid-template-columns: 1fr;
}

.google-photo-album.grid[data-columns="2"] .gpa-album-content {
    grid-template-columns: repeat(2, 1fr);
}

.google-photo-album.grid[data-columns="3"] .gpa-album-content {
    grid-template-columns: repeat(3, 1fr);
}

.google-photo-album.grid[data-columns="4"] .gpa-album-content {
    grid-template-columns: repeat(4, 1fr);
}

.google-photo-album.grid[data-columns="5"] .gpa-album-content {
    grid-template-columns: repeat(5, 1fr);
}

.google-photo-album.grid[data-columns="6"] .gpa-album-content {
    grid-template-columns: repeat(6, 1fr);
}

/* Masonry Layout */
.google-photo-album.masonry .gpa-album-content {
    column-count: 3;
    column-gap: 15px;
}

.google-photo-album.masonry[data-columns="1"] .gpa-album-content {
    column-count: 1;
}

.google-photo-album.masonry[data-columns="2"] .gpa-album-content {
    column-count: 2;
}

.google-photo-album.masonry[data-columns="4"] .gpa-album-content {
    column-count: 4;
}

.google-photo-album.masonry[data-columns="5"] .gpa-album-content {
    column-count: 5;
}

.google-photo-album.masonry[data-columns="6"] .gpa-album-content {
    column-count: 6;
}

/* Slider Layout */
.google-photo-album.slider .gpa-album-content {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 15px;
    padding-bottom: 10px;
}

.google-photo-album.slider .gpa-photo-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: 300px;
}

/* Photo Items */
.gpa-photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    background: #f5f5f5;
    break-inside: avoid;
    margin-bottom: 15px;
}

.gpa-photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.gpa-photo-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.gpa-photo-item:hover img {
    transform: scale(1.05);
}

/* Lightbox icon overlay */
.gpa-photo-item::after {
    content: "🔍";
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gpa-photo-item:hover::after {
    opacity: 1;
}

.gpa-photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px 15px 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gpa-photo-item:hover .gpa-photo-overlay {
    transform: translateY(0);
}

.gpa-photo-title {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
}

.gpa-photo-description {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.4;
}

/* Lightbox Styles */
.gpa-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gpa-lightbox.active {
    display: flex;
    opacity: 1;
}

.gpa-lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.gpa-lightbox.active .gpa-lightbox-content {
    transform: scale(1);
}

/* Loading State */
.gpa-lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
    z-index: 10;
}

.gpa-lightbox-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: gpa-spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes gpa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.gpa-lightbox img {
    width: 100%;
    height: auto;
    display: block;
}

.gpa-lightbox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.gpa-lightbox-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.gpa-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.gpa-lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.gpa-lightbox-prev {
    left: 15px;
}

.gpa-lightbox-next {
    right: 15px;
}

.gpa-lightbox-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 30px 20px 20px;
}

.gpa-lightbox-title {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 16px;
}

.gpa-lightbox-description {
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
    margin-bottom: 10px;
}

.gpa-lightbox-counter {
    font-size: 12px;
    opacity: 0.8;
    text-align: right;
}

/* Prevent body scroll when lightbox is open */
.gpa-lightbox-open {
    overflow: hidden;
}

/* Improve button accessibility */
.gpa-lightbox-close:focus,
.gpa-lightbox-nav:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .google-photo-album.grid .gpa-album-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .google-photo-album.masonry .gpa-album-content {
        column-count: 2;
        column-gap: 10px;
    }
    
    .google-photo-album.slider .gpa-photo-item {
        width: 250px;
    }
    
    .gpa-lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .gpa-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .gpa-lightbox-prev {
        left: 10px;
    }
    
    .gpa-lightbox-next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .google-photo-album.grid .gpa-album-content {
        grid-template-columns: 1fr;
    }
    
    .google-photo-album.masonry .gpa-album-content {
        column-count: 1;
    }
    
    .google-photo-album.slider .gpa-photo-item {
        width: 200px;
    }
    
    .gpa-photo-overlay {
        position: static;
        transform: none;
        background: rgba(0, 0, 0, 0.8);
        padding: 10px;
    }
    
    .gpa-photo-item:hover .gpa-photo-overlay {
        transform: none;
    }
}

/* Load More Button */
.gpa-load-more {
    text-align: center;
    margin-top: 20px;
}

.gpa-load-more-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.gpa-load-more-btn:hover {
    background: #005a87;
}

.gpa-load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Pagination Styles */
.gpa-pagination {
    margin: 20px 0;
    padding: 15px;
    text-align: center;
    border-top: 1px solid #eee;
}

.gpa-photo-counter {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.gpa-load-more {
    display: inline-block;
    padding: 12px 24px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.gpa-load-more:hover {
    background: #005a87;
    text-decoration: none;
    color: white;
}

.gpa-load-more:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.gpa-load-more:disabled:hover {
    background: #ccc;
}

/* Hide pagination initially */
.gpa-pagination.hidden {
    display: none;
}

/* Photo counter styling */
.gpa-showing,
.gpa-total {
    font-weight: bold;
    color: #333;
}
