/* ============================================================
   IEP File Share — Public Library Styles
   ============================================================ */
:root {
    --fs-navy:    #1a1a2e;
    --fs-gold:    #c9a84c;
    --fs-light:   #f9f7f2;
    --fs-border:  #e0ddd5;
    --fs-text:    #2c2c2c;
    --fs-muted:   #777;
    --fs-green:   #2e7d32;
    --fs-blue:    #1565c0;
    --fs-radius:  8px;
    --fs-shadow:  0 2px 8px rgba(0,0,0,.08);
}

/* ── Library wrapper ─────────────────────────────────────── */
.iep-fs-library-wrap { font-family: inherit; }

/* ── Filter bar ──────────────────────────────────────────── */
.iep-fs-filter-bar {
    background: var(--fs-navy);
    border-radius: var(--fs-radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}
.iep-fs-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}
.iep-fs-search-icon {
    position: absolute;
    left: 14px;
    font-size: 16px;
    pointer-events: none;
}
.iep-fs-search-input {
    width: 100%;
    padding: 12px 40px 12px 42px;
    border: 2px solid transparent;
    border-radius: 6px;
    font-size: 15px;
    background: rgba(255,255,255,.1);
    color: #fff;
    box-sizing: border-box;
    transition: border-color .2s, background .2s;
}
.iep-fs-search-input::placeholder { color: rgba(255,255,255,.5); }
.iep-fs-search-input:focus { outline: none; border-color: var(--fs-gold); background: rgba(255,255,255,.15); }
.iep-fs-search-clear {
    position: absolute; right: 12px;
    background: none; border: none; color: rgba(255,255,255,.6);
    cursor: pointer; font-size: 16px; padding: 4px;
}
.iep-fs-search-clear:hover { color: #fff; }

.iep-fs-filter-row {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.iep-fs-filter-group { display: flex; flex-direction: column; gap: 5px; }
.iep-fs-filter-group label { color: rgba(255,255,255,.7); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.iep-fs-filter-group select {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.1);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    min-width: 140px;
}
.iep-fs-filter-group select option { background: var(--fs-navy); color: #fff; }
.iep-fs-results-count {
    margin-left: auto;
    align-self: flex-end;
}
.iep-fs-results-count span {
    background: var(--fs-gold);
    color: var(--fs-navy);
    font-weight: 700;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 20px;
}

/* ── Active filters ──────────────────────────────────────── */
.iep-fs-active-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.iep-fs-active-filters::before { content: 'Filters:'; font-size: 12px; color: var(--fs-muted); font-weight: 600; }
.iep-fs-filter-chip {
    background: var(--fs-navy); color: #fff;
    border: none; border-radius: 20px;
    padding: 4px 12px; font-size: 12px;
    cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.iep-fs-filter-chip:hover { opacity: .85; }
.iep-fs-filter-chip-x { color: rgba(255,255,255,.6); }

/* ── File grid ───────────────────────────────────────────── */
.iep-fs-grid { display: flex; flex-direction: column; gap: 12px; }

/* ── File card ───────────────────────────────────────────── */
.iep-fs-card-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--fs-border);
    border-radius: var(--fs-radius);
    padding: 18px 20px;
    box-shadow: var(--fs-shadow);
    transition: box-shadow .2s, transform .15s;
}
.iep-fs-card-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-1px); }

.iep-fs-card-icon { font-size: 36px; flex-shrink: 0; margin-top: 2px; }

.iep-fs-card-body { flex: 1; min-width: 0; }
.iep-fs-card-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.iep-fs-card-title { margin: 0; font-size: 17px; color: var(--fs-navy); font-weight: 700; line-height: 1.3; }
.iep-fs-card-ext {
    background: var(--fs-navy); color: var(--fs-gold);
    font-size: 10px; font-weight: 800; letter-spacing: .5px;
    padding: 2px 7px; border-radius: 3px; flex-shrink: 0;
    text-transform: uppercase;
}
.iep-fs-card-desc { margin: 0 0 8px; color: #555; font-size: 14px; line-height: 1.5; }
.iep-fs-card-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--fs-muted); }
.iep-fs-card-meta span { display: flex; align-items: center; gap: 4px; }

.iep-fs-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.iep-fs-tag-pill {
    background: var(--fs-light); color: var(--fs-navy);
    border: 1px solid var(--fs-border); border-radius: 20px;
    padding: 3px 10px; font-size: 11px; cursor: pointer;
    transition: background .2s;
}
.iep-fs-tag-pill:hover { background: var(--fs-gold); border-color: var(--fs-gold); color: var(--fs-navy); }

.iep-fs-card-action { flex-shrink: 0; margin-left: auto; padding-left: 12px; }
.iep-fs-dl-btn {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: var(--fs-navy); color: #fff;
    border-radius: var(--fs-radius); padding: 14px 20px;
    text-decoration: none; font-size: 13px; font-weight: 600;
    transition: background .2s, transform .1s;
    min-width: 80px; text-align: center;
}
.iep-fs-dl-btn:hover { background: var(--fs-gold); color: var(--fs-navy); transform: translateY(-1px); }
.iep-fs-dl-icon { font-size: 20px; }

/* ── Empty state ─────────────────────────────────────────── */
.iep-fs-empty { text-align: center; padding: 60px 20px; }
.iep-fs-empty-icon { font-size: 56px; margin-bottom: 16px; }
.iep-fs-empty p { color: var(--fs-muted); font-size: 16px; }

/* ── Loading spinner ─────────────────────────────────────── */
.iep-fs-loading {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 40px; color: var(--fs-muted);
}
.iep-fs-spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--fs-border);
    border-top-color: var(--fs-navy);
    border-radius: 50%;
    animation: iep-fs-spin .8s linear infinite;
}
@keyframes iep-fs-spin { to { transform: rotate(360deg); } }

/* ── Pagination ──────────────────────────────────────────── */
.iep-fs-pagination { margin-top: 28px; }
.iep-fs-pages { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.iep-fs-page-btn {
    background: #fff; color: var(--fs-navy);
    border: 1px solid var(--fs-border); border-radius: 5px;
    padding: 8px 14px; cursor: pointer; font-size: 14px;
    transition: background .2s, color .2s;
}
.iep-fs-page-btn:hover    { background: var(--fs-navy); color: #fff; }
.iep-fs-page-active       { background: var(--fs-navy) !important; color: #fff !important; font-weight: 700; }
.iep-fs-page-ellipsis     { padding: 8px 6px; color: var(--fs-muted); }
.iep-fs-page-info         { text-align: center; font-size: 13px; color: var(--fs-muted); margin-top: 10px; }

/* ── Shared button ───────────────────────────────────────── */
.iep-fs-btn { display: inline-block; padding: 10px 20px; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: opacity .2s; text-decoration: none; text-align: center; }
.iep-fs-btn:disabled { opacity: .5; cursor: not-allowed; }
.iep-fs-btn-primary  { background: var(--fs-navy); color: #fff; }
.iep-fs-btn-primary:hover  { opacity: .88; }
.iep-fs-btn-ghost    { background: transparent; color: var(--fs-navy); border: 2px solid var(--fs-navy); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .iep-fs-filter-bar { padding: 16px; }
    .iep-fs-filter-row { gap: 10px; }
    .iep-fs-filter-group select { min-width: 110px; }
    .iep-fs-card-item { flex-wrap: wrap; }
    .iep-fs-card-action { width: 100%; padding-left: 0; margin-top: 10px; }
    .iep-fs-dl-btn { flex-direction: row; justify-content: center; width: 100%; box-sizing: border-box; }
}

/* ── Upvote button ───────────────────────────────────────── */
.iep-fs-upvote-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: var(--fs-light);
    border: 2px solid var(--fs-border);
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--fs-muted);
    transition: all .2s;
    min-width: 52px;
    margin-bottom: 8px;
    width: 100%;
}
.iep-fs-upvote-btn:hover {
    border-color: var(--fs-gold);
    color: var(--fs-navy);
    transform: translateY(-1px);
}
.iep-fs-upvote-btn.iep-fs-voted {
    background: var(--fs-navy);
    border-color: var(--fs-navy);
    color: var(--fs-gold);
}
.iep-fs-upvote-btn.iep-fs-voted .iep-fs-upvote-arrow { color: var(--fs-gold); }
.iep-fs-upvote-arrow { font-size: 16px; line-height: 1; }
.iep-fs-upvote-btn.iep-fs-animating { animation: iep-fs-bounce .3s ease; }
@keyframes iep-fs-bounce {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.25) translateY(-3px); }
    100% { transform: scale(1); }
}

/* ── Trending badge ──────────────────────────────────────── */
.iep-fs-trending-badge {
    background: linear-gradient(135deg, #ff6b35, #f7c948);
    color: #1a1a2e;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: .3px;
    flex-shrink: 0;
    animation: iep-fs-pulse 2.5s ease-in-out infinite;
}
@keyframes iep-fs-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,53,.4); }
    50%       { box-shadow: 0 0 0 6px rgba(255,107,53,0); }
}

/* ── Showcase widget ─────────────────────────────────────── */
.iep-fs-showcase {
    background: var(--fs-navy);
    border-radius: var(--fs-radius);
    overflow: hidden;
    margin-bottom: 28px;
}
.iep-fs-showcase-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.iep-fs-showcase-tab {
    flex: 1;
    background: none;
    border: none;
    color: rgba(255,255,255,.55);
    padding: 14px 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: color .2s, border-bottom .2s;
    border-bottom: 3px solid transparent;
    letter-spacing: .2px;
}
.iep-fs-showcase-tab:hover { color: rgba(255,255,255,.85); }
.iep-fs-showcase-tab.active {
    color: var(--fs-gold);
    border-bottom-color: var(--fs-gold);
}
.iep-fs-showcase-single-header {
    color: var(--fs-gold);
    font-weight: 800;
    font-size: 15px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.iep-fs-showcase-body {
    padding: 12px;
    position: relative;
    min-height: 80px;
}
.iep-fs-showcase-loading {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--fs-navy);
    z-index: 2;
}
.iep-fs-showcase-list { display: flex; flex-direction: column; gap: 8px; }
.iep-fs-showcase-empty { color: rgba(255,255,255,.4); text-align: center; padding: 30px; font-size: 14px; }

/* Showcase card */
.iep-fs-showcase-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 6px;
    padding: 12px 14px;
    transition: background .2s;
}
.iep-fs-showcase-card:hover { background: rgba(255,255,255,.1); }

.iep-fs-showcase-rank {
    font-size: 22px;
    min-width: 36px;
    text-align: center;
    flex-shrink: 0;
}
.iep-fs-rank-num {
    display: inline-block;
    background: rgba(255,255,255,.12);
    color: rgba(255,255,255,.5);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 800;
    padding: 3px 6px;
    min-width: 28px;
    text-align: center;
}
.iep-fs-showcase-icon { font-size: 26px; flex-shrink: 0; }

.iep-fs-showcase-info { flex: 1; min-width: 0; }
.iep-fs-showcase-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.iep-fs-showcase-title { color: #fff; font-weight: 700; font-size: 14px; }
.iep-fs-showcase-ext {
    background: rgba(255,255,255,.12);
    color: rgba(255,255,255,.6);
    font-size: 10px; font-weight: 700;
    padding: 1px 6px; border-radius: 3px;
    text-transform: uppercase;
}
.iep-fs-showcase-cat { color: rgba(255,255,255,.45); font-size: 12px; display: block; margin-bottom: 5px; }
.iep-fs-showcase-stats {
    display: flex; gap: 12px;
    font-size: 12px; color: rgba(255,255,255,.5);
    flex-wrap: wrap;
}
.iep-fs-score-pill {
    background: rgba(201,168,76,.15);
    color: var(--fs-gold);
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 11px;
}

.iep-fs-showcase-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.iep-fs-showcase-actions .iep-fs-upvote-btn {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.15);
    color: rgba(255,255,255,.7);
    min-width: 48px;
    margin-bottom: 0;
}
.iep-fs-showcase-actions .iep-fs-upvote-btn:hover {
    border-color: var(--fs-gold);
    color: var(--fs-gold);
}
.iep-fs-showcase-actions .iep-fs-upvote-btn.iep-fs-voted {
    background: var(--fs-gold);
    border-color: var(--fs-gold);
    color: var(--fs-navy);
}
.iep-fs-showcase-dl {
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    border-radius: 5px;
    width: 36px; height: 36px;
    font-size: 16px;
    text-decoration: none;
    transition: background .2s;
}
.iep-fs-showcase-dl:hover { background: var(--fs-gold); color: var(--fs-navy); }

/* List style variant */
.iep-fs-showcase-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.iep-fs-showcase-list-item:last-child { border-bottom: none; }
.iep-fs-list-rank { font-size: 18px; min-width: 32px; text-align: center; flex-shrink: 0; }
.iep-fs-list-icon { font-size: 20px; flex-shrink: 0; }
.iep-fs-list-title { flex: 1; color: #fff; font-size: 14px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iep-fs-list-stats { display: flex; gap: 10px; font-size: 12px; color: rgba(255,255,255,.45); flex-shrink: 0; }
.iep-fs-showcase-list-item .iep-fs-upvote-btn {
    background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15);
    color: rgba(255,255,255,.6); flex-direction: row; gap: 5px;
    padding: 5px 10px; min-width: unset; margin-bottom: 0;
}

/* View count in card meta */
.iep-fs-card-views { display: flex; align-items: center; gap: 4px; }
