/* NC Google Drive Viewer - Style dla viewera */

.nc-gdrive-viewer {
    position: relative;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.nc-gdrive-viewer[data-theme="dark"] {
    background: #1a1a1a;
    border-color: #444;
}

.nc-gdrive-viewer[data-theme="dark"] .nc-gdrive-controls {
    background: #2a2a2a;
    border-bottom: 1px solid #444;
}

/* Kontrolki viewera */
.nc-gdrive-controls {
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nc-gdrive-btn {
    background: #0073aa;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.nc-gdrive-btn:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.nc-gdrive-btn:active {
    transform: translateY(1px);
}

.nc-gdrive-btn.nc-gdrive-zoom-in,
.nc-gdrive-btn.nc-gdrive-zoom-out {
    background: #28a745;
}

.nc-gdrive-btn.nc-gdrive-zoom-in:hover,
.nc-gdrive-btn.nc-gdrive-zoom-out:hover {
    background: #218838;
}

.nc-gdrive-btn.nc-gdrive-zoom-fit {
    background: #17a2b8;
}

.nc-gdrive-btn.nc-gdrive-zoom-fit:hover {
    background: #138496;
}

.nc-gdrive-btn.nc-gdrive-fullscreen {
    background: #6f42c1;
}

.nc-gdrive-btn.nc-gdrive-fullscreen:hover {
    background: #5a32a3;
}

.nc-gdrive-btn.nc-gdrive-rotate {
    background: #fd7e14;
}

.nc-gdrive-btn.nc-gdrive-rotate:hover {
    background: #e55a00;
}

.nc-gdrive-btn.nc-gdrive-download {
    background: #dc3545;
}

.nc-gdrive-btn.nc-gdrive-download:hover {
    background: #c82333;
}

.nc-gdrive-btn.nc-gdrive-info {
    background: #6c757d;
}

.nc-gdrive-btn.nc-gdrive-info:hover {
    background: #545b62;
}

.nc-gdrive-btn.nc-gdrive-exit-fullscreen {
    background: #dc3545;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 999999997 !important; /* Ultra high z-index - 2 */
    isolation: isolate !important;
}

.nc-gdrive-btn.nc-gdrive-exit-fullscreen:hover {
    background: #c82333;
}

/* Zoom level indicator */
.nc-gdrive-zoom-level {
    font-size: 12px;
    color: #666;
    margin-left: auto;
    padding: 4px 8px;
    background: #e9ecef;
    border-radius: 3px;
    font-weight: 500;
}

.nc-gdrive-viewer[data-theme="dark"] .nc-gdrive-zoom-level {
    background: #444;
    color: #ccc;
}

/* Image container */
.nc-gdrive-image-container {
    position: relative;
    overflow: hidden;
    text-align: center;
    background: #f8f9fa;
}

.nc-gdrive-viewer[data-theme="dark"] .nc-gdrive-image-container {
    background: #1a1a1a;
}

.nc-gdrive-image-container img {
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

/* PDF viewer */
.nc-gdrive-pdf-container {
    position: relative;
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.nc-gdrive-pdf-viewer iframe {
    border: none;
    width: 100%;
    height: 100%;
    display: block;
    background: white;
}

/* Office viewer */
.nc-gdrive-office-viewer iframe {
    border: none;
    width: 100%;
    height: 100%;
}

/* Video viewer */
.nc-gdrive-video-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nc-gdrive-video-viewer video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Audio viewer */
.nc-gdrive-audio-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.nc-gdrive-audio-viewer audio {
    width: 100%;
    max-width: 600px;
}

/* Generic viewer */
.nc-gdrive-generic-viewer {
    padding: 20px;
    text-align: center;
}

.nc-gdrive-file-info h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.nc-gdrive-viewer[data-theme="dark"] .nc-gdrive-file-info h4 {
    color: #fff;
}

.nc-gdrive-file-info p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

.nc-gdrive-viewer[data-theme="dark"] .nc-gdrive-file-info p {
    color: #ccc;
}

/* Fullscreen mode */
.nc-gdrive-viewer.nc-gdrive-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999999 !important; /* Ultra high z-index */
    background: white !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    isolation: isolate !important;
}

.nc-gdrive-viewer[data-theme="dark"].nc-gdrive-fullscreen {
    background: #1a1a1a !important;
}

.nc-gdrive-viewer.nc-gdrive-fullscreen .nc-gdrive-controls {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 999999998 !important; /* Ultra high z-index - 1 */
    background: #f8f9fa !important;
    border-bottom: 1px solid #ddd !important;
    padding: 8px 12px !important;
    isolation: isolate !important;
}

.nc-gdrive-viewer[data-theme="dark"].nc-gdrive-fullscreen .nc-gdrive-controls {
    background: #2a2a2a !important;
    border-bottom-color: #444 !important;
}

.nc-gdrive-viewer.nc-gdrive-fullscreen iframe,
.nc-gdrive-viewer.nc-gdrive-fullscreen .nc-gdrive-image-container {
    position: absolute !important;
    top: 50px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: calc(100vh - 50px) !important;
    z-index: 1 !important;
    isolation: isolate !important;
}

.nc-gdrive-viewer.nc-gdrive-fullscreen .nc-gdrive-generic-viewer {
    position: absolute !important;
    top: 50px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: calc(100vh - 50px) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Fullscreen overlay - USUNIĘTY - powodował problemy */

/* Body w pełnym ekranie */
body.nc-gdrive-fullscreen-active {
    overflow: hidden !important;
    position: relative !important;
}

/* Hide all other content when fullscreen is active */
body.nc-gdrive-fullscreen-active * {
    visibility: hidden !important;
}

/* Show only the fullscreen viewer */
body.nc-gdrive-fullscreen-active .nc-gdrive-viewer.nc-gdrive-fullscreen,
body.nc-gdrive-fullscreen-active .nc-gdrive-viewer.nc-gdrive-fullscreen * {
    visibility: visible !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .nc-gdrive-controls {
        padding: 6px 8px;
        gap: 4px;
    }
    
    .nc-gdrive-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .nc-gdrive-zoom-level {
        font-size: 11px;
        padding: 2px 6px;
    }
}

/* Animation for zoom */
.nc-gdrive-image-container img.nc-gdrive-zooming {
    transition: transform 0.3s ease;
}

/* Loading state */
.nc-gdrive-viewer.nc-gdrive-loading {
    position: relative;
}

.nc-gdrive-viewer.nc-gdrive-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: nc-gdrive-spin 1s linear infinite;
}

@keyframes nc-gdrive-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error states */
.nc-gdrive-viewer.nc-gdrive-error {
    border-color: #dc3545;
    background: #f8d7da;
}

.nc-gdrive-viewer.nc-gdrive-error .nc-gdrive-controls {
    background: #f5c6cb;
    border-bottom-color: #dc3545;
}

/* Success states */
.nc-gdrive-viewer.nc-gdrive-success {
    border-color: #28a745;
    background: #d4edda;
}

.nc-gdrive-viewer.nc-gdrive-success .nc-gdrive-controls {
    background: #c3e6cb;
    border-bottom-color: #28a745;
}

/* Access error styles */
.nc-gdrive-access-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    color: #721c24;
}

.nc-gdrive-access-error a {
    color: #721c24;
    text-decoration: underline;
}

.nc-gdrive-access-error a:hover {
    color: #491217;
}