/* PDF Language Buttons */
.pdf-language-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 20px 0 30px;
}

.pdf-language-selector .vs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 12px 25px;
    background-color: var(--theme-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.pdf-language-selector .vs-btn:hover {
    background-color: var(--title-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

/* For Arabic button */
.pdf-language-selector .vs-btn[onclick*="Ar.pdf"] {
    font-family: 'Tajawal', sans-serif;
}

/* Scrollable content */
#pdf-viewer {
    overflow-y: auto;
    flex-grow: 1;
    padding: 20px;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* PDF Page Styling */
.pdf-page {
    margin: 0 auto 30px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    max-width: 100%;
    display: block;
    page-break-after: always;
    page-break-inside: avoid;
}

/* Make canvas responsive */
.pdf-page canvas {
    max-width: 100%;
    height: auto !important;
}

/* PDF Viewer Container */
.pdf-viewer-container {
    width: 100%;
    height: 80vh;
    min-height: 600px;
    max-height: 1200px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 20px 0;
    position: relative;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent double scrollbars */
}

/* PDF Viewer */
#pdf-viewer {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    box-sizing: border-box;
    background: white;
}

#pdf-frame {
    width: 100% !important;
    height: 100% !important;
    min-height: 800px;
    border: none;
}

/* Loading indicator */
#loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 10;
    color: #1F3D2E;
    font-size: 18px;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 1199.98px) {
    .pdf-viewer-container {
        height: 700px;
    }
}

@media (max-width: 991.98px) {
    .pdf-viewer-container {
        height: 600px;
    }
}

@media (max-width: 767.98px) {
    .pdf-viewer-container {
        height: 500px;
    }
    
    .pdf-language-selector {
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .pdf-language-selector .vs-btn {
        min-width: 120px;
        padding: 10px 15px;
        font-size: 13px;
    }
}

@media (max-width: 575.98px) {
    .pdf-language-selector {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .pdf-language-selector .vs-btn {
        width: 100%;
        max-width: 220px;
    }
    
    .pdf-viewer-container {
        height: 400px;
        margin: 10px auto 30px;
    }
}

/* Disable text selection in PDF viewer */
.pdf-viewer-container iframe {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

/* Enable pointer events only for navigation elements */
.pdf-viewer-container iframe[src*="google.com"] {
    pointer-events: auto;
}
