:root {
    --doc-primary: #1173d4;
    --doc-secondary: #e4efff;
    --doc-bg-light: #f6f7f8;
    --doc-bg-dark: #101922;
}

.doc-detail-page {
    background: var(--doc-bg-light);
    min-height: 100vh;
    padding: 2rem 0 3rem;
}

.dark .doc-detail-page {
    background: var(--doc-bg-dark);
    color: #f3f4f6;
}

.doc-detail-shell {
    margin: 0 auto;
    padding: 0 1.5rem;
}

.doc-detail-header {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.dark .doc-detail-header {
    background: #1f2937;
    color: #f3f4f6;
}

.doc-brand-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--doc-primary);
    font-size: 1.5rem;
}

.doc-header-search {
    min-width: 280px;
}

.doc-search-input {
    border-radius: 999px;
    background: var(--doc-secondary);
    border: none;
    box-shadow: 0 12px 30px rgba(17, 115, 212, 0.12);
}

.doc-search-input .input-group-text {
    border: none;
    background: transparent;
    color: #617589;
}

.doc-search-input .form-control {
    border: none;
    background: transparent;
    box-shadow: none;
    font-size: 0.95rem;
    color: #111418;
}

.dark .doc-search-input {
    background: #374151;
}

.dark .doc-search-input .form-control {
    color: #f3f4f6;
}

.doc-pill-btn {
    border-radius: 999px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
}

.doc-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f0f2f4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #111418;
}

.dark .doc-avatar {
    background: #374151;
    color: #f3f4f6;
}

.btn-doc-primary {
    background: var(--doc-primary);
    border-color: var(--doc-primary);
    color: #ffffff;
    border-radius: 0.75rem;
    font-weight: 600;
}

.btn-doc-primary:hover,
.btn-doc-primary:focus {
    background: var(--doc-primary);
    border-color: var(--doc-primary);
    opacity: 0.9;
    color: #ffffff;
}

.doc-viewer-card,
.doc-criteria-card {
    border-radius: 1.5rem;
    background: #ffffff;
    height: 100%;
}

.dark .doc-viewer-card,
.dark .doc-criteria-card {
    background: #1f2937;
}

.doc-criteria-card {
    background: var(--doc-secondary);
}

.dark .doc-criteria-card {
    background: #1f2937;
}

.doc-viewer-head .doc-title {
    color: #111418;
}

.dark .doc-viewer-head .doc-title {
    color: #ffffff;
}

.doc-toolbar {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.dark .doc-toolbar {
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 0.75rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #111418;
}

.btn-icon i {
    font-size: 0.95rem;
}

.doc-tab-nav {
    border-bottom: none;
    margin-top: 1.5rem;
    background: #f8fafc;
    border-radius: 1rem;
    padding: 0.25rem;
}

.dark .doc-tab-nav {
    background: #111827;
}

.doc-tab-nav .nav-link {
    border: none;
    border-radius: 0.9rem;
    color: #617589;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
}

.doc-tab-nav .nav-link.active {
    background: #ffffff;
    color: var(--doc-primary);
    box-shadow: 0 8px 20px rgba(17, 115, 212, 0.1);
}

.doc-search-within {
    width: 100%;
}

.doc-search-input {
    border-radius: 999px;
    background: #f0f2f4;
    border: none;
    flex: 1 1 auto;
}

.doc-search-input .input-group-text {
    border: none;
    background: transparent;
    color: #617589;
}

.doc-search-input .form-control {
    border: none;
    background: transparent;
    box-shadow: none;
}

.doc-search-submit {
    border-radius: 999px;
    background: var(--doc-primary);
    border-color: var(--doc-primary);
}

.doc-search-submit:hover,
.doc-search-submit:focus {
    background: var(--doc-primary);
    border-color: var(--doc-primary);
    opacity: 0.92;
}

.doc-search-within-input {
    max-width: 520px;
}

.doc-search-controls .btn {
    border-radius: 999px;
    border-color: var(--doc-primary);
    color: var(--doc-primary);
    min-width: 42px;
}

.doc-search-controls .btn:hover,
.doc-search-controls .btn:focus {
    background: var(--doc-primary);
    color: #ffffff;
}

.doc-search-counter {
    background: var(--doc-primary);
    color: #ffffff;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-weight: 600;
}

.dark .doc-search-input {
    background: #1f2937;
}

.dark .doc-search-input .form-control {
    color: #f3f4f6;
}

.dark .doc-search-controls .btn {
    border-color: var(--doc-primary);
    color: var(--doc-primary);
}

.doc-html-panel {
    background: #ffffff;
    border-radius: 1.25rem;
    margin-top: 1.5rem;
    padding: 1.75rem;
    max-height: 800px;
    overflow-y: auto;
    max-height: 95%;
    position: relative;
}

.dark .doc-html-panel {
    background: #0f172a;
    color: #e5e7eb;
}

.doc-highlight {
    background-color: rgba(17, 115, 212, 0.25);
    border-radius: 4px;
    padding: 0 2px;
}

.doc-highlight-active {
    background-color: rgba(17, 115, 212, 0.45);
    outline: 2px solid var(--doc-primary);
    border-radius: 4px;
}

.doc-pdf-panel {
    background: #101922;
    border-radius: 1.25rem;
    margin-top: 1.5rem;
    padding: 1.5rem;
    max-height: 800px;
    overflow-y: auto;
}

.doc-pdf-empty {
    background: #ffffff;
    border-radius: 1rem;
    padding: 2rem;
}

.doc-info-entry {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.doc-info-entry:last-child {
    border-bottom: none;
}

.dark .doc-info-entry {
    border-color: rgba(255, 255, 255, 0.08);
}

.doc-related-card {
    border-radius: 1.25rem;
}

.doc-related-card .card-body {
    padding: 1.25rem;
}

.doc-related-card h6 {
    font-size: 0.95rem;
    line-height: 1.5;
}

.dark .doc-related-card {
    background: #1f2937;
}

@media (max-width: 991.98px) {
    .doc-detail-header {
        flex-direction: column;
        align-items: stretch;
    }

    .doc-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

.pdf-canvas-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.pdf-page-wrapper {
    position: relative;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    background: #ffffff;
}

.pdf-canvas-container canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.textLayer {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    opacity: 0.2;
    line-height: 1;
}

.textLayer > span {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
}

.textLayer .highlight {
    margin: -1px;
    padding: 1px;
    background-color: rgb(180, 0, 170);
    border-radius: 4px;
}

.textLayer .highlight.begin {
    border-radius: 4px 0 0 4px;
}

.textLayer .highlight.end {
    border-radius: 0 4px 4px 0;
}

.textLayer .highlight.middle {
    border-radius: 0;
}

.textLayer .highlight.selected {
    background-color: rgb(0, 100, 0);
}

.textLayer[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

#documentTabs {
    border-bottom: 2px solid #dee2e6;
    padding: 0 15px;
    background-color: #f8f9fa;
}

#documentTabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    padding: 12px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#documentTabs .nav-link:hover {
    color: var(--doc-primary);
    border-bottom-color: var(--doc-primary);
}

#documentTabs .nav-link.active {
    color: var(--doc-primary);
    border-bottom-color: var(--doc-primary);
    background-color: transparent;
}

.html-content {
    line-height: 1.8;
    font-size: 15px;
}

.html-content h1,
.html-content h2,
.html-content h3,
.html-content h4,
.html-content h5,
.html-content h6 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.html-content p {
    margin-bottom: 15px;
}

.html-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.html-content table td,
.html-content table th {
    border: 1px solid #ddd;
    padding: 8px;
}

.html-content table th {
    background-color: #f2f2f2;
    font-weight: 600;
}

