/* Gallery Wrapper */
.mag-gallery-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
}

/* Filter Bar */
.mag-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.mag-filter-item {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    color: #374151;
}

.mag-filter-item:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.mag-filter-item.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.mag-filter-item .mag-filter-count {
    display: inline-block;
    margin-left: 4px;
    padding: 0 6px;
    font-size: 12px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
}

.mag-filter-item.active .mag-filter-count {
    background: rgba(255,255,255,0.2);
}

/* Gallery Grid */
.mag-gallery {
    display: grid;
    grid-template-columns: repeat(var(--mag-columns, 3), 1fr);
    gap: var(--mag-spacing, 15px);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Gallery Item */
.mag-gallery-item {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.mag-gallery-item .mag-image-wrapper {
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mag-gallery-item .mag-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

/* Hover Effects */
.mag-gallery-item .mag-image-wrapper:hover {
    transform: translateY(-2px);
}

.mag-gallery-item .mag-image-wrapper:hover img {
    transform: scale(1.05);
}

.mag-gallery-item .mag-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mag-gallery-item .mag-image-wrapper:hover .mag-image-overlay {
    opacity: 1;
}

.mag-lightbox-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    color: #1f2937;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.mag-lightbox-trigger:hover {
    transform: scale(1.1);
    background: #fff;
    color: #2563eb;
}

.mag-icon-zoom {
    font-size: 24px;
}

/* Captions */
.mag-image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.mag-image-wrapper:hover .mag-image-caption {
    opacity: 1;
    transform: translateY(0);
}

.mag-caption-text {
    display: block;
    font-size: 14px;
    text-align: center;
}

/* Skeleton Loaders */
.mag-gallery-item.skeleton {
    background: #f3f4f6;
    border-radius: 8px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Loading */
.mag-gallery-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.mag-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Pagination */
.mag-pagination {
    margin-top: 24px;
    text-align: center;
}

.mag-pagination-controls {
    display: inline-flex;
    gap: 4px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
}

.mag-pagination-controls button {
    padding: 8px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #374151;
}

.mag-pagination-controls button:hover {
    background: #f3f4f6;
}

.mag-pagination-controls button.active {
    background: #2563eb;
    color: #fff;
}

.mag-pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Album Grid */
.mag-album-grid {
    display: grid;
    grid-template-columns: repeat(var(--mag-columns, 3), 1fr);
    gap: 24px;
    margin: 20px 0;
}

.mag-album-item {
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mag-album-item:hover {
    transform: translateY(-5px);
}

.mag-album-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.mag-album-cover {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    aspect-ratio: 1;
}

.mag-album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mag-album-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 48px;
    background: #e5e7eb;
    color: #9ca3af;
}

.mag-album-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 4px 12px;
    border-radius: 12px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 12px;
}

.mag-album-title {
    margin: 12px 0 4px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.mag-album-description {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mag-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .mag-filter-bar {
        gap: 4px;
    }
    
    .mag-filter-item {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .mag-album-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .mag-pagination-controls button {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .mag-gallery {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .mag-album-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .mag-album-title {
        font-size: 14px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .mag-gallery-wrapper {
        color: #e5e7eb;
    }
    
    .mag-filter-item {
        border-color: #4b5563;
        color: #e5e7eb;
    }
    
    .mag-filter-item:hover {
        background: #374151;
    }
    
    .mag-filter-item.active {
        background: #3b82f6;
        border-color: #3b82f6;
    }
    
    .mag-gallery-item .mag-image-wrapper {
        background: #374151;
    }
    
    .mag-pagination-controls {
        border-color: #4b5563;
    }
    
    .mag-pagination-controls button {
        color: #e5e7eb;
    }
    
    .mag-pagination-controls button:hover {
        background: #374151;
    }
    
    .mag-pagination-controls button.active {
        background: #3b82f6;
    }
    
    .mag-album-title {
        color: #e5e7eb;
    }
    
    .mag-album-description {
        color: #9ca3af;
    }
}
/* Gallery styles are mostly inline, this is for additional styling */
.mag-gallery-wrapper {
    margin: 20px 0;
}
.mag-gallery-grid {
    /* Grid is inline via shortcode */
}
.mag-gallery-item {
    /* Styles are inline via shortcode */
}