/* Extraia Public Archive UI Styles - GoPro Media Library Aesthetic (Light Theme) */

:root {
    --gopro-card-min-width: 140px;
}

.public-archive-container {
    display: flex;
    flex-direction: column;
    margin-top: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    min-height: 600px;
    color: #1e293b;
    width: 100%;
    box-sizing: border-box;
}

/* GoPro Top Toolbar */
.gopro-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.gopro-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 280px;
    max-width: 480px;
}

/* Integrated Search Box in Toolbar */
.gopro-search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 25px;
    padding: 0.55rem 1.25rem;
    width: 100%;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.gopro-search-box:focus-within {
    background: #ffffff;
    border-color: #2B4A3B;
    box-shadow: 0 0 0 3px rgba(43, 74, 59, 0.12);
}

.gopro-search-box svg {
    color: #64748b;
    flex-shrink: 0;
}

.gopro-search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.92rem;
    color: #1e293b;
    width: 100%;
    font-family: inherit;
}

.gopro-search-box input::placeholder {
    color: #94a3b8;
}

.gopro-search-clear {
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    color: #94a3b8;
    transition: all 0.15s ease;
    flex-shrink: 0;
    line-height: 1;
}

.gopro-search-clear:hover {
    color: #1e293b;
    background: #e2e8f0;
}

.gopro-topbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* GoPro Thumbnail Size Slider (Light Theme) */
.gopro-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    position: relative;
}

.gopro-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 90px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.gopro-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2B4A3B; /* Brand Forest Green */
    cursor: pointer;
    box-shadow: 0 0 6px rgba(43, 74, 59, 0.4);
    transition: transform 0.15s ease;
}

.gopro-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

.gopro-slider-tooltip {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #ffffff;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.gopro-slider-container:hover .gopro-slider-tooltip {
    opacity: 1;
}

.gopro-view-toggle {
    color: #64748b;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.2s ease;
}

.gopro-view-toggle:hover {
    color: #2B4A3B;
}

/* Main Content */
.archive-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Folder & Media Styles (GoPro Layout) */
.gopro-media-library {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    margin-top: 0.5rem;
}

.gopro-folder-section {
    display: flex;
    flex-direction: column;
    background: transparent;
}

.gopro-folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.2rem;
    background: transparent;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.gopro-folder-header:hover {
    opacity: 0.85;
}

.gopro-folder-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.gopro-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: transform 0.25s ease;
}

.gopro-chevron.collapsed {
    transform: rotate(-90deg);
}

.gopro-folder-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.gopro-folder-name {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #1e293b;
    letter-spacing: -0.2px;
}

.gopro-folder-badge {
    color: #2B4A3B;
    background: rgba(43, 74, 59, 0.08);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    margin-left: 4px;
}

.gopro-folder-right {
    display: flex;
    align-items: center;
}

.gopro-folder-toggle-hint {
    font-size: 0.78rem;
    font-weight: 500;
    color: #94a3b8;
    transition: color 0.2s;
}

.gopro-folder-header:hover .gopro-folder-toggle-hint {
    color: #B8972F;
}

.gopro-folder-body {
    transition: max-height 0.35s ease, opacity 0.25s ease;
    max-height: 4000px;
    opacity: 1;
    overflow: hidden;
}

.gopro-folder-body.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Tight GoPro Media Grid */
.gopro-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--gopro-card-min-width, 140px), 1fr));
    gap: 8px; /* Tight gap matching GoPro */
    margin-top: 0.6rem;
}

.gopro-empty-folder {
    padding: 1.5rem 1rem;
    color: #94a3b8;
    font-size: 0.88rem;
    font-style: italic;
}

/* Compact GoPro Card */
.gopro-card {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 6px; /* Clean GoPro corner radius */
    overflow: hidden;
    background: #0f172a;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, border-color 0.2s ease;
}

.gopro-card:hover {
    transform: scale(1.04);
    z-index: 5;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    border-color: rgba(43, 74, 59, 0.4);
}

.gopro-card-thumb {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #141a17;
}

.gopro-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gopro-card:hover .gopro-card-thumb img {
    transform: scale(1.08);
}

.gopro-thumb-placeholder,
.gopro-thumb-fallback {
    color: #475569;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Bottom-left pill badge matching GoPro 0:22 */
.gopro-card-badge-bl {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    z-index: 3;
    pointer-events: none;
    letter-spacing: 0.2px;
}

/* Card hover overlay */
.gopro-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.2) 40%, rgba(0, 0, 0, 0.9) 100%);
    padding: 0.45rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.gopro-card:hover .gopro-card-overlay {
    opacity: 1;
}

.gopro-card-title {
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
}

.btn-archive-clear {
    background: rgba(43, 74, 59, 0.08);
    border: 1px solid rgba(43, 74, 59, 0.2);
    color: #2B4A3B;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-archive-clear:hover {
    background: #2B4A3B;
    color: white;
}

.document-card {
    position: relative;
    background: #f5f5f5;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: none;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    cursor: pointer;
    height: 280px;
    overflow: hidden; /* Ensure zoomed image stays in bounds */
}

.document-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.document-thumbnail {
    width: 100%;
    height: 100%;
    background: #f4f4f4;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.document-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.document-card:hover .document-thumbnail img {
    transform: scale(1.08);
}

.document-text-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(28, 44, 38, 0.95) 0%, transparent 60%);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
    transition: background 0.4s ease, padding 0.4s ease;
    box-sizing: border-box;
}

.document-card:hover .document-text-content {
    background: rgba(28, 44, 38, 0.95);
}

.document-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
    margin: 0;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: transform 0.4s ease;
    transform: translateY(0);
}

.document-card:hover .document-title {
    transform: translateY(-4px);
}

.document-summary {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 10;
    -webkit-box-orient: vertical;
    overflow: hidden;
    
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.document-card:hover .document-summary {
    max-height: 220px;
    opacity: 1;
    margin-top: 0.5rem;
}

/* Modal Reader */
.reader-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.reader-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.reader-modal {
    background: #fff;
    width: 96%;
    max-width: 1550px;
    height: 92vh;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.reader-modal-overlay.active .reader-modal {
    transform: scale(1);
}

.reader-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 4.5rem 1.25rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: #fafafa;
    position: relative;
}

.reader-header-text-group {
    flex: 1;
    min-width: 0;
    padding-right: 1.5rem;
}

.reader-modal-title {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.35rem 0;
    line-height: 1.3;
}

.reader-summary-container {
    margin-top: 0.25rem;
}

.reader-doc-summary {
    font-size: 0.92rem;
    color: #475569;
    line-height: 1.5;
    margin: 0;
    transition: all 0.25s ease;
    word-break: break-word;
}

.reader-doc-summary.clamped {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis;
}

.reader-summary-toggle {
    background: none;
    border: none;
    color: #B8972F;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.3rem 0;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.2s ease;
}

.reader-summary-toggle:hover {
    color: #9c7f24;
    text-decoration: underline;
}

.reader-summary-toggle svg {
    transition: transform 0.2s ease;
}

.reader-modal-close {
    position: absolute;
    top: 1.1rem;
    right: 1.25rem;
    z-index: 100;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.reader-modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: scale(1.05);
}

.reader-modal-close:focus {
    outline: none;
    border-color: var(--primary-gold, #B8972F);
    box-shadow: 0 0 0 3px rgba(184, 151, 47, 0.2);
}

.reader-split-view {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.reader-image-pane {
    flex: 0 0 32%;
    max-width: 440px;
    min-width: 280px;
    background: #f4f4f4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    gap: 0.75rem;
    box-sizing: border-box;
}

.reader-image-pane img {
    max-width: 100%;
    max-height: 100%;
    min-height: 0; /* Allows image to shrink inside flex column */
    object-fit: contain;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    flex: 1; /* Takes up remaining space */
}

.reader-text-pane {
    flex: 1;
    min-width: 0;
    max-width: none;
    background: #fff;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    height: 100%;
    overflow: hidden;
}

.reader-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: #fafafa;
}

.reader-tab {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: #777;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.reader-tab:hover {
    color: var(--accent-color);
}

.reader-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: #fff;
}

.reader-tab-content {
    display: none;
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #333;
}

.reader-tab-content.active {
    display: block;
}

.reader-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: #fafafa;
}

.reader-tag {
    background: var(--accent-color);
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
}

@media (max-width: 900px) {
    .reader-split-view {
        flex-direction: column;
    }
    .reader-image-pane {
        flex: none;
        height: 40vh;
    }
    .reader-text-pane {
        flex: 1;
        max-width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}



.reader-tags-scrollable {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    overflow-y: auto;
    max-height: 100%;
}

/* Page Selector Strip */
.reader-page-strip {
    position: relative;
    display: flex;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.4);
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    backdrop-filter: blur(5px);
    z-index: 10;
    max-width: 100%;
    overflow-x: auto;
    /* Hide scrollbar for a cleaner look */
    -ms-overflow-style: none;
    scrollbar-width: none;
    flex-shrink: 0;
}
.reader-page-strip::-webkit-scrollbar {
    display: none;
}

.reader-page-item {
    background: transparent;
    color: #444;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.reader-page-item:hover {
    color: var(--primary-color);
    transform: scale(1.3);
}

.reader-page-item.active {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* Page Strip Tooltip */
.reader-page-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(28, 44, 38, 0.95);
    color: #fff;
    padding: 1rem;
    border-radius: 12px;
    width: 250px;
    font-size: 0.85rem;
    line-height: 1.5;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.reader-page-item:hover .reader-page-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.reader-page-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(28, 44, 38, 0.95) transparent transparent transparent;
}

.btn-archive {
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    border: none;
    flex: 1;
    text-align: center;
}

.btn-archive-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-archive-primary:hover {
    background: #111;
}

.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: #888;
    grid-column: 1 / -1;
}

/* Responsive */
@media (max-width: 768px) {
    .public-archive-container {
        flex-direction: column;
    }
}

/* Search Results UI - Modern L'Artzon Premium Design */
.search-section {
    margin-bottom: 2rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.search-section:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
}

.search-section-header {
    padding: 1.2rem 1.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background-color 0.3s ease;
    user-select: none;
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.search-section-header:hover {
    background-color: rgba(255,255,255,0.4);
}

.search-section-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color);
    letter-spacing: -0.01em;
}

.search-section-count {
    color: #888;
    font-weight: 400;
    margin-left: 0.6rem;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.04);
    padding: 2px 8px;
    border-radius: 20px;
}

.search-section-icon {
    transition: transform 0.3s ease;
}

.search-result-item {
    padding: 1.5rem 1.8rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    display: flex;
    gap: 1.5rem;
    transition: all 0.25s ease;
    cursor: pointer;
    background: transparent;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: rgba(255,255,255,0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.search-result-thumb {
    width: 60px;
    height: 84px;
    background-color: #f5f5f5;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.search-result-item:hover .search-result-thumb {
    transform: scale(1.05);
}

.search-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.search-result-title {
    margin: 0 0 0.4rem 0;
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--accent-color);
    line-height: 1.3;
    transition: color 0.2s ease;
}

.search-result-title:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.search-result-original-name {
    color: #999;
    font-size: 0.9rem;
    font-weight: 400;
    margin-left: 0.6rem;
    font-style: italic;
}

.search-result-pages {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

.search-page-badge {
    font-size: 0.75rem;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.search-page-badge:hover {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.search-result-snippet {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-style: italic;
    opacity: 0.9;
}

/* ==========================================================================
   Extraia Advanced Graph & Wordcloud Styles
   ========================================================================== */

#tab-graph.active,
#tab-wordcloud.active {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem 1rem;
    flex: 1;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
    overflow: hidden;
}

#reader-word-cloud {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafaf9;
    border-radius: 12px;
    border: 1px solid #e7e5e4;
    overflow: hidden;
    position: relative;
}

#reader-graph {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    gap: 0.5rem;
}

.graph-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: #f8fafc;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.graph-chips-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.graph-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    color: #475569;
    line-height: 1.2;
}

.graph-category-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.graph-category-chip.active-per {
    background: #ffe4e6;
    border-color: #e11d48;
    color: #9f1239;
}

.graph-category-chip.active-loc {
    background: #d1fae5;
    border-color: #059669;
    color: #065f46;
}

.graph-category-chip.active-date {
    background: #ede9fe;
    border-color: #7c3aed;
    color: #5b21b6;
}

.graph-category-chip.active-other {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0369a1;
}

.graph-category-chip.active-related {
    background: #eff6ff;
    border-color: #2563eb;
    color: #1d4ed8;
}

.chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.chip-arrow {
    font-size: 0.62rem;
    opacity: 0.7;
    margin-left: 2px;
}

.graph-toggle-all-btn {
    font-size: 0.76rem;
    font-weight: 600;
    color: #475569;
    background: #fff;
    border: 1px solid #cbd5e1;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.graph-toggle-all-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.graph-canvas-container {
    position: relative;
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    background: #fafaf9;
    border-radius: 12px;
    border: 1px solid #e7e5e4;
    overflow: hidden;
}

#reader-graph-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.graph-zoom-controls {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 3px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.08);
    z-index: 10;
}

.graph-zoom-controls button {
    width: 28px;
    height: 28px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: bold;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
}

.graph-zoom-controls button:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.graph-inspector-card {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 290px;
    max-height: calc(100% - 24px);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    z-index: 30;
    overflow-y: auto;
    font-size: 0.85rem;
    animation: fadeIn 0.2s ease;
}

.graph-inspector-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem;
    border-radius: 8px;
    background: #2563eb;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    margin-top: auto;
    box-shadow: 0 2px 4px rgba(37,99,235,0.25);
}

.graph-inspector-open-btn:hover {
    background: #1d4ed8;
}

.graph-legend {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(6px);
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    font-size: 0.72rem;
    color: #475569;
    pointer-events: none;
    z-index: 10;
}

