/* History modal styles - has its own separate modal */
.history-header-tabs { display: flex; gap: 4px; align-items: center; flex: 1; }
#historyPaginationHeader {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .history-header-tabs {
        flex: 1 1 auto;
        min-width: 0;
    }
    
    #historyPaginationHeader {
        flex: 0 1 auto;
    }
    
    .history-tab {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .history-table thead th {
        font-size: 10px;
        padding: 10px 8px;
    }
    
    .history-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .history-header-tabs {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .history-tab {
        padding: 8px 12px;
        font-size: 11px;
        flex: 1 1 auto;
        min-width: 70px;
    }
    
    #historyPaginationHeader {
        width: 100%;
        justify-content: center;
    }
    
    .history-table {
        font-size: 11px;
    }
    
    .history-table thead th {
        font-size: 9px;
        padding: 8px 6px;
    }
    
    .history-table td {
        padding: 8px 6px;
        font-size: 11px;
    }
}

.icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 8px; /* match other buttons */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    min-width: 40px;
    box-sizing: border-box;
}

.history-btn {
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: #9e9e9e; /* make settings icon grey */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.history-btn:hover {
    background: rgba(26, 26, 46, 1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.history-btn svg {
    display: block;
    width: 14px;
    height: 14px;
    margin: 0 auto;
}

/* History list styles */
.history-list {
    max-height: 220px;
    overflow: auto;
    color: rgba(255,255,255,0.9);
    font-size: 13px;
}
.history-empty {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    padding: 8px 0;
}
.history-table {
    width: 100%;
    border-collapse: collapse;
}
.history-table th {
    text-align: left;
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.history-table td {
    padding: 8px 8px;
    border-bottom: 1px dashed rgba(255,255,255,0.03);
    font-size: 13px;
}
.history-table tbody tr:last-child td {
    border-bottom: none;
}

/* Sidebar and modal layout for history */
.history-modal__content {
    max-width: 980px;
    padding: 20px;
    /* History modal gets a purple border and subtle inset glow (overrides global wallet styles) */
    border: 1px solid rgba(132, 94, 247, 0.25);
    box-shadow: 0 12px 36px rgba(0,0,0,0.45), 0 0 2px rgba(132, 94, 247, 0.18) inset;
    margin: auto;
    max-height: 85vh;
    overflow-y: auto;
}
.history-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.history-sidebar {
    display: none;
}
.history-header-tabs {
    display: flex;
    gap: 4px;
    align-items: center;
}
.history-tab {
    padding: 10px 24px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.65);
    border: 1.5px solid rgba(132, 94, 247, 0.12);
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.history-tab:hover {
    background: rgba(132, 94, 247, 0.1);
    border-color: rgba(132, 94, 247, 0.35);
    color: rgba(255,255,255,0.9);
}
.history-tab--active {
    background: linear-gradient(135deg, rgba(132, 94, 247, 0.25), rgba(132, 94, 247, 0.15));
    color: #ffffff;
    border-color: rgba(132, 94, 247, 0.5);
    box-shadow: 0 4px 12px rgba(132, 94, 247, 0.15);
}
.history-main {
    flex: 1;
    min-width: 0;
    width: 100%;
}
.history-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0;
}
#historyPaginationHeader {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}
.pagination-btn {
    background: rgba(132, 94, 247, 0.1);
    border: 1.5px solid rgba(132, 94, 247, 0.25);
    color: rgba(255,255,255,0.9);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 13px;
}
.pagination-btn:hover:not(:disabled) {
    background: rgba(132, 94, 247, 0.2);
    border-color: rgba(132, 94, 247, 0.5);
    transform: translateY(-1px);
}
.pagination-btn:disabled {
    opacity: 0.4;
    cursor: default;
}
.pagination-info {
    color: rgba(255,255,255,0.85);
    font-weight: 700;
    font-size: 13px;
}

/* Table improvements */
.history-list {
    max-height: 420px;
    min-height: 420px;
    overflow: auto;
    color: rgba(255,255,255,0.95);
    font-size: 13px;
    background: rgba(20,20,32,0.5);
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(132, 94, 247, 0.12);
}
.history-table {
    width: 100%;
    border-collapse: collapse;
}
.history-table thead th {
    text-align: left;
    font-size: 11px;
    color: rgba(255,255,255,0.75);
    padding: 14px 16px;
    border-bottom: 2px solid rgba(132, 94, 247, 0.25);
    background: rgba(132, 94, 247, 0.08);
    text-transform: uppercase;
    letter-spacing: 0.9px;
    font-weight: 700;
}
.history-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(132, 94, 247, 0.1);
    font-size: 13px;
    color: rgba(255,255,255,0.92);
}
.history-table tbody tr:nth-child(odd) {
    background: rgba(132, 94, 247, 0.04);
}
.history-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.01);
}
.history-table tbody tr:hover {
    background: rgba(132, 94, 247, 0.12);
}

.tx-hash {
    color: #ffd873;
    cursor: pointer;
    display: inline-block;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tx-hash:hover {
    text-decoration: underline;
}

.tx-link {
    color: #ffd873;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tx-link:hover {
    text-decoration: underline;
}

.copy-toast {
    position: fixed;
    right: 24px;
    top: 24px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    z-index: 11001;
}

.history-empty {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    padding: 18px 0;
    text-align: center;
}


/* Styles moved from JS injection: kill button, players cell and dark scrollbars */
/* View / action buttons inside history should match site action color (green) */
#historyModal .small-kill-btn,
#historyModal .kill-btn,
#historyModal .players-btn-wrap button,
#historyModal .game-view-btn {
    background: #4ade80; /* same green used elsewhere */
    color: #0f0f1e;
    border: none;
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    font-weight: 700;
}
#historyModal .small-kill-btn:hover,
#historyModal .kill-btn:hover,
#historyModal .players-btn-wrap button:hover,
#historyModal .game-view-btn:hover { background: #3bd668; }
#historyModal .small-kill-btn:active,
#historyModal .kill-btn:active,
#historyModal .players-btn-wrap button:active,
#historyModal .game-view-btn:active { transform: translateY(1px); }
#historyModal .kill-details-panel { border: 1px solid rgba(255,255,255,0.04); }

/* Scrollbars styled to match the start menu theme. Purple accent on hover. */
#historyModal .kill-details-panel, #historyModal .history-list { scrollbar-color: rgba(132, 94, 247, 0.2) rgba(20,20,32,0.5); }
#historyModal .kill-details-panel::-webkit-scrollbar, #historyModal .history-list::-webkit-scrollbar { width:10px; height:10px; }
#historyModal .kill-details-panel::-webkit-scrollbar-track, #historyModal .history-list::-webkit-scrollbar-track { background: rgba(20,20,32,0.3); }
#historyModal .kill-details-panel::-webkit-scrollbar-thumb, #historyModal .history-list::-webkit-scrollbar-thumb {
    background: rgba(132, 94, 247, 0.15);
    border-radius:6px;
    border: 1px solid rgba(132, 94, 247, 0.1);
}
#historyModal .kill-details-panel::-webkit-scrollbar-thumb:hover, #historyModal .history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(132, 94, 247, 0.3);
}

/* players cell layout */
#historyModal .players-cell { display:flex; justify-content:space-between; align-items:center; gap:10px; }
#historyModal .players-count { font-weight:600; }

/* Ensure links/buttons in table cells don't overflow */
#historyModal .players-btn-wrap button { min-width: 64px; }

/* Kill details floating panel: match start menu component look */
#killDetailsPanel, #historyModal .kill-details-panel {
    background: rgba(26, 26, 46, 0.95) !important;
    backdrop-filter: blur(8px);
    color: #ffffff !important;
    border: 1px solid rgba(132, 94, 247, 0.2) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important;
    border-radius: 16px !important;
    padding: 16px !important;
    max-height: 360px;
    overflow: auto;
}

/* Close button inside kill panel */
#killDetailsPanel .kill-panel-close {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
#killDetailsPanel .kill-panel-close:hover { 
    background: rgba(132, 94, 247, 0.15);
    color: rgba(255,255,255,0.9);
}

/* Make the history modal close (X) button purple to match the history theme */
#historyModal .wallet-modal__close {
    background: linear-gradient(135deg, rgba(132, 94, 247, 0.2) 0%, rgba(132, 94, 247, 0.12) 100%);
    border: 1px solid rgba(132, 94, 247, 0.3);
    color: rgba(255,255,255,0.95);
    font-size: 20px;
    padding: 0;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.18s ease;
    box-shadow: 0 6px 18px rgba(132, 94, 247, 0.06);
}

#historyModal .wallet-modal__close:hover {
    background: linear-gradient(135deg, rgba(132,94,247,0.35) 0%, rgba(132,94,247,0.25) 100%);
    border-color: rgba(132, 94, 247, 0.45);
    color: rgba(255,255,255,1);
    transform: translateY(-1px);
}

/* Table inside kill panel */
#killDetailsPanel table { width: 100%; border-collapse: collapse; margin-top: 6px; }
#killDetailsPanel th { text-align: left; font-size: 13px; color: rgba(255,255,255,0.85); padding: 8px; border-bottom: 1px solid rgba(132, 94, 247, 0.15); font-weight: 600; }
#killDetailsPanel td { padding: 8px; font-size: 13px; color: rgba(255,255,255,0.92); border-bottom: 1px solid rgba(132, 94, 247, 0.08); }
#killDetailsPanel tbody tr:nth-child(odd) { background: rgba(132, 94, 247, 0.03); }
#killDetailsPanel tbody tr:hover { background: rgba(132, 94, 247, 0.08); }

/* Ensure the small kill view button remains the green action look */
#killDetailsPanel .small-kill-btn, #historyModal .small-kill-btn { background: #4ade80 !important; color: #0f0f1e !important; }




