/**
 * Direct Gallery Navigator Stylesheet
 * Modern Glassmorphism & Premium Controls
 */

/* ==========================================================================
   Attachment Page Floating Navigation Controls
   ========================================================================== */

.dgn-bar-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999999;
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(18, 20, 24, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
    border-radius: 40px;
    padding: 8px 16px;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dgn-bar-container:hover {
    background: rgba(18, 20, 24, 0.92);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Floating Navigation Arrows */
.dgn-nav-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    flex-shrink: 0;
}

.dgn-nav-arrow:hover {
    background: #ff7011;
    color: #ffffff !important;
    border-color: #ff7011;
    transform: scale(1.08);
    box-shadow: 0 0 16px rgba(255, 112, 17, 0.4);
}

.dgn-nav-arrow:active {
    transform: scale(0.96);
}

.dgn-nav-arrow svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* Metadata Badge & Counter */
.dgn-meta-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0 8px;
    text-align: center;
}

.dgn-counter {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
}

.dgn-back-link {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65) !important;
    text-decoration: none !important;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.dgn-badge-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dgn-fullsize-link {
    font-size: 11px;
    color: #ff8e3c !important;
    text-decoration: none !important;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.dgn-fullsize-link:hover {
    color: #ffffff !important;
    text-decoration: underline !important;
}

/* Side Viewport Navigation Arrows for Desktop Attachment View */
.dgn-side-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999990;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(18, 20, 24, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    transition: all 0.25s ease;
    cursor: pointer;
}

.dgn-side-arrow.dgn-side-prev {
    left: 24px;
}

.dgn-side-arrow.dgn-side-next {
    right: 24px;
}

.dgn-side-arrow:hover {
    background: rgba(255, 112, 17, 0.9);
    border-color: #ff7011;
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 8px 24px rgba(255, 112, 17, 0.35);
}

.dgn-side-arrow svg {
    width: 28px;
    height: 28px;
}

/* ==========================================================================
   Full Screen Lightbox Modal Overlay (For Gutenberg Galleries & Deep Links)
   ========================================================================== */

#dgn-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999999;
    background: rgba(10, 12, 16, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#dgn-lightbox-overlay.dgn-active {
    opacity: 1;
    visibility: visible;
}

/* Lightbox Image Container */
.dgn-lightbox-stage {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    transition: all 0.3s ease;
}

.dgn-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    user-select: none;
    -webkit-user-drag: none;
    cursor: zoom-in;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.dgn-lightbox-stage.dgn-is-zoomed {
    max-width: 100vw;
    max-height: 100vh;
    width: 100vw;
    height: 100vh;
    display: block;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 70px 0 30px 0;
    box-sizing: border-box;
}

.dgn-lightbox-img.dgn-zoomed-img {
    max-width: none !important;
    max-height: none !important;
    width: auto !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
    cursor: zoom-out !important;
    border-radius: 0;
}

/* Lightbox Arrow Buttons */
.dgn-lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10000000;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.dgn-lb-prev {
    left: 24px;
}

.dgn-lb-next {
    right: 24px;
}

.dgn-lb-arrow:hover {
    background: #ff7011;
    border-color: #ff7011;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(255, 112, 17, 0.5);
}

.dgn-lb-arrow svg {
    width: 24px;
    height: 24px;
}

/* Lightbox Header & Action Buttons */
.dgn-lb-header {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10000000;
    color: #ffffff;
}

.dgn-lb-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dgn-lb-counter-badge {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.dgn-lb-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.dgn-lb-btn:hover {
    background: #ff7011;
    border-color: #ff7011;
    transform: scale(1.1);
    box-shadow: 0 0 16px rgba(255, 112, 17, 0.4);
}

.dgn-lb-close:hover {
    background: rgba(239, 68, 68, 0.9) !important;
    border-color: #ef4444 !important;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.4) !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .dgn-bar-container {
        bottom: 16px;
        padding: 6px 12px;
        gap: 10px;
        width: calc(100% - 32px);
        max-width: 360px;
    }

    .dgn-side-arrow {
        display: none;
    }

    .dgn-lb-arrow {
        width: 42px;
        height: 42px;
    }

    .dgn-lb-prev {
        left: 10px;
    }

    .dgn-lb-next {
        right: 10px;
    }
}
