/* Main snaps container layout */
.snaps-container {
    max-width: 1000px;
    margin: 120px auto 50px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Snaps hero header box */
.snaps-header-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    transform: translateY(16px);
    animation: headerFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

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

.snaps-header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.snaps-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.snaps-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    font-weight: 500;
    color: #a0a0a0;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.snaps-sort-btn i {
    color: #55c4d3;
    font-size: 0.88rem;
}

.snaps-sort-btn:hover {
    color: #fff;
    border-color: rgba(85, 196, 211, 0.4);
    background: rgba(85, 196, 211, 0.08);
    box-shadow: 0 0 10px rgba(85, 196, 211, 0.15);
}

.snaps-sort-btn:active {
    transform: scale(0.97);
}

.snaps-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    font-weight: 500;
    color: #a0a0a0;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
}

.snaps-count-badge i {
    color: #55c4d3;
    font-size: 0.9rem;
}

.snaps-count-badge span {
    color: #fff;
    font-weight: 600;
}

.snaps-hero-sub {
    font-size: 0.92rem;
    color: #a0a0a0;
    line-height: 1.6;
    margin: 0;
}

/* Snaps Grid */
.snaps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 10px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Snap Card */
.snap-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.25s ease,
                box-shadow 0.25s ease;
}

.snap-card.card-visible {
    opacity: 1;
    transform: translateY(0);
}

.snap-card:hover {
    border-color: rgba(85, 196, 211, 0.45);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 16px rgba(85, 196, 211, 0.12);
}

.snap-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #0d0f12;
}

.snap-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.snap-card:hover .snap-img {
    transform: scale(1.04);
}

.snap-meta-bar {
    padding: 10px 14px;
    background: rgba(10, 12, 16, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.snap-meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.snap-title {
    font-size: 0.84rem;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.snap-date {
    font-size: 0.72rem;
    color: #55c4d3;
    font-family: 'Fira Code', monospace;
    flex-shrink: 0;
}

.snap-meta-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.snap-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.68rem;
    color: #8fa0ad;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px 7px;
    border-radius: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.snap-meta-chip i {
    color: #55c4d3;
    font-size: 0.7rem;
}

.snap-meta-chip.snap-chip-link {
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.snap-meta-chip.snap-chip-link:hover {
    color: #fff;
    border-color: #55c4d3;
    background: rgba(85, 196, 211, 0.15);
    box-shadow: 0 0 10px rgba(85, 196, 211, 0.2);
}

.snap-meta-chip .chip-ext {
    font-size: 0.58rem;
    opacity: 0.65;
    margin-left: 2px;
}

/* Empty State */
.snaps-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #777;
    font-size: 0.9rem;
}

.snaps-empty-state i {
    font-size: 2.5rem;
    color: #444;
    display: block;
    margin-bottom: 12px;
}

/* Lightbox Modal */
.snaps-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.snaps-lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
}

.lightbox-dialog {
    position: relative;
    z-index: 1;
    max-width: 92vw;
    max-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(14, 16, 22, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(85, 196, 211, 0.15);
}

.lightbox-content img {
    max-width: 88vw;
    max-height: 75vh;
    object-fit: contain;
    display: block;
    background: #000;
}

.lightbox-meta {
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(10, 12, 16, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lightbox-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.lightbox-title,
.lightbox-caption {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lightbox-submeta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.lightbox-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-family: 'Fira Code', monospace;
    color: #a0b0be;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
}

.lightbox-tag i {
    color: #55c4d3;
    font-size: 0.75rem;
}

.lightbox-tag.lightbox-tag-link {
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lightbox-tag.lightbox-tag-link:hover {
    color: #fff;
    border-color: #55c4d3;
    background: rgba(85, 196, 211, 0.18);
    box-shadow: 0 0 12px rgba(85, 196, 211, 0.25);
}

.lightbox-tag .tag-ext-icon {
    font-size: 0.6rem;
    opacity: 0.7;
    margin-left: 2px;
}

.lightbox-tag#lightbox-date {
    color: #55c4d3;
    background: rgba(85, 196, 211, 0.08);
    border-color: rgba(85, 196, 211, 0.25);
}

.lightbox-raw-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    font-size: 0.74rem;
    font-family: 'Fira Code', monospace;
    color: #bbb;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.lightbox-raw-btn:hover {
    color: #fff;
    border-color: #55c4d3;
    background: rgba(85, 196, 211, 0.15);
}

/* Lightbox controls */
.lightbox-close {
    position: absolute;
    top: -42px;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.lightbox-close:hover {
    background: #ff4444;
    border-color: #ff4444;
    transform: scale(1.08);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 17, 23, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    z-index: 2;
}

.lightbox-nav:hover {
    background: rgba(85, 196, 211, 0.25);
    border-color: #55c4d3;
    color: #55c4d3;
    transform: translateY(-50%) scale(1.08);
}

.lightbox-nav.prev {
    left: -58px;
}

.lightbox-nav.next {
    right: -58px;
}

@media (max-width: 768px) {
    .lightbox-nav.prev {
        left: 8px;
    }
    .lightbox-nav.next {
        right: 8px;
    }
    .lightbox-close {
        top: -46px;
        right: 8px;
    }
}
