/**
 * Website Gallery - Frontend Styles
 *
 * Styles for the gallery shortcode display on the frontend.
 *
 * @package WebsiteGallery
 * @since 1.0.0
 */

:root {
    --wsg-primary: #6366f1;
    --wsg-primary-dark: #4f46e5;
    --wsg-secondary: #ec4899;
    --wsg-bg: #0f172a;
    --wsg-surface: #1e293b;
    --wsg-surface-hover: #334155;
    --wsg-text: #f1f5f9;
    --wsg-text-muted: #94a3b8;
    --wsg-border: #334155;
    --wsg-radius: 12px;
    --wsg-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    --wsg-columns: 3;
}

/* Light mode alternative - uncomment if needed */
/*
.wsg-light {
    --wsg-bg: #f8fafc;
    --wsg-surface: #ffffff;
    --wsg-surface-hover: #f1f5f9;
    --wsg-text: #1e293b;
    --wsg-text-muted: #64748b;
    --wsg-border: #e2e8f0;
}
*/

.wsg-gallery-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Filters */
.wsg-filters {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wsg-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.wsg-filter-label {
    color: var(--wsg-text-muted);
    font-size: 14px;
    font-weight: 500;
    margin-right: 8px;
}

.wsg-filter-btn {
    background: var(--wsg-surface);
    border: 1px solid var(--wsg-border);
    color: var(--wsg-text);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wsg-filter-btn:hover {
    background: var(--wsg-surface-hover);
    border-color: var(--wsg-primary);
}

.wsg-filter-btn:focus {
    outline: 2px solid var(--wsg-primary);
    outline-offset: 2px;
}

.wsg-filter-btn.active {
    background: var(--wsg-primary);
    border-color: transparent;
    color: white;
    font-weight: 500;
}

.wsg-filter-btn-tech {
    font-size: 12px;
    padding: 6px 12px;
}

/* Clear button styling */
.wsg-clear-tech {
    background: transparent;
    border-style: dashed;
    opacity: 0.7;
}

.wsg-clear-tech:hover {
    opacity: 1;
    background: var(--wsg-surface);
}

/* Gallery Grid */
.wsg-gallery {
    display: grid;
    grid-template-columns: repeat(var(--wsg-columns), 1fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    .wsg-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .wsg-gallery {
        grid-template-columns: 1fr;
    }
}

/* Gallery Item with dynamic animation delay */
.wsg-item {
    background: var(--wsg-surface);
    border-radius: var(--wsg-radius);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--wsg-border);
    animation: wsg-fadeIn 0.5s ease forwards;
    animation-delay: calc(var(--wsg-item-index, 0) * 0.08s);
    opacity: 0;
}

.wsg-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--wsg-shadow);
    border-color: var(--wsg-primary);
}

.wsg-item.wsg-hidden {
    display: none;
}

/* Item Image */
.wsg-item-image {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--wsg-bg);
}

.wsg-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.wsg-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wsg-text-muted);
}

.wsg-placeholder .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    opacity: 0.3;
}

/* Overlay */
.wsg-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--wsg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wsg-item:hover .wsg-item-overlay {
    opacity: 1;
}

.wsg-view-btn,
.wsg-visit-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.wsg-view-btn:hover,
.wsg-visit-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.wsg-view-btn:focus,
.wsg-visit-btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.wsg-view-btn .dashicons,
.wsg-visit-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Item Content */
.wsg-item-content {
    padding: 16px;
}

.wsg-item-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
    color: var(--wsg-text);
}

.wsg-item-categories,
.wsg-item-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

/* Badges */
.wsg-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wsg-badge-category {
    background: var(--wsg-primary);
    color: white;
}

.wsg-badge-tech {
    background: var(--wsg-surface-hover);
    color: var(--wsg-text-muted);
    border: 1px solid var(--wsg-border);
}

/* Lightbox */
.wsg-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

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

.wsg-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wsg-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.wsg-lightbox-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.wsg-lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.wsg-lightbox-content img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--wsg-radius);
    box-shadow: var(--wsg-shadow);
}

.wsg-lightbox-details {
    margin-top: 20px;
}

.wsg-lightbox-details h3 {
    color: var(--wsg-text);
    margin: 0 0 15px;
    font-size: 24px;
}

.wsg-button {
    display: inline-block;
    padding: 12px 24px;
    background: var(--wsg-primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.wsg-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    color: white;
}

.wsg-button:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* No Items */
.wsg-no-items {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--wsg-text-muted);
    padding: 60px 20px;
    font-size: 18px;
}

/* Animations */
@keyframes wsg-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .wsg-item {
        animation: none;
        opacity: 1;
    }
    
    .wsg-item:hover {
        transform: none;
    }
    
    .wsg-item-image img {
        transition: none;
    }
    
    .wsg-item:hover .wsg-item-image img {
        transform: none;
    }
    
    .wsg-view-btn:hover,
    .wsg-visit-btn:hover,
    .wsg-lightbox-close:hover {
        transform: none;
    }
}