/* =========================================================
   Library cards — unified button styles
   ========================================================= */

/* ── Card ───────────────────────────────────────────────── */
.library-section .lib-card {
    text-align: center;
    overflow: hidden;
    padding: 0 !important;
}

.card-label a {
    top: 0px !important;
    left: 0px !important;
}

/* ── Thumbnail ──────────────────────────────────────────── */
.library-section .card-img-cont {
    height: 220px;
    overflow: hidden;
}

.library-section .card-img-cont img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Address block ──────────────────────────────────────── */
.library-section .address-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    max-width: 100%;
}

.library-section .address-text {
    font-weight: 400 !important;
    font-size: 17px;
    color: #121212;
    white-space: nowrap;
    overflow: hidden;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    margin: 0;
}

.library-section .address-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    flex: 0 0 auto;
    color: #333;
    font-size: 14px;
    margin: 0 !important;
}

.library-section .address-toggle i {
    transition: transform .2s ease;
}

.library-section .address-wrap.expanded .address-text {
    white-space: normal;
    word-break: break-word;
}

.library-section .address-wrap.expanded .address-toggle i {
    transform: rotate(180deg);
}

/* ── Card footer ────────────────────────────────────────── */
.library-section .card-footer {
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, .08);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
    min-height: 54px;
}

/* ═══════════════════════════════════════════════════════
   UNIFIED BUTTON RULE — handles <button>, <a>, and <button><a>
   ═══════════════════════════════════════════════════════ */

/* Base: all buttons in footer */
.library-section .card-footer .btn,
.library-section .card-footer a.btn,
.library-section .card-footer button.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 10px !important;
    margin: 0 !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    border: none !important;
    text-decoration: none !important;
    color: #fff !important;
    gap: 4px !important;
}

/* Anchor inside button (library1.aspx.cs "ملف كتابة") */
.library-section .card-footer .btn>a,
.library-section .card-footer button.btn>a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    border: none !important;
    background: transparent !important;
    color: inherit !important;
    text-decoration: none !important;
    gap: 4px !important;
}

/* Icon — same everywhere */
.library-section .card-footer .btn i,
.library-section .card-footer .btn>a i,
.library-section .card-footer a.btn i {
    font-size: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

/* Count badge — hidden by default */
.library-section .card-footer .btn .btn-count,
.library-section .card-footer .btn>a .btn-count,
.library-section .card-footer a.btn .btn-count {
    font-size: 13px !important;
    font-weight: 700 !important;
    min-width: 14px !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    display: none !important;
}

/* Show counts when parent has .show-counts */
.library-section .card-footer.show-counts .btn .btn-count,
.library-section .card-footer.show-counts .btn>a .btn-count,
.library-section .card-footer.show-counts a.btn .btn-count {
    display: inline !important;
}

/* ── Icon-only buttons (eye, play) ─────────────────────── */
.library-section .card-footer .btn-eye {
    width: 42px !important;
    padding: 0 !important;
    gap: 0 !important;
}

.library-section .card-footer .btn-eye i {
    font-size: 20px !important;
}
/* ── File-type filter bar ── */
.filetype-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: flex-end;
}

.ft-btn {
    background-color: #d4d4d4;
    color: #333;
    border: none;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    outline: none;
    /* Reset any inherited Bootstrap styles */
    box-shadow: none;
    font-family: inherit;
    line-height: 1.5;
}

    .ft-btn:hover {
        background-color: #bdbdbd;
        color: #111;
    }

    .ft-btn.active {
        background-color: #e8622a;
        color: #fff;
        box-shadow: 0 3px 8px rgba(232, 98, 42, 0.40);
    }