/* ============================================
   VISUAL ARCHIVES — SUBSECTION PAGES
   Shared styles for Evolution Logs, Media Vault,
   and Inkternal Markings
   ============================================ */

.sub-archives-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

/* ---- Back Navigation ---- */
.back-nav {
    margin-bottom: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.08rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgba(0, 217, 255, 0.2);
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--neon-blue);
    border-color: var(--neon-blue);
    background: rgba(0, 217, 255, 0.06);
}

.back-arrow {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.back-link:hover .back-arrow {
    transform: translateX(-4px);
}

/* ---- Section Header ---- */
.sub-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 217, 255, 0.15);
}

.sub-header .page-subtitle {
    margin-top: 0.8rem;
}

.section-brief {
    max-width: 700px;
    margin: 1.5rem auto 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.8;
    letter-spacing: 0.03rem;
}

/* ---- Filter Bar ---- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding: 1rem 1.5rem;
    background: rgba(10, 14, 39, 0.6);
    border: 1px solid rgba(0, 217, 255, 0.15);
    flex-wrap: wrap;
}

.filter-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    letter-spacing: 0.12rem;
    flex-shrink: 0;
}

.filter-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tag {
    padding: 0.4rem 1rem;
    font-size: 0.7rem;
    letter-spacing: 0.08rem;
    font-family: 'Courier New', monospace;
    background: transparent;
    border: 1px solid rgba(0, 217, 255, 0.3);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-tag:hover {
    color: var(--neon-blue);
    border-color: var(--neon-blue);
    background: rgba(0, 217, 255, 0.08);
}

.filter-tag.active {
    color: var(--darker-bg);
    background: var(--neon-blue);
    border-color: var(--neon-blue);
}

/* ---- Gallery Grid ---- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.gallery-grid.list-view {
    grid-template-columns: 1fr;
}

/* ---- Gallery Item (image-based) ---- */
.gallery-item {
    background: rgba(10, 14, 39, 0.7);
    border: 1px solid rgba(0, 217, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gallery-item:hover {
    border-color: var(--neon-blue);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 217, 255, 0.25);
}

.gallery-item.locked {
    opacity: 0.5;
    pointer-events: none;
}

.gallery-item.locked::after {
    content: 'CLEARANCE REQUIRED';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--warning-red);
    font-size: 0.7rem;
    letter-spacing: 0.12rem;
    background: rgba(0, 0, 0, 0.85);
    padding: 0.5rem 1rem;
    border: 1px solid var(--warning-red);
    z-index: 5;
}

/* Image area */
.item-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(0, 217, 255, 0.1);
}

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

.item-placeholder {
    font-size: 2.5rem;
    opacity: 0.3;
    color: var(--neon-blue);
}

/* Hover overlay */
.item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 17, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.overlay-text {
    color: var(--neon-blue);
    font-size: 0.75rem;
    letter-spacing: 0.15rem;
    border: 1px solid var(--neon-blue);
    padding: 0.5rem 1.2rem;
}

/* Item info */
.item-info {
    padding: 1.2rem;
}

.item-category {
    display: block;
    font-size: 0.6rem;
    letter-spacing: 0.12rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.item-title {
    color: var(--text-primary);
    font-size: 1rem;
    letter-spacing: 0.05rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.gallery-item:hover .item-title {
    color: var(--neon-blue);
}

.item-date {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.05rem;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
}

.item-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.item-tag {
    font-size: 0.55rem;
    letter-spacing: 0.08rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid rgba(0, 217, 255, 0.2);
    color: var(--text-secondary);
}

/* ---- Media Item (video-based) ---- */
.media-item {
    background: rgba(10, 14, 39, 0.7);
    border: 1px solid rgba(0, 217, 255, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.media-item:hover {
    border-color: var(--neon-blue);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 217, 255, 0.25);
}

.media-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid rgba(0, 217, 255, 0.1);
}

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

.play-icon {
    position: absolute;
    width: 56px;
    height: 56px;
    border: 2px solid var(--neon-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 8, 17, 0.8);
    transition: all 0.3s ease;
}

.play-icon::after {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent var(--neon-blue);
    margin-left: 4px;
}

.media-item:hover .play-icon {
    background: var(--neon-blue);
    box-shadow: 0 0 25px rgba(0, 217, 255, 0.5);
}

.media-item:hover .play-icon::after {
    border-color: transparent transparent transparent var(--darker-bg);
}

.media-duration {
    position: absolute;
    bottom: 0.6rem;
    right: 0.6rem;
    background: rgba(0, 0, 0, 0.85);
    color: var(--text-primary);
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    letter-spacing: 0.05rem;
}

.media-type-badge {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    background: rgba(0, 217, 255, 0.15);
    border: 1px solid rgba(0, 217, 255, 0.4);
    color: var(--neon-blue);
    font-size: 0.55rem;
    padding: 0.2rem 0.6rem;
    letter-spacing: 0.1rem;
}

.media-info {
    padding: 1.2rem;
}

.media-title {
    color: var(--text-primary);
    font-size: 1rem;
    letter-spacing: 0.05rem;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.media-item:hover .media-title {
    color: var(--neon-blue);
}

.media-description {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.media-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.media-date {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ---- Tattoo / Inkternal Item ---- */
.ink-item {
    background: rgba(10, 14, 39, 0.7);
    border: 1px solid rgba(0, 217, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ink-item:hover {
    border-color: var(--neon-blue);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 217, 255, 0.25);
}

.ink-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(0, 217, 255, 0.1);
}

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

.ink-info {
    padding: 1.2rem;
}

.ink-name {
    color: var(--text-primary);
    font-size: 1.05rem;
    letter-spacing: 0.05rem;
    margin: 0 0 0.4rem 0;
}

.ink-item:hover .ink-name {
    color: var(--neon-blue);
}

.ink-location {
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.06rem;
    margin-bottom: 0.6rem;
}

.ink-meaning {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-style: italic;
}

.ink-character {
    display: inline-block;
    margin-top: 0.6rem;
    font-size: 0.6rem;
    letter-spacing: 0.1rem;
    padding: 0.25rem 0.6rem;
    border: 1px solid rgba(0, 217, 255, 0.3);
    color: var(--neon-blue);
}

/* ---- Lightbox Modal ---- */
.lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

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

.lightbox-content {
    position: relative;
    z-index: 10000;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(8, 12, 30, 0.98);
    border: 1px solid rgba(0, 217, 255, 0.35);
    box-shadow: 0 0 50px rgba(0, 217, 255, 0.15);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid rgba(0, 217, 255, 0.4);
    color: var(--neon-blue);
    font-size: 1.2rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: var(--neon-blue);
    color: var(--darker-bg);
}

.lightbox-image {
    width: 100%;
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.lightbox-image img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

.lightbox-image .item-placeholder {
    font-size: 5rem;
    padding: 4rem;
}

.lightbox-details {
    padding: 2rem 2.5rem;
}

.lightbox-title {
    font-size: 1.6rem;
    color: var(--neon-blue);
    letter-spacing: 0.1rem;
    margin-bottom: 0.5rem;
}

.lightbox-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    letter-spacing: 0.08rem;
    margin-bottom: 1.5rem;
}

.lightbox-body {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.8;
}

.lightbox-body p {
    margin-bottom: 1rem;
}

.lightbox-meta {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 217, 255, 0.15);
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.lightbox-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.lightbox-meta-label {
    font-size: 0.6rem;
    letter-spacing: 0.12rem;
    color: var(--text-secondary);
}

.lightbox-meta-value {
    font-size: 0.85rem;
    color: var(--neon-blue);
    letter-spacing: 0.05rem;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-text {
    font-size: 0.9rem;
    letter-spacing: 0.05rem;
}

/* ---- Status Indicator ---- */
.archive-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--neon-blue);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.status-text {
    font-size: 0.65rem;
    letter-spacing: 0.12rem;
    color: var(--text-secondary);
}

.item-count {
    color: var(--neon-blue);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 768px) {
    .sub-archives-container {
        padding: 1rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .lightbox-content {
        margin: 1rem;
    }

    .lightbox-details {
        padding: 1.5rem;
    }

    .lightbox-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        gap: 1rem;
    }
}
