﻿/* pdf-viewer-enhanced.css - Place this file in wwwroot/css/ */

/* Container and layout styles */
.pdf-viewer-container {
    font-family: 'Arabic Typesetting','Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin-bottom: 30px;
}

.viewer-header {
    margin-bottom: 20px;
}

.controls-container {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #e9ecef;
}

.pdf-display-container {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

.pdf-info {
    margin-top: 20px;
}

/* PDF viewer specific styles */
.pdf-main-container {
    background-color: #f5f5f5;
}

.pdf-toolbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pdf-viewer {
    background-color: #f5f5f5;
    padding: 20px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-container {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.pdf-canvas {
    display: block;
}

/* PDF loading indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #6c757d;
}

/* RTL specific styles */
[dir="rtl"], .pdf-viewer, .textLayer {
    direction: rtl !important;
    text-align: right !important;
}

/* Text layer styling for Arabic content */
.textLayer {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    color: #000;
    font-family: "Traditional Arabic", "Amiri", "Scheherazade New", "Arial", sans-serif !important;
    overflow: hidden;
    opacity: 0.2;
    line-height: 1.0;
}

    .textLayer > span {
        color: transparent;
        position: absolute;
        white-space: pre;
        cursor: text;
        transform-origin: 0% 0%;
    }

    .textLayer .highlight {
        margin: -1px;
        padding: 1px;
        background-color: rgba(180, 0, 170, 0.2);
        border-radius: 4px;
    }

        .textLayer .highlight.selected {
            background-color: rgba(0, 100, 0, 0.2);
        }

/* Text selection in RTL mode */
::selection {
    background: rgba(0, 0, 255, 0.2);
}

/* Improved Arabic font rendering */
.textLayer > span {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Button and control styling */
.pdf-toolbar button {
    transition: all 0.2s ease;
}

    .pdf-toolbar button:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

/* Page indicator styling */
.page-indicator {
    font-family: "Traditional Arabic", "Amiri", "Arial", sans-serif;
    font-size: 1.1em;
    padding: 5px 10px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    bottom: 10px;
    width: fit-content;
    margin: 0 auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pdf-toolbar {
        flex-direction: column;
        padding: 5px;
    }

    .navigation, .zoom-controls {
        margin: 5px 0;
        width: 100%;
        justify-content: center;
    }

    .pdf-viewer {
        padding: 10px;
    }
}

/* Button icons */
#prev::after {
    content: "→";
    margin-right: 4px;
}

#next::before {
    content: "←";
    margin-left: 4px;
}

/* Print styles */
@media print {
    .pdf-toolbar, .controls-container, .viewer-header, .pdf-info {
        display: none !important;
    }

    .pdf-viewer {
        padding: 0;
        margin: 0;
    }

    .page-container {
        box-shadow: none;
        margin: 0;
        page-break-after: always;
    }
}
