/*
 * Detail Overlay Styles
 * Paper document that slides out of the selected folder - NO TILT
 */

/* Overlay Container */
.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
    background: rgba(0, 0, 0, 0);
    transition: background 0.4s ease;
}

.detail-overlay.active {
    pointer-events: all;
    background: rgba(0, 0, 0, 0.4);
}

/* The Paper Document - slides out straight, no tilt */
.detail-document {
    position: fixed;
    top: 59%;
    left: 49%;
    width: calc(var(--folder-height));
    height: calc(var(--folder-height));
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    background-image: url('../assets/folder-content-background.svg');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    /* Start position - below, will slide up */
    transform: translate(-50%, -40%) scale(0.95);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.detail-overlay.active .detail-document {
    /* End position - centered, no rotation */
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* Close Button */
.close-detail {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: var(--color-bg-cream, #fcfaf1);
    border: 2px solid var(--color-primary, #1d5037);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    color: var(--color-primary, #1d5037);
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.close-detail:hover {
    background: var(--color-note, #e5e8a7);
}

/* Document Content Container */
#detail-content {
    padding: 40px 90px 40px 110px;
}

/* Document Header - Matching Figma */
.document-header {
    position: relative;
    margin-bottom: 10px;
    padding-right: 90px;
}

.header-label {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-primary, #1d5037);
    margin-bottom: 5px;
}

.header-title {
    font-family: 'Courier New', Courier, monospace;
    font-size: 18px;
    line-height: 1.4;
    color: var(--color-primary, #1d5037);
    margin-bottom: 5px;
}

.header-date {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.4;
    color: var(--color-primary, #1d5037);
}

/* Dossier Number Badge */
.document-dossier {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--color-note, #e5e8a7);
    border: 2px solid var(--color-primary, #1d5037);
    padding: 5px 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--color-primary, #1d5037);
}

/* Document Gallery - Matching Figma */
.document-gallery {
    background: var(--color-note, #e5e8a7);
    border: 2px solid var(--color-primary, #1d5037);
    margin-bottom: 15px;
    position: relative;
}

.gallery-main {
    width: 100%;
    height: 320px;
    padding: 5px;
    position: relative;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: rgba(29, 80, 55, 0.1);
}

/* Gallery Navigation Arrows - using your SVGs */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-bg-cream, #fcfaf1);
    border: 2px solid var(--color-primary, #1d5037);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-primary, #1d5037);
    padding: 0;
    transition: background 0.2s;
    z-index: 2;
}

.gallery-arrow:hover {
    background: var(--color-note, #e5e8a7);
}

.gallery-arrow img {
    width: 22px;
    height: 22px;
}

.arrow-left {
    left: 10px;
}

.arrow-right {
    right: 10px;
}

/* Gallery Dot Indicators */
.gallery-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border: 1px solid var(--color-primary, #1d5037);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.indicator-dot.active,
.indicator-dot:hover {
    background: var(--color-primary, #1d5037);
}

/* Info Section */
.document-info {
    margin-bottom: 15px;
}

.info-heading {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-primary, #1d5037);
    margin-bottom: 5px;
}

.info-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-primary, #1d5037);
}

.info-text p {
    margin-bottom: 10px;
}

.info-text p:last-child {
    margin-bottom: 0;
}

/* Paleobiologist Notes Section */
.document-notes {
    background: var(--color-note, #e5e8a7);
    border: 2px solid var(--color-primary, #1d5037);
    padding: 12px 16px;
}

.notes-heading {
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-primary, #1d5037);
    margin-bottom: 6px;
}

.notes-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-style: italic;
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-primary, #1d5037);
    margin-bottom: 8px;
}

.notes-details {
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    line-height: 1.5;
    color: var(--color-primary, #1d5037);
    letter-spacing: 0.5px;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    /*.detail-document {
        width: calc(100% - 24px);
        max-height: calc(100vh - 40px);
    }*/

    #detail-content {
        padding: 12px;
    }

    .document-header {
        padding-right: 70px;
    }

    .header-title {
        font-size: 16px;
    }

    .gallery-main {
        height: 250px;
    }

    .document-dossier {
        font-size: 10px;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .gallery-main {
        height: 200px;
    }

    .header-title {
        font-size: 15px;
    }

    .info-text,
    .notes-text {
        font-size: 12px;
    }
}

@media (max-width: 1600px) {
    :root {
        --folder-width: 655px;
        --folder-height: 745px;
    }
}

@media (max-width: 1400px) {
    :root {
        --folder-width: 550px;
        --folder-height: 626px;
    }
}

@media (max-width: 1100px) {
    :root {
        --folder-width: 450px;
        --folder-height: 512px;
    }
}

@media (max-width: 800px) {
    :root {
        --folder-width: 350px;
        --folder-height: 398px;
    }
}

/* ============================================
   FULLSCREEN IMAGE LIGHTBOX
   ============================================ */

.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-lightbox.active {
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--color-bg-cream, #fcfaf1);
    border: 2px solid var(--color-primary, #1d5037);
    color: var(--color-primary, #1d5037);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.lightbox-close:hover {
    background: var(--color-note, #e5e8a7);
    transform: scale(1.05);
}

.lightbox-image-container {
    max-width: 90%;
    max-height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: var(--color-bg-cream, #fcfaf1);
    border: 2px solid var(--color-primary, #1d5037);
    color: var(--color-primary, #1d5037);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.lightbox-arrow:hover {
    background: var(--color-note, #e5e8a7);
    transform: translateY(-50%) scale(1.05);
}

.lightbox-arrow svg {
    width: 30px;
    height: 30px;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-cream, #fcfaf1);
    border: 2px solid var(--color-primary, #1d5037);
    padding: 10px 20px;
    font-family: var(--font-heading, 'Courier New', monospace);
    font-size: 16px;
    color: var(--color-primary, #1d5037);
}

/* Make gallery images clickable */
.gallery-image {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gallery-image:hover {
    transform: scale(1.02);
}