/* ============================================
   FreeITSM - Screenshots Page Styles
   ============================================ */

/* --- Filter Tabs --- */
.filter-tabs {
    padding: var(--space-xl) 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 70px;
    z-index: 100;
}

.filter-tabs .container {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: var(--text-sm);
    font-weight: 600;
    border: 2px solid var(--color-border);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.filter-btn:not([class*="bg-"]) {
    background: var(--color-surface);
}

.filter-btn:not([class*="bg-"]):hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-btn:not([class*="bg-"]).active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* Module-coloured filter buttons (use the same bg-* gradients as modules.html) */
.filter-btn[class*="bg-"] {
    border-color: transparent;
    color: white;
    opacity: 0.55;
}

.filter-btn[class*="bg-"]:hover {
    opacity: 0.85;
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.filter-btn[class*="bg-"].active {
    opacity: 1;
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

/* --- Screenshot Grid --- */
.screenshot-grid {
    padding: var(--space-3xl) 0;
}

.screenshot-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
}

.screenshot-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

.screenshot-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.screenshot-card[data-module] {
    display: block;
}

.screenshot-card.hidden {
    display: none;
}

.screenshot-img {
    aspect-ratio: 16 / 9;
    background: var(--color-bg-alt);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    color: var(--color-text-light);
    font-size: var(--text-sm);
    border-bottom: 1px solid var(--color-border);
    overflow: hidden;
}

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

.screenshot-img svg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
}

/* --- Screenshot Carousel --- */
.screenshot-carousel {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    overflow: hidden;
}

.carousel-images {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.carousel-img.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-prev {
    left: 12px;
}

.carousel-next {
    right: 12px;
}

.screenshot-carousel.has-multiple .carousel-prev,
.screenshot-carousel.has-multiple .carousel-next {
    display: flex;
}

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 8px;
    z-index: 10;
}

.screenshot-carousel.has-multiple .carousel-dots {
    display: flex;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.carousel-dot.active {
    background: white;
}

.screenshot-caption {
    padding: var(--space-md) var(--space-lg);
}

.screenshot-caption .module-badge {
    margin-bottom: var(--space-sm);
    display: inline-block;
}

.screenshot-caption p {
    font-size: var(--text-sm);
    margin: 0;
    color: var(--color-text-secondary);
}

@media (max-width: 768px) {
    .screenshot-list {
        grid-template-columns: 1fr;
    }
}

/* --- Lightbox --- */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

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

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    transition: opacity 0.35s ease, transform 0.35s ease;
    opacity: 1;
    transform: scale(1) translateX(0);
}

.lightbox-content img.slide-out-left {
    opacity: 0;
    transform: scale(0.92) translateX(-60px);
}

.lightbox-content img.slide-out-right {
    opacity: 0;
    transform: scale(0.92) translateX(60px);
}

.lightbox-content img.slide-in-left {
    opacity: 0;
    transform: scale(0.92) translateX(60px);
    transition: none;
}

.lightbox-content img.slide-in-right {
    opacity: 0;
    transform: scale(0.92) translateX(-60px);
    transition: none;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-caption {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: var(--text-sm);
    text-align: center;
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-md);
    white-space: nowrap;
}
