/**
 * Deep Zoom Viewer Styles
 * Enhanced OpenSeadragon viewer for astrophotography
 */

/* Viewer Container */
.photo-viewer {
    background: #000;
    margin-bottom: 60px;
    position: relative;
}

.viewer-container {
    position: relative;
    background: #111;
}

.image-viewer {
    height: 70vh;
    min-height: 500px;
    background: #000;
    cursor: crosshair;
}

/* When in fullscreen */
.fullscreen .image-viewer {
    height: 100vh !important;
}

/* OpenSeadragon Navigator Customization */
.openseadragon-container .navigator {
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    background: rgba(0, 0, 0, 0.8) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Viewer Controls */
.viewer-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 400px;
    z-index: 1000;
}

.viewer-btn {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 14px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 18px;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viewer-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.viewer-btn:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.1);
}

/* Zoom Display */
.zoom-display {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 60px;
    text-align: center;
}

/* Zoom Presets */
.zoom-presets {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 8px;
    z-index: 1000;
}

.preset-btn {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Coordinate Display */
.coordinate-display {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
}

/* Mobile Controls */
@media (max-width: 768px) {
    .viewer-controls {
        bottom: 10px;
        right: 10px;
        gap: 6px;
    }
    
    .viewer-controls.mobile-controls .viewer-btn {
        padding: 8px 10px;
        font-size: 16px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .zoom-presets {
        top: 10px;
        left: 10px;
        flex-wrap: wrap;
        max-width: 200px;
    }
    
    .preset-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .coordinate-display {
        font-size: 11px;
        padding: 6px 10px;
        bottom: 60px;
    }
    
    .zoom-display {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Mobile Hint */
.mobile-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    z-index: 2000;
    transition: opacity 0.5s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-hint p {
    margin: 0 0 10px 0;
    font-weight: 600;
}

.mobile-hint ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-hint li {
    margin: 5px 0;
    font-size: 14px;
}

/* Loading State */
.image-viewer.loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer.loading::after {
    content: 'Loading high-resolution image...';
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}

/* Rotation Controls */
#rotate-left,
#rotate-right {
    font-size: 16px;
}

/* Navigator Toggle State */
.navigator-hidden .navigator {
    display: none !important;
}

/* Performance Optimizations */
.openseadragon-canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: auto;  /* Better for astrophotography */
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    
    /* Better scaling for high-quality images */
    transform-origin: center;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .viewer-btn,
    .preset-btn {
        font-weight: 500;
    }
}

/* Fullscreen Mode */
:-webkit-full-screen .viewer-container {
    width: 100vw;
    height: 100vh;
}

:-moz-full-screen .viewer-container {
    width: 100vw;
    height: 100vh;
}

:fullscreen .viewer-container {
    width: 100vw;
    height: 100vh;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .photo-viewer {
        background: #000;
    }
    
    .viewer-container {
        background: #0a0a0a;
    }
}

/* Accessibility */
.viewer-btn:focus,
.preset-btn:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* Hover Effects for Desktop */
@media (hover: hover) {
    .viewer-btn:hover::after {
        content: attr(title);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.9);
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        white-space: nowrap;
        margin-bottom: 5px;
        pointer-events: none;
    }
}