/* ==========================================================================
   FAR Manager - IMG Viewer Styles
   ========================================================================== */

.img-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.img-viewer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.img-viewer {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.img-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.img-viewer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 0;
}

.img-viewer-title svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent);
    flex-shrink: 0;
}

.img-viewer-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.img-viewer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.img-viewer-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.img-viewer-btn:hover {
    background: var(--bg-active);
    color: var(--text-primary);
}

.img-viewer-btn svg {
    width: 16px;
    height: 16px;
}

.img-viewer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.15s;
}

.img-viewer-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.img-viewer-close svg {
    width: 20px;
    height: 20px;
}

.img-viewer-content {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.img-canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: repeating-conic-gradient(
        var(--bg-tertiary) 0% 25%,
        var(--bg-primary) 0% 50%
    ) 50% / 20px 20px;
    overflow: auto;
}

.img-canvas-container canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.img-info-panel {
    width: 200px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-left: 1px solid var(--border-color);
    flex-shrink: 0;
    overflow-y: auto;
}

.img-info-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.img-info-row:last-child {
    margin-bottom: 0;
}

.img-info-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.img-info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.img-error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
    gap: 16px;
}

.img-error-message svg {
    width: 48px;
    height: 48px;
    stroke: var(--warning);
}

.img-error-message p {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.img-error-hint {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* Mobile */
@media (max-width: 768px) {
    .img-viewer {
        width: 95%;
        max-height: 90vh;
    }
    
    .img-viewer-content {
        flex-direction: column;
    }
    
    .img-info-panel {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .img-info-row {
        flex: 1;
        min-width: 80px;
        margin-bottom: 0;
    }
    
    .img-viewer-btn span {
        display: none;
    }
    
    .img-viewer-btn {
        padding: 8px;
    }
}
