/* Modal fullscreen za mobilni */
@media (max-width: 900px) {
  .pdf-loading {
    display: none !important;
  }
}
@media (max-width: 900px) {
    .pdf-viewer-container.modal-fullscreen {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100vw !important;
        height: 100vh !important;
        z-index: 99999;
        background: rgba(34,34,34,0.98);
        border-radius: 0;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .pdf-viewer-container.modal-fullscreen .pdf-canvas-wrapper {
        height: 100vh !important;
        padding: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .pdf-viewer-container.modal-fullscreen .pdf-embed {
        max-width: 98vw;
        max-height: 90vh;
        margin: 0 auto;
    }
    .pdf-viewer-container.modal-fullscreen .pdf-navigation {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        background: transparent;
        box-shadow: none;
    }
}
/* Sakrij fullscreen dugme u navigaciji na mobilnom */
@media (max-width: 900px) {
    .pdf-navigation .pdf-fullscreen {
        display: none !important;
    }
}
/* Close fullscreen dugme za mobilni, samo u fullscreen */
.pdf-close-fullscreen {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 10010;
    background: none;
    border: none;
    padding: 0;
    display: none;
    cursor: pointer;
}
@media (max-width: 900px) {
    .pdf-viewer-container.fullscreen .pdf-close-fullscreen {
        display: block;
    }
}
/* Navigation dugmad u istoj boji kao fullscreen dugme */
.pdf-nav-btn {
    background: #035046 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0 !important;
}
/* Override fullscreen dugme stilova za desktop prema zahtevu */
@media (min-width: 901px) {
    .pdf-zoom-controls button,
    .pdf-fullscreen {
        background: #035046 !important;
        color: #fff !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 5px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 24px !important;
        font-weight: bold !important;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
        transition: background 0.2s, transform 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .pdf-fullscreen svg {
        width: 24px;
        height: 24px;
    }
}
/* Novi stil za fullscreen dugme: veliko, zeleno, kvadratno, centrirano */
.pdf-zoom-controls {
    position: absolute;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.pdf-fullscreen {
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 12px;
    width: 64px;
    height: 64px;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(40,167,69,0.15);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    padding: 0;
}
.pdf-fullscreen:hover, .pdf-fullscreen:focus {
    background: #218838;
    transform: scale(1.08);
}
.pdf-fullscreen:active {
    background: #176c2b;
    transform: scale(0.96);
}

/* Veća fullscreen ikonica */
.pdf-fullscreen svg {
    width: 36px;
    height: 36px;
    display: block;
}

@media (max-width: 900px) {
    .pdf-fullscreen {
        width: 56px;
        height: 56px;
        font-size: 30px;
    }
    .pdf-zoom-controls {
        bottom: 20px;
    }
}
/* Fullscreen PDF viewer */
.pdf-viewer-container.fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999;
    background: #222;
    border-radius: 0;
    box-shadow: none;
}
.pdf-viewer-container.fullscreen .pdf-canvas-wrapper {
    height: 100vh !important;
    padding: 0 !important;
}
.pdf-viewer-container.fullscreen .pdf-embed {
    max-width: 100vw;
    max-height: 100vh;
}
.pdf-viewer-container.fullscreen .pdf-zoom-controls {
    right: 40px;
    bottom: 40px;
}
/* Zoom Controls */
.pdf-zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 60;
}

.pdf-zoom-controls button {
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: background 0.2s, transform 0.2s;
}
.pdf-zoom-controls button:hover {
    background: #0056b3;
    transform: scale(1.08);
}
.pdf-zoom-controls button:active {
    background: #003d80;
    transform: scale(0.95);
}
/**
 * PDF Viewer Styles
 * Modern, responsive design for PDF viewer with language flags
 */

/* Container */
.pdf-viewer-container {
    position: relative;
    width: 100%;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

/* Language Flags Overlay */
.pdf-language-flags {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 100;
}

.flag-btn {
    width: var(--flag-size, 40px);
    height: var(--flag-size, 40px);
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid #fff;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flag-btn svg {
    width: 100%;
    height: 100%;
    display: block;
}

.flag-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.flag-btn.active {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.5);
    transform: scale(1.15);
}

.flag-btn:active {
    transform: scale(1.05);
}

/* PDF Canvas Wrapper */
.pdf-canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    padding: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
}

.pdf-embed {
    display: block;
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    background: #fff;
}

/* Loading Indicator */
.pdf-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(245, 245, 245, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 50;
}

.pdf-loading.visible {
    display: flex;
}

.pdf-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #ddd;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: pdf-spin 1s linear infinite;
}

@keyframes pdf-spin {
    to {
        transform: rotate(360deg);
    }
}

.pdf-loading p {
    margin-top: 20px;
    color: #666;
    font-size: 16px;
    font-weight: 500;
}

/* Navigation Controls */
.pdf-navigation {
    background: #fff;
    border-top: 1px solid #ddd;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.pdf-nav-btn {
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.pdf-nav-btn svg {
    width: 24px;
    height: 24px;
}

.pdf-nav-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: scale(1.05);
}

.pdf-nav-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.pdf-nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Page Info */
.pdf-page-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    min-width: 60px;
    justify-content: center;
}

.pdf-current-page {
    color: #007bff;
}

.pdf-separator {
    color: #999;
}

.pdf-total-pages {
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .pdf-language-flags {
        top: 10px;
        right: 10px;
        gap: 8px;
    }
    
    .flag-btn {
        width: calc(var(--flag-size, 40px) * 0.8);
        height: calc(var(--flag-size, 40px) * 0.8);
        border-width: 2px;
    }
    
    .pdf-canvas-wrapper {
        padding: 10px;
    }
    
    .pdf-navigation {
        padding: 10px 15px;
        gap: 15px;
    }
    
    .pdf-nav-btn {
        width: 38px;
        height: 38px;
    }
    
    .pdf-nav-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .pdf-page-info {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .pdf-language-flags {
        top: 8px;
        right: 8px;
        gap: 6px;
    }
    
    .flag-btn {
        width: calc(var(--flag-size, 40px) * 0.6);
        height: calc(var(--flag-size, 40px) * 0.6);
    }
    
    .pdf-navigation {
        padding: 8px 10px;
        gap: 10px;
    }
    
    .pdf-nav-btn {
        width: 34px;
        height: 34px;
    }
    
    .pdf-nav-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Elementor Editor Compatibility */
.elementor-editor-active .pdf-viewer-container {
    min-height: 400px;
}

/* Print Styles */
@media print {
    .pdf-language-flags,
    .pdf-navigation {
        display: none;
    }
    
    .pdf-viewer-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Accessibility */
.pdf-nav-btn:focus,
.flag-btn:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .pdf-viewer-container {
        background: #2a2a2a;
    }
    
    .pdf-canvas-wrapper {
        background: #1a1a1a;
    }
    
    .pdf-navigation {
        background: #2a2a2a;
        border-top-color: #444;
    }
    
    .pdf-page-info {
        color: #e0e0e0;
    }
    
    .pdf-current-page {
        color: #5ca3ff;
    }
    
    .pdf-separator {
        color: #888;
    }
    
    .pdf-total-pages {
        color: #aaa;
    }
    
    .pdf-loading {
        background: rgba(42, 42, 42, 0.95);
    }
    
    .pdf-loading p {
        color: #e0e0e0;
    }
    
    .pdf-spinner {
        border-color: #444;
        border-top-color: #5ca3ff;
    }
}
