/* ==========================================================================
   VIRYBER PORTFOLIO - ARTICLES & REPORTS STYLESHEET
   Aesthetics: Obsidian Dark, Glowing Accents, Clean Document Reader
   Features: PDF Viewer Modal, Interactive Likes, Comments Thread, Admin Uploader
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. USER SESSION BADGE IN NAVBAR
   -------------------------------------------------------------------------- */
.user-session-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
    color: #cbd5e1;
}

.user-avatar-tiny {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   2. ARTICLES HERO BANNER & SEARCH
   -------------------------------------------------------------------------- */
.articles-hero-banner {
    padding-top: calc(var(--header-height) + 3.5rem);
    padding-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.articles-hero-text {
    max-width: 760px;
    margin: 0 auto 2.5rem auto;
}

.admin-upload-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.docs-filter-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 1.25rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    padding: 0.65rem 1.25rem;
    transition: all var(--transition-fast);
}

.search-input-wrapper:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(255, 255, 255, 0.07);
}

.search-input-wrapper svg {
    color: var(--text-muted);
}

.doc-search-input {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
}

.topic-pills {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.topic-pill {
    padding: 0.45rem 1.15rem;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.topic-pill:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.topic-pill.active {
    background: var(--accent-gradient);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
    border-color: transparent;
}

/* --------------------------------------------------------------------------
   3. DOCUMENTS GRID & CARDS
   -------------------------------------------------------------------------- */
.documents-grid-section {
    padding-top: 1rem;
    padding-bottom: 6rem;
}

.docs-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2rem;
}

.document-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: transform var(--transition-smooth), border-color var(--transition-fast), box-shadow var(--transition-smooth);
}

.document-card:hover {
    transform: translateY(-8px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(99, 102, 241, 0.15);
}

/* Document Cover / Header */
.doc-card-cover {
    height: 180px;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    position: relative;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.doc-card-cover-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
    transition: transform 0.6s ease;
}

.document-card:hover .doc-card-cover-bg {
    transform: scale(1.05);
}

.doc-cover-badges {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.doc-badge-pdf {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-pill);
    font-size: 0.725rem;
    font-weight: 700;
    color: #fca5a5;
    letter-spacing: 0.04em;
}

.doc-read-time {
    font-size: 0.75rem;
    color: #94a3b8;
    background: rgba(7, 9, 14, 0.75);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    backdrop-filter: blur(4px);
}

.doc-cover-art-accent {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-end;
}

.doc-category-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Document Body Info */
.doc-card-body {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.doc-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
    line-height: 1.35;
}

.doc-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-tags-list {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* Document Interactive Footer */
.doc-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    gap: 0.5rem;
}

.doc-metrics-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.card-metric-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.825rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.card-metric-btn:hover {
    color: #38bdf8;
    transform: scale(1.05);
}

.card-metric-btn.liked {
    color: #ef4444;
}

.card-metric-btn.liked svg {
    fill: #ef4444;
    stroke: #ef4444;
}

.doc-read-btn {
    padding: 0.45rem 1rem;
    font-size: 0.85rem;
}

/* Admin Card Actions on hover */
.doc-admin-bar {
    position: absolute;
    top: 12px;
    right: 12px;
    display: none;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

body.is-admin-logged-in .doc-admin-bar {
    display: flex;
}

/* --------------------------------------------------------------------------
   4. INTERACTIVE DOCUMENT READER MODAL
   -------------------------------------------------------------------------- */
.reader-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.reader-modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.reader-modal {
    width: 95%;
    max-width: 1300px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    background: rgba(10, 14, 22, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), 0 0 50px rgba(99, 102, 241, 0.25);
    overflow: hidden;
    animation: readerScale 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes readerScale {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Reader Top Bar */
.reader-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.75rem;
    background: rgba(13, 18, 28, 0.95);
    border-bottom: 1px solid var(--border-subtle);
    gap: 1.5rem;
}

.reader-doc-info {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
    overflow: hidden;
}

.reader-pdf-badge {
    padding: 0.25rem 0.65rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-pill);
    font-size: 0.725rem;
    font-weight: 700;
    color: #fca5a5;
    white-space: nowrap;
}

.reader-doc-title {
    font-size: 1.15rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reader-controls {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.reader-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.95rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.reader-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
    color: #38bdf8;
}

.reader-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.reader-close-btn:hover {
    background: #ef4444;
}

/* Reader Split Content */
.reader-content-split {
    display: grid;
    grid-template-columns: 1.45fr 0.85fr;
    flex: 1;
    overflow: hidden;
}

/* Left: Viewer Pane */
.reader-viewer-pane {
    background: #07090e;
    border-right: 1px solid var(--border-subtle);
    position: relative;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.document-preview-container {
    flex: 1;
    width: 100%;
    height: 100%;
    position: relative;
}

.pdf-iframe-viewer {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
}

.styled-reader-view {
    padding: 3.5rem 3rem;
    max-width: 780px;
    margin: 0 auto;
    color: #e2e8f0;
    line-height: 1.8;
}

.styled-reader-view h1 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    color: #ffffff;
}

.styled-reader-view .doc-meta-banner {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.styled-reader-view h2 {
    font-size: 1.4rem;
    margin: 2rem 0 0.85rem 0;
    color: #38bdf8;
}

.styled-reader-view p {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

.styled-reader-view blockquote {
    border-left: 3px solid #6366f1;
    padding-left: 1.25rem;
    margin: 1.5rem 0;
    color: #94a3b8;
    font-style: italic;
}

/* Right: Sidebar Interaction Pane */
.reader-sidebar-pane {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: rgba(13, 18, 28, 0.7);
}

.reader-meta-box {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.reader-author-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.author-avatar-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #6366f1;
}

.author-name {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
}

.author-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.reader-doc-summary {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 1.25rem;
}

.reader-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.interaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.interaction-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.interaction-btn.liked {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

.interaction-btn.liked svg {
    fill: #ef4444;
}

.interaction-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.825rem;
    color: var(--text-muted);
}

/* Comments Section */
.reader-comments-section {
    padding: 1.5rem 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.comments-heading {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.comment-input-box {
    margin-bottom: 1.75rem;
}

.comment-textarea {
    width: 100%;
    margin-bottom: 0.65rem;
}

.comment-submit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.posting-as-label {
    font-size: 0.775rem;
    color: var(--text-muted);
}

.comment-login-prompt {
    padding: 1rem 1.25rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-md);
    text-align: center;
}

.comment-login-prompt p {
    font-size: 0.85rem;
    color: #c7d2fe;
    margin-bottom: 0.85rem;
}

/* Comments Feed */
.comments-feed-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.comment-item-card {
    padding: 1rem 1.15rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    animation: fadeIn 0.3s ease;
}

.comment-author-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comment-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-avatar-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3b82f6;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comment-author-name {
    font-size: 0.825rem;
    font-weight: 700;
    color: #f1f5f9;
}

.comment-time {
    font-size: 0.725rem;
    color: var(--text-muted);
}

.comment-body-text {
    font-size: 0.85rem;
    color: #cbd5e1;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   5. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .reader-content-split {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .reader-viewer-pane {
        height: 60vh;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }
}

@media (max-width: 768px) {
    .documents-grid {
        grid-template-columns: 1fr;
    }

    .reader-modal {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
}
