/* ============================================
   LEVEL 3 - INSTAGRAM FEED STYLE (FRESH BUILD)
   Pure Instagram experience
   ============================================ */

/* ============================================
   MAIN OVERLAY
   ============================================ */

.level3-feed-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
}

.level3-feed-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   HEADER - MOBILE
   ============================================ */

.level3-feed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: rgba(13, 13, 13, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(184, 149, 106, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 50; /* Lower than overlays but above content */
    transition: transform 0.3s ease;
}

.level3-feed-header.scrolled {
    transform: translateY(-100%);
}

.level3-feed-back {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--brass);
    font-size: 16px;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-left: -8px;
}

.level3-feed-back-arrow {
    font-size: 24px;
}

.level3-feed-counter {
    font-size: 14px;
    color: rgba(245, 242, 237, 0.6);
}

/* Floating back button - shows when header hidden */
.level3-floating-back {
    position: fixed;
    top: 20px;
    left: 20px;
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    backdrop-filter: none;
    border: none;
    color: var(--brass);
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200; /* Above everything */
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.8);
    padding: 8px;
}

.level3-floating-back.visible {
    opacity: 1;
    visibility: visible;
}

.level3-floating-back:active {
    opacity: 0.7;
    transform: scale(0.95);
}

/* Hide desktop header elements on mobile */
.level3-feed-header-content,
.level3-feed-close {
    display: none;
}

/* ============================================
   FEED CONTAINER
   ============================================ */

.level3-feed-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: y proximity;
    position: relative;
}

/* ============================================
   FEED ITEM (Each concept)
   ============================================ */

.level3-feed-item {
    width: 100%;
    height: 100svh; /* Use small viewport height (excludes browser UI) */
    position: relative;
    background: #000;
    scroll-snap-align: start;
    margin-bottom: 2px; /* Spacing between concepts */
}

/* First item should have top padding to account for fixed header */
.level3-feed-item:first-child {
    padding-top: 50px;
    height: calc(100svh + 50px);
}

/* Fallback for browsers that don't support svh */
@supports not (height: 100svh) {
    .level3-feed-item {
        height: calc(100vh - 50px);
    }
    
    .level3-feed-item:first-child {
        height: 100vh;
    }
}

/* ============================================
   IMAGES CONTAINER
   ============================================ */

.level3-feed-images {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #000;
}

.level3-feed-images-container {
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.level3-feed-image {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
}

.level3-feed-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================
   IMAGE NAVIGATION ARROWS
   ============================================ */

.level3-feed-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s;
}

.level3-feed-item:active .level3-feed-nav {
    opacity: 1;
}

.level3-feed-nav:disabled {
    opacity: 0 !important;
}

.level3-feed-nav-prev {
    left: 12px;
}

.level3-feed-nav-next {
    right: 12px;
}

/* ============================================
   TOP OVERLAY - Title + Label + Info Icon
   ALL overlayed on image
   ============================================ */

.level3-feed-top-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    padding: 16px 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 30;
    pointer-events: none;
}

.level3-feed-top-overlay > * {
    pointer-events: auto;
}

.level3-feed-title-wrapper {
    flex: 1;
}

.level3-feed-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 400;
    color: white;
    margin: 0 0 4px 0;
    line-height: 1.3;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.level3-feed-image-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.level3-feed-info-icon {
    color: white;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    transition: opacity 0.3s;
}

.level3-feed-info-icon:active {
    opacity: 0.7;
}

/* ============================================
   BOTTOM OVERLAY - Description + Meta + Dots
   ALL overlayed on image
   ============================================ */

.level3-feed-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    padding: 60px 20px 56px;
    color: white;
    z-index: 30;
    pointer-events: none;
}

.level3-feed-info > * {
    pointer-events: auto;
}

.level3-feed-tagline {
    font-size: 14px;
    color: white;
    margin: 0 0 8px 0;
    line-height: 1.5;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
    font-weight: 400;
}

.level3-feed-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    flex-wrap: wrap;
}

.level3-feed-meta-item {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

/* ============================================
   DOTS - Bottom center, overlayed on image
   ============================================ */

.level3-feed-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 40;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
}

.level3-feed-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
}

.level3-feed-dot.active {
    background: white;
    transform: scale(1.3);
}

/* ============================================
   DETAILS MODAL
   ============================================ */

.level3-details-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 80vh;
    background: rgba(13, 13, 13, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(184, 149, 106, 0.3);
    border-radius: 20px 20px 0 0;
    z-index: 2200;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.level3-details-modal.active {
    transform: translateY(0);
}

.level3-details-handle {
    width: 40px;
    height: 4px;
    background: rgba(184, 149, 106, 0.5);
    border-radius: 2px;
    margin: 12px auto;
}

.level3-details-content {
    padding: 0 20px 40px;
}

.level3-details-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 400;
    color: var(--white);
    margin: 0 0 16px 0;
}

.level3-details-description {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(245, 242, 237, 0.8);
    margin-bottom: 24px;
}

.level3-details-specs-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brass);
    margin: 0 0 16px 0;
    font-weight: 600;
}

.level3-details-spec {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(184, 149, 106, 0.1);
    font-size: 14px;
}

.level3-details-spec-label {
    color: rgba(245, 242, 237, 0.6);
}

.level3-details-spec-value {
    color: var(--white);
    font-weight: 500;
    text-align: right;
}

.level3-details-close {
    width: 100%;
    padding: 16px;
    background: transparent;
    border: 1px solid rgba(184, 149, 106, 0.3);
    border-radius: 4px;
    color: var(--brass);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 24px;
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */

.level3-feed-loading,
.level3-feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 50px);
    padding: 40px 20px;
}

.level3-feed-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(184, 149, 106, 0.2);
    border-top-color: var(--brass);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.level3-feed-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.level3-feed-empty-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 300;
    color: rgba(245, 242, 237, 0.7);
    margin: 0 0 8px 0;
}

.level3-feed-empty-text {
    font-size: 14px;
    color: rgba(245, 242, 237, 0.5);
    margin: 0;
}

/* ============================================
   DESKTOP (1024px+)
   ============================================ */

@media (min-width: 1024px) {
    .level3-feed-header {
        padding: 20px 60px;
        height: 70px;
    }
    
    .level3-feed-back {
        display: none;
    }
    
    .level3-feed-counter {
        display: none;
    }
    
    .level3-feed-header-content {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .level3-feed-close {
        display: flex;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        border: 1px solid rgba(184, 149, 106, 0.3);
        background: transparent;
        color: var(--brass);
        font-size: 1.5rem;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s;
    }
    
    .level3-feed-close:hover {
        background: var(--brass);
        color: white;
        transform: rotate(90deg);
    }
    
    .level3-feed-container {
        padding: 40px 60px;
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .level3-feed-item {
        max-height: 80vh;
        margin-bottom: 40px;
        border-radius: 4px;
        overflow: hidden;
        border: 1px solid rgba(184, 149, 106, 0.15);
    }
    
    .level3-feed-images {
        height: 65vh;
    }
    
    .level3-feed-nav {
        opacity: 0.7;
    }
    
    .level3-feed-nav:hover {
        opacity: 1;
        background: var(--brass);
        color: white;
    }
}

/* ============================================
   TABLET (768px - 1023px)
   ============================================ */

@media (min-width: 768px) and (max-width: 1023px) {
    .level3-feed-header {
        padding: 0 30px;
    }
    
    .level3-feed-top-overlay,
    .level3-feed-info {
        padding-left: 30px;
        padding-right: 30px;
    }
}
