/* rankings.css — page-specific styles for rankings.php */

body { background-color: #050505; font-family: 'Inter', sans-serif; }

/* ── TABLE ──────────────────────────────────────────────────────────────── */
.ministry-table { font-family: 'Inter', sans-serif; font-weight: 400; border-collapse: separate; border-spacing: 0; background: #000; }
.ministry-table td { color: #cbd5e1; }
.ministry-table tbody tr { background: #000; }
.ministry-table tbody tr:hover { background: #0a0a0a; }
.ministry-table th, .ministry-table td { padding: 0.25rem 0.5rem !important; }
.table-wrapper { overflow-y: auto; max-height: calc(100vh - 240px); background: #000; }
.ministry-table thead th { position: sticky; top: 0; z-index: 20; background: #000; }

.item-col { min-width: 200px; }
.item-icon-list { width: 48px; height: 48px; object-fit: contain; background: rgba(0,0,0,0.6); border: 1px solid #191919; border-radius: 4px; padding: 2px; }
.rank-gold   { color: #FFD700; font-weight: 900; }
.rank-silver { color: #C0C0C0; }
.rank-bronze { color: #CD7F32; }

.sortable-header { cursor: pointer; position: relative; padding-right: 1.25rem !important; }
.sortable-header::after { content: '\f0dc'; font-family: 'Font Awesome 6 Free'; font-weight: 900; position: absolute; right: 4px; opacity: 0.2; font-size: 0.7em; top: 50%; transform: translateY(-50%); }
.sortable-header.asc::after  { content: '\f0de'; opacity: 1; color: #EAB308; }
.sortable-header.desc::after { content: '\f0dd'; opacity: 1; color: #EAB308; }
.th-highlight { color: #EAB308 !important; font-weight: 700; }

/* ── VIEW CONTENT ───────────────────────────────────────────────────────── */
.view-content { transition: opacity 0.2s ease; }
.view-content.hidden { display: none; opacity: 0; }

/* ── VIEW BAR — transparent bg, 3-col grid so buttons are truly centred ── */
#view-bar {
    position: sticky; top: 0; z-index: 50;
    background: #050505;
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: center; padding: 10px 8px 8px; gap: 8px;
}
#view-bar-right { display: flex; justify-content: flex-end; align-items: center; }
/* #view-switcher replaced by #view-slider block switcher */

/* ── CHECKBOXES ─────────────────────────────────────────────────────────── */
.type-filter {
    -webkit-appearance: none; appearance: none;
    width: 15px; height: 15px; flex-shrink: 0;
    border: 1px solid #444; border-radius: 2px;
    background: #111; cursor: pointer;
    position: relative; transition: background 0.12s, border-color 0.12s;
}
.type-filter:checked { background: #FBBF24; border-color: #FBBF24; }
.type-filter:checked::after {
    content: ''; position: absolute;
    left: 4px; top: 1px; width: 4px; height: 8px;
    border: 2px solid #000; border-top: none; border-left: none;
    transform: rotate(45deg);
}
.type-filter:hover:not(:checked) { border-color: #888; }

/* 3-column grid: 3 per row, sizes to content, no scroll */
#filter-container {
    display: grid; grid-template-columns: repeat(3, auto);
    gap: 5px 12px; padding: 5px 8px;
    border: 1px solid #222; border-radius: 4px;
}
#filter-container label { display: flex; align-items: center; gap: 5px; font-size: 10px; color: #9ca3af; cursor: pointer; text-transform: uppercase; white-space: nowrap; transition: color 0.15s; }
#filter-container label:hover { color: #fff; }

/* ── GRAPH TOOLTIP ──────────────────────────────────────────────────────── */
#graph-tooltip { pointer-events: none; z-index: 10000; min-width: 220px; box-shadow: 0 10px 40px rgba(0,0,0,0.95); border: 1px solid #333; }

/* ── CASE BLOCK-SWITCHER ────────────────────────────────────────────────── */
.compact-slider .slider-option { padding: 0.25rem 0.75rem; font-size: 10px; }
.compact-slider.slider-container { padding: 1px; }
#case-slider .slider-option { padding: 0.2rem 0.75rem; font-size: 10px; gap: 0.4rem; }
#case-slider .slider-option img { width: 18px; height: 18px; object-fit: contain; }

/* Faction + view block switchers */
#faction-slider .slider-option { padding: 0.25rem 0.9rem; font-size: 11px; gap: 0.4rem; }
#faction-slider .slider-option.active img { filter: brightness(0); }
#view-slider .slider-option { padding: 0.3rem 1.1rem; font-size: 13px; }

/* ── ZOOM (inside graph view) ───────────────────────────────────────────── */
#zoom-container { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 0 2px; }
#zoom-slider { -webkit-appearance: none; width: 120px; height: 2px; background: #333; border-radius: 5px; outline: none; }
#zoom-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; background: #EAB308; border-radius: 50%; cursor: pointer; border: 2px solid #000; }
#zoom-slider::-moz-range-thumb { width: 12px; height: 12px; background: #EAB308; border-radius: 50%; cursor: pointer; border: 2px solid #000; }
#zoom-label { font-size: 9px; color: #555; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── FOOTER ─────────────────────────────────────────────────────────────── */
#footer-inner { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; width: 100%; }
#footer-left  { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
#footer-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.footer-sep   { width: 1px; height: 32px; background: #222; flex-shrink: 0; }

/* ── MOBILE DROP-UP CONTROLS ────────────────────────────────────────────── */
#mobile-controls { display: none; align-items: center; gap: 6px; flex-shrink: 0; }
.mobile-dd-wrap  { position: relative; }
.mobile-dd-btn {
    display: flex; align-items: center; gap: 6px;
    background: #0a0a0a; border: 1px solid #2a2a2a; border-radius: 4px;
    padding: 5px 10px; font-size: 11px; font-family: 'Inter', sans-serif;
    text-transform: uppercase; color: #aaa; cursor: pointer; white-space: nowrap;
    transition: border-color 0.15s, color 0.15s;
}
.mobile-dd-btn:hover, .mobile-dd-btn.open { border-color: #555; color: #fff; }
.mobile-dd-btn img { width: 16px; height: 16px; object-fit: contain; }
.mobile-dd-btn .dd-chevron { font-size: 8px; color: #555; margin-left: 2px; transition: transform 0.15s; }
.mobile-dd-btn.open .dd-chevron { transform: rotate(180deg); }
.mobile-dd-panel {
    position: absolute; bottom: calc(100% + 6px); left: 0;
    min-width: 140px; background: #050505;
    border: 1px solid #333; border-radius: 4px;
    z-index: 500; overflow: hidden; display: none;
}
.mobile-dd-panel.open { display: block; }
.mobile-dd-option {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 8px 12px; font-size: 11px; font-family: 'Inter', sans-serif;
    text-transform: uppercase; color: #aaa;
    background: none; border: none; cursor: pointer; text-align: left;
    transition: background 0.1s, color 0.1s;
}
.mobile-dd-option:hover { background: #111; color: #fff; }
.mobile-dd-option.active { color: #FBBF24; }
.mobile-dd-option img { width: 16px; height: 16px; object-fit: contain; }

/* ── LOADING OVERLAY ────────────────────────────────────────────────────── */
#loading-overlay { position: fixed; inset: 0; background: #050505; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 9999; gap: 1rem; }
#loading-overlay .spinner { width: 32px; height: 32px; border: 3px solid #333; border-top-color: #EAB308; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

#orb-menu-button { z-index: 2000 !important; }
#orb-nav-list    { z-index: 1999 !important; }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .ministry-table { font-size: 10px; }
    .ministry-table th, .ministry-table td { padding: 0.2rem 0.15rem !important; }
    .item-icon-list { width: 28px !important; height: 28px !important; }
    .item-col { width: 90px !important; min-width: 90px !important; }
    .item-name-text { white-space: normal !important; line-height: 1.1; }
    #mobile-controls { display: flex; }
    #footer-left { display: none; }
    #zoom-slider { width: 80px; }
    #filter-container { grid-template-columns: repeat(2, auto); }
}