/* ===== GameInfo / Damage Overview ===== */

.dmg-overview-page {
    padding: 1rem 0.5rem 2rem;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: #e2e8f0;
}

/* ---------- Filters ---------- */
.filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.85rem;
    padding: 0 0.25rem;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    min-width: 80px;
}

.caliber-tabs, .level-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.filter-tab {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(100, 116, 139, 0.25);
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-tab:hover {
    background: rgba(51, 65, 85, 0.8);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.35);
}

.filter-tab.active {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.28), rgba(250, 204, 21, 0.16));
    color: #fef3c7;
    border-color: rgba(250, 204, 21, 0.4);
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.12);
}

/* ---------- Loading ---------- */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 4rem 1rem;
    color: #94a3b8;
    font-size: 0.9rem;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(148, 163, 184, 0.2);
    border-top-color: #facc15;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------- Table Wrap ---------- */
.table-wrap {
    overflow: auto;
    max-height: calc(100vh - 200px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(15, 23, 42, 0.6);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    position: relative;
    margin-top: 1rem;
}

/* ---------- Table ---------- */
.overview-table {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    font-size: 0.8rem;
}

.overview-table th,
.overview-table td {
    padding: 0.55rem 0.75rem;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    text-align: center;
    vertical-align: middle;
}

/* ---------- Header ---------- */
.overview-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(180deg, #0f172a 0%, #131c2e 100%);
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.75rem;
    border-bottom: 2px solid rgba(234, 179, 8, 0.25);
    user-select: none;
}

/* Sorting indicators */
.overview-table thead th.sortable {
    cursor: pointer;
}
.overview-table thead th.sortable:hover {
    color: #f8fafc;
    background: linear-gradient(180deg, #1e293b 0%, #131c2e 100%);
}
.overview-table thead th.sort-asc::after {
    content: ' ▲';
    font-size: 0.6rem;
    color: #facc15;
}
.overview-table thead th.sort-desc::after {
    content: ' ▼';
    font-size: 0.6rem;
    color: #facc15;
}

/* Tooltips */
.overview-table thead th.has-tooltip {
    text-decoration: underline dotted rgba(148, 163, 184, 0.5);
    text-underline-offset: 3px;
    cursor: help;
}
.overview-table thead th.has-tooltip:hover::after {
    content: attr(data-title);
    position: absolute;
    top: calc(100% + 5px); /* show below header */
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: normal;
    white-space: pre-wrap;
    min-width: 200px;
    max-width: 300px;
    text-align: left;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 1000;
    pointer-events: none;
}

/* Sticky first column */
.overview-table th:nth-child(1),
.overview-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 10;
    min-width: 140px;
    background: #0f172a;
    font-weight: 600;
    color: #e2e8f0;
    border-right: 2px solid rgba(234, 179, 8, 0.18);
}

.overview-table thead th:nth-child(1) {
    z-index: 30;
}

/* Item Name Wrapper */
.item-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    white-space: normal;
}

.item-icon {
    width: 60px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
}

/* Row Hover */
.overview-table tbody tr {
    background: rgba(15, 23, 42, 0.85);
}

.overview-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.9);
}

/* Badges & Colors */
.acc-tag {
    color: #94a3b8;
    font-size: 0.72rem;
}

.val-positive { color: #4ade80; }
.val-negative { color: #f87171; }

.result-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.result-ttk {
    font-weight: 700;
    font-size: 0.9rem;
    color: #f87171; /* red-400 */
}

.result-dmg {
    font-size: 0.72rem;
    color: #cbd5e1;
}

.no-calc {
    color: #64748b;
    font-style: italic;
}

.bullet-pen-level {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.bullet-pen-level.lv3 { background: rgba(168, 85, 247, 0.2); color: #e879f9; }
.bullet-pen-level.lv4 { background: rgba(234, 179, 8, 0.2); color: #fde047; }
.bullet-pen-level.lv5 { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.bullet-pen-level.lv6 { background: rgba(239, 68, 68, 0.22); color: #fca5a5; }

/* Scrollbar */
.table-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.table-wrap::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}
.table-wrap::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 4px;
}
.table-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}
.table-wrap::-webkit-scrollbar-corner {
    background: rgba(15, 23, 42, 0.5);
}
