.archive-container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

/* HEADER */
.viewer-header-section { margin-bottom: 25px; }

.archive-breadcrumb {
    font-size: 13px;
    margin-bottom: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.archive-breadcrumb a { text-decoration: none; color: var(--muted); }
.archive-breadcrumb .sep { opacity: 0.4; }

.viewer-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.page-title-main {
    font-size: 26px;
    font-weight: 600;
    color: var(--primary);
    margin: 0;
}

.date-badge {
    background: #fff;
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--primary);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.date-badge i { color: var(--accent); }

/* VIEWER CARD */
.viewer-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.viewer-card-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.file-name { font-size: 14px; display: flex; align-items: center; gap: 8px; color: var(--primary); }
.file-name i { color: #dc2626; }
.search-tip { font-size: 12px; color: var(--muted); }

/* IFRAME */
.iframe-wrapper {
    background: var(--viewer-bg);
    line-height: 0;
}

.main-pdf-iframe {
    width: 100%;
    height: 900px;
    border: none;
}

/* EMPTY STATE */
.empty-state {
    padding: 80px 20px;
    text-align: center;
    background: #fff;
    border-radius: 12px;
    border: 1px dashed var(--border);
    color: var(--muted);
}
.empty-state i { font-size: 40px; margin-bottom: 10px; display: block; }

@media (max-width: 992px) {
    .viewer-title-row { flex-direction: column; }
    .main-pdf-iframe { height: 600px; }
}

.archive-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 20px;
    background: #f4f4f7;
    border-radius: 12px;
}

.page-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
    aspect-ratio: 3/4;
    display: flex;
    flex-direction: column;
}

.page-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.page-card canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.page-number-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(45, 55, 72, 0.9);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.loading-skeleton {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    background: #f8fafc;
    border-radius: 12px;
    color: #64748b;
    gap: 15px;
}

.loading-skeleton .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
    flex-shrink: 0;
}

.pagination-wrapper .page-link {
    color: #1e293b;
    border: 1px solid #e2e8f0;
    margin: 0 3px;
    border-radius: 6px;
    font-weight: 600;
    padding: 8px 16px;
    transition: all 0.2s;
}

.pagination-wrapper .page-item.active .page-link {
    background-color: #8B6F3D;
    border-color: #8B6F3D;
    color: white;
}

.pagination-wrapper .page-link:hover:not(.active) {
    background-color: #f1f5f9;
    color: #8B6F3D;
}

.pagination-wrapper .page-item.disabled .page-link {
    color: #cbd5e1;
    pointer-events: none;
    background-color: #f8fafc;
}

/* პრევიუ ბარათის კონტეინერი */
.page-card {
    position: relative;
    cursor: pointer;
    background: #fff;
}

/* ტექსტური ფენა Canvas-ის თავზე */
.textLayer {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    line-height: 1.0;
    opacity: 0.4; /* მონიშვნის გამჭვირვალობა */
}

.textLayer span {
    color: transparent; /* ტექსტი თავად უხილავია */
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
}

/* მონიშნული სიტყვის სტილი გალერეაში */
.pdf-highlight {
    background-color: yellow !important;
    color: transparent !important;
    border-radius: 2px;
}

.pdf-canvas-container {
    position: relative;
    display: inline-block;
    width: 100%;
}