/* ==========================================================================
   File: Resource/document/document.css
   KHALA STUDIO — DOCUMENT RESOURCE MODULE
   One Vibe: Apple + Google (Clean, Simple, Fast, No Stress)
   - 4 File Types: Word, Excel, PowerPoint, PDF
   - Compact Layout: Clear Title + Format Badge
   - Sticky Search Shell with Horizontal Filter Pills
   - 2-Column Responsive Grid with Direct Telegram Links
   ========================================================================== */

/* --------------------------------------------------------------------------
   Top bar — Back button + Topic Title (50px from top)
   -------------------------------------------------------------------------- */
.doc-top-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 50px 0 20px;
}

/* --------------------------------------------------------------------------
   Sticky Controls (Search Bar + Filter Pills)
   -------------------------------------------------------------------------- */
.doc-search-sticky-bar {
    position: sticky;
    top: 0 !important;
    z-index: 1000;
    background-color: var(--hub-bg) !important;
    padding: 6px 0 14px 0;
    margin-bottom: 12px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
    opacity: 1;
    visibility: visible;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.3s ease, opacity 0.25s ease, visibility 0.25s ease;
}

/* Hide on Scroll Down */
.doc-search-sticky-bar.nav-hidden {
    transform: translateY(-100%) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Subtle Shadow when Sticky */
.doc-search-sticky-bar.is-stuck {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.doc-search-shell {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 0 20px;
    background: var(--hub-soft);
    border-radius: 32px;
    transition: background-color .18s ease;
}

.doc-search-shell:focus-within {
    background: var(--hub-soft-hover);
}

.doc-search-shell .material-symbols-outlined {
    font-size: 22px;
    color: var(--hub-text);
    flex: 0 0 auto;
}

.doc-search-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--hub-title);
    font: inherit;
    font-size: 1.125rem;
}

.doc-search-input::placeholder {
    color: #a9a9b3;
    opacity: 1;
}

.doc-search-submit {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--hub-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease;
}

.doc-search-submit:hover {
    color: var(--hub-accent);
    background: var(--hub-soft-hover);
}

.doc-search-submit .material-symbols-outlined {
    font-size: 24px;
}

/* --------------------------------------------------------------------------
   Filter Pills Bar (All, Word, Excel, PowerPoint, PDF)
   -------------------------------------------------------------------------- */
.doc-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.doc-filter-row::-webkit-scrollbar {
    display: none;
}

.doc-filter-pill {
    height: 38px;
    padding: 0 20px;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: var(--hub-text);
    font-size: 1rem !important;
    font-weight: 500 !important;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .18s ease, color .18s ease;
    flex-shrink: 0;
}

.doc-filter-pill:hover {
    background: var(--hub-soft);
    color: var(--hub-title);
}

.doc-filter-pill.is-active {
    background: var(--hub-soft) !important;
    color: var(--hub-title) !important;
}

/* --------------------------------------------------------------------------
   2-Column Compact Document Cards Grid
   -------------------------------------------------------------------------- */
.doc-grid-viewport {
    position: relative;
    width: 100%;
    min-height: 400px;
}

.doc-loading-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--hub-bg);
    z-index: 10;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.28s ease, visibility 0.28s ease;
    pointer-events: none;
}

.doc-loading-mask.hidden {
    opacity: 0;
    visibility: hidden;
}

.doc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--hub-gap);
    width: 100%;
    opacity: 0;
    animation: pureFadeIn 0.28s ease forwards;
}

.doc-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--hub-soft);
    border-radius: var(--hub-radius);
    border: 0;
    cursor: pointer;
    transition: background-color .18s ease;
    min-height: 84px;
}

.doc-card:hover {
    background: var(--hub-soft-hover);
}

.doc-card:focus-visible {
    outline: 2px solid var(--hub-accent);
    outline-offset: 3px;
}

/* Format Icon Wrap (Word, Excel, PowerPoint, PDF) */
.doc-icon-wrap {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 12px;
    background: var(--hub-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-icon-wrap .material-symbols-outlined {
    font-size: 24px;
}

.doc-icon-wrap.word { color: #185ABD; }
.doc-icon-wrap.excel { color: #107C41; }
.doc-icon-wrap.powerpoint { color: #D83B01; }
.doc-icon-wrap.pdf { color: #EA4335; }

/* Document Information */
.doc-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.doc-name {
    font-size: 1.0625rem !important;
    font-weight: 500 !important;
    color: var(--hub-title);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-format-tag {
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    color: var(--hub-text);
    line-height: 1.2;
}

/* Glass Download Button */
.doc-download-btn {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border: 0;
    border-radius: 50% !important;
    background: rgba(0, 0, 0, 0.055);
    color: var(--hub-title);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity .18s ease;
}

.doc-download-btn span {
    font-size: 20px !important;
}

.doc-empty {
    grid-column: 1 / -1;
    width: 100%;
    text-align: center;
    font-size: 1.125rem !important;
    color: var(--hub-text);
    padding: 60px 0;
    line-height: 1.5;
    background: var(--hub-soft);
    border-radius: var(--hub-radius);
}

@keyframes pureFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
    .doc-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .doc-top-bar {
        margin-top: 48px;
    }

    .doc-search-sticky-bar {
        padding: 4px 0 10px 0;
        gap: 10px;
    }

    .doc-search-shell {
        height: 48px;
        padding: 0 6px 0 16px;
    }

    .doc-search-submit {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
    }

    .doc-filter-pill {
        height: 34px;
        padding: 0 16px;
    }

    .doc-card {
        padding: 12px 14px;
        min-height: 74px;
    }

    .doc-icon-wrap {
        width: 40px;
        height: 40px;
        flex: 0 0 40px;
    }
}