/* Custom High-Resolution Image Viewer Styling */
.custom-image-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.civ-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 18, 0.95);
    z-index: 1;
}

.civ-header {
    position: relative;
    z-index: 10;
    height: 52px;
    background: rgba(20, 26, 32, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    color: #ffffff;
}

.civ-title {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
    color: #e0e0e0;
}

.civ-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.civ-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.civ-btn:hover, .civ-btn:focus {
    background: #FF6600;
    border-color: #FF6600;
    outline: 2px solid #FF6600;
}

.civ-close {
    background: rgba(220, 53, 69, 0.4);
    border-color: rgba(220, 53, 69, 0.6);
}

.civ-close:hover, .civ-close:focus {
    background: #dc3545;
    border-color: #dc3545;
}

.civ-body {
    position: relative;
    z-index: 2;
    flex: 1;
    overflow: hidden;
    width: 100%;
    height: calc(100vh - 52px);
}

.civ-viewport {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.civ-image {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    will-change: transform;
    pointer-events: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.civ-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #FF6600;
    border-radius: 50%;
    animation: civ-spin 0.8s linear infinite;
    z-index: 5;
}

.civ-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff6b6b;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.8);
    padding: 16px 24px;
    border-radius: 6px;
    border: 1px solid #ff6b6b;
}

@keyframes civ-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
