/* kfbeta16 — filter (from page-anime-filter.php) */
:root {
    --af-bg:      #0d0d11;
    --af-surface: #141418;
    --af-surface2:#1a1a22;
    --af-border:  #252530;
    --af-border2: #2e2e3c;
    --af-accent:  #e8673a;
    --af-accent2: #4fa8f0;
    --af-text:    #eaeaf2;
    --af-muted:   #6a6a82;
    --af-r:       8px;
    --af-r-sm:    6px;
    --af-font:    -apple-system,'Hiragino Sans','Noto Sans JP',sans-serif;
}

/* ── Go Page ── */
.af-go-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
}
.af-go-input {
    width: 50px;
    height: 36px;
    background: var(--af-surface);
    border: 1px solid var(--af-border2);
    color: var(--af-text);
    border-radius: var(--af-r-sm);
    text-align: center;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.12s;
}
.af-go-input:focus { 
    border-color: var(--af-accent); 
}
/* Ẩn mũi tên tăng/giảm mặc định của ô input type="number" */
.af-go-input::-webkit-outer-spin-button,
.af-go-input::-webkit-inner-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
.af-go-input[type=number] { 
    -moz-appearance: textfield; 
}

#af-wrap, #af-wrap * {
    box-sizing: border-box;
    /* margin: 0; */
    /* padding: 0; */
}

#af-wrap {
    background: #202020;
    color: var(--af-text);
    font-family: var(--af-font);
    min-height: 100vh;
    padding: 0 0 80px;
    max-width: 1360px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════
   FILTER PANEL
   ═══════════════════════════════════════ */
#af-filters {
    background: var(--af-surface);
    border-bottom: 1px solid var(--af-border);
    padding: 10px 12px;
    position: sticky;
     /* top: 0; */
    z-index: 100;
}

/* ── Inline rows (Format / Type / Genres / Year) ── */
.af-inline-rows { }

.af-inline-row {
    display: flex;
    align-items: flex-start;
    border-top: 1px solid var(--af-border);
    padding: 4px 0;
    max-height: 130px;
    overflow-y: auto;
    white-space: nowrap;
}
.af-inline-row:first-child {
    border-top: none;
}
.af-inline-label {
    width: 64px;
    min-width: 64px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--af-muted);
    padding: 8px 10px 0 2px;
    flex-shrink: 0;
}
.af-inline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    flex: 1;
    padding: 4px 0;
    white-space: normal;
}
.af-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 13px;
    border-radius: var(--af-r-sm);
    font-size: 0.73rem;
    font-weight: 500;
    background: var(--af-surface2);
    border: 1px solid var(--af-border2);
    color: var(--af-muted);
    cursor: pointer;
    white-space: nowrap;
    min-height: 32px;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.12s;
    user-select: none;
}
.af-tag:hover { border-color: var(--af-accent); color: var(--af-accent); background: rgba(232,103,58,0.08); }
.af-tag.active {
    background: var(--af-accent);
    border-color: var(--af-accent);
    color: #fff;
    font-weight: 700;
}
@media (max-width: 767px) {
    .af-tag { min-height: 34px; padding: 5px 10px; }
}
.af-tag.loading-skeleton {
    width: 54px; height: 28px;
    background: var(--af-border);
    border-color: transparent;
    color: transparent;
    pointer-events: none;
    animation: af-shimmer 1.4s infinite;
}

/* ── Active bar ── */
#af-active-bar {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 12px 4px;
    background: var(--af-surface);
    border-bottom: 1px solid var(--af-border);
}
#af-active-bar.visible { display: flex; }
.af-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(232,103,58,0.12);
    border: 1px solid rgba(232,103,58,0.35);
    color: var(--af-accent);
    border-radius: 20px;
    padding: 3px 9px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}
.af-active-chip button {
    background: none; border: none;
    color: var(--af-accent);
    cursor: pointer; font-size: 1rem;
    line-height: 1; padding: 0; opacity: 0.65;
}
.af-active-chip button:hover { opacity: 1; }
#af-clear-btn {
    margin-left: auto;
    background: none;
    border: 1px solid var(--af-border2);
    color: var(--af-muted);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.68rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s;
}
#af-clear-btn:hover { border-color: var(--af-accent); color: var(--af-accent); }

/* ── Results header ── */
#af-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px 8px;
    gap: 8px;
    flex-wrap: wrap;
}
#af-count { font-size: 0.75rem; color: var(--af-muted); }
#af-count span { color: var(--af-accent2); font-weight: 700; }
#af-share-btn {
    background: var(--af-surface);
    border: 1px solid var(--af-border2);
    color: var(--af-muted);
    padding: 5px 12px;
    border-radius: var(--af-r-sm);
    font-size: 0.73rem;
    cursor: pointer;
    white-space: nowrap;
    min-height: 34px;
    transition: all 0.12s;
}
#af-share-btn:hover { border-color: var(--af-accent2); color: var(--af-accent2); }

/* ── Grid ── */
#af-grid-wrap { padding: 0 12px; }
#af-grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 12px 8px;
}
@media (min-width: 600px)  { #af-grid { grid-template-columns: repeat(4,1fr); gap: 16px 12px; } }

/* ── Card (match results-grid style) ── */
.af-card {
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    animation: af-fadein 0.22s ease both;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease;
}
@media (hover: hover) {
    .af-card:hover { transform: translateY(-5px); }
    .af-card:hover .af-card-thumb img { transform: scale(1.03); }
}
.af-card:active { opacity: 0.8; }
.af-card a { text-decoration: none; color: inherit; display: block; }
.af-card-thumb {
    position: relative; aspect-ratio: 16/9;
    background: #1a1a1a;
    overflow: hidden;
    display: block;
}
.af-card-thumb img {
    width:100%; height:100%; object-fit:cover; display:block;
    transition: transform 0.28s ease;
}
.af-card-thumb-placeholder {
    width:100%; height:100%; display:flex; align-items:center;
    justify-content:center; color:#444; font-size:1.4rem;
}
.af-card-noti {
    position:absolute; top:8px; left:8px;
    background:#5bb7fe; color:#fff;
    font-size:0.8em; font-weight:700;
    padding:3px 8px; border-radius:4px; z-index:2;
}
.af-card-year {
    position:absolute; bottom:6px; right:6px;
    background:rgba(0,0,0,0.75); color:#fff;
    font-size:0.72em; font-weight:600;
    padding:2px 6px; border-radius:3px;
}
.af-card-body { padding: 12px; }
.af-card-title {
    font-size:0.9em; font-weight:700; color:#eee; line-height:1.3;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
    margin-bottom:5px;
}
.af-card-meta {
    font-size:0.8em; color:#999;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.af-card-type {
    display:inline; color:#999;
    font-size:0.8em; font-weight:400;
    margin-right:5px; padding-right:5px;
    border-right:1px solid #555;
}

/* ── Skeleton ── */
.af-sk-card { background:#2a2a2a; border-radius:8px; overflow:hidden; border:1px solid #333; }
.af-sk-thumb { aspect-ratio:16/9; background:linear-gradient(90deg,#2a2a2a 25%,#3a3a3a 50%,#2a2a2a 75%); background-size:200% 100%; position:relative; overflow:hidden; animation:af-shimmer 1.5s infinite linear; }
.af-sk-line { height:14px; margin:12px 12px 0; border-radius:4px; background:linear-gradient(90deg,#2a2a2a 25%,#3a3a3a 50%,#2a2a2a 75%); background-size:200% 100%; animation:af-shimmer 1.5s infinite linear; position:relative; overflow:hidden; }
.af-sk-line.short { width:calc(50% - 12px); margin-bottom:12px; height:10px; }

/* ── Pagination ── */
#af-pagination {
    display:flex; justify-content:center; align-items:center;
    gap:5px; margin-top:24px; flex-wrap:wrap; padding:0 12px;
}
.af-page-btn {
    background:var(--af-surface); border:1px solid var(--af-border2);
    color:var(--af-muted); width:36px; height:36px;
    border-radius:var(--af-r-sm); cursor:pointer; font-size:0.78rem;
    display:flex; align-items:center; justify-content:center;
    transition:all 0.12s; -webkit-tap-highlight-color:transparent;
}
.af-page-btn:hover:not(:disabled) { border-color:var(--af-accent); color:var(--af-accent); }
.af-page-btn.active { background:var(--af-accent); border-color:var(--af-accent); color:#fff; }
.af-page-btn:disabled { opacity:0.25; cursor:default; }

/* ── Empty ── */
#af-empty { display:none; text-align:center; padding:60px 20px; color:var(--af-muted); }
#af-empty.visible { display:block; }
#af-empty p { font-size:0.85rem; margin-top:12px; }

/* ── Toggle filter button ── */
#af-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--af-surface);
    border: 1px solid var(--af-border2);
    color: var(--af-muted);
    padding: 5px 12px;
    border-radius: var(--af-r-sm);
    font-size: 0.73rem;
    cursor: pointer;
    white-space: nowrap;
    min-height: 34px;
    transition: all 0.12s;
}
#af-toggle-btn:hover { border-color: var(--af-accent); color: var(--af-accent); }
#af-toggle-btn.active { border-color: var(--af-accent); color: var(--af-accent); background: rgba(232,103,58,0.08); }
#af-toggle-btn svg { transition: transform 0.2s; }
#af-toggle-btn.active svg { transform: rotate(180deg); }

/* collapsible filters body */
#af-filters-body {
    overflow: hidden;
    transition: max-height 0.28s ease, opacity 0.2s ease;
    max-height: 600px;
    opacity: 1;
}
#af-filters-body.collapsed {
    max-height: 0;
    opacity: 0;
}

/* ── Animations ── */
@keyframes af-shimmer { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }
@keyframes af-fadein { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:translateY(0)} }
