@font-face {
    font-family: 'jost';
    src: url('../../assets/fonts/jost.ttf') format('opentype');
}

@font-face {
    font-family: 'zombie';
    src: url('../../assets/fonts/zombie.otf') format('opentype');
}

@font-face {
    font-family: 'orbitron';
    src: url('../../assets/fonts/orbitron.ttf') format('opentype');
}

body {
    font-family: Arial, sans-serif;
    margin: 20px;
    padding: 0;
    background-color: #f4f4f9;
}

h1 {
    text-align: center;
    color: #333;
}

#loading-message {
    text-align: center;
    font-size: 1.2em;
    color: #555;
    margin-bottom: 20px;
}

/* Toggle switch styles */
.view-toggle-container {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.mode-select {
    padding: 8px 12px;
    border-radius: 20px;
    border: 2px solid #2196F3;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #555;
}

.mode-select.active {
    background: #2196F3;
    color: white;
}

.mode-select-wrapper {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

.info-button {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #2196F3;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.info-button:hover {
    opacity: 1;
}

.info-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-width: 500px;
    width: 90%;
}

.info-popup-content {
    margin-bottom: 20px;
}

.info-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    padding: 5px;
    line-height: 1;
}

.info-popup-close:hover {
    color: #333;
}

.dark-mode .info-popup {
    background: #2d2d2d;
    color: #e0e0e0;
}

.dark-mode .info-popup-close {
    color: #aaa;
}

.dark-mode .info-popup-close:hover {
    color: #fff;
}

/* Add styles for depletion rate indicators */
.depletion-high {
    color: white !important;
}

.depletion-medium {
    color: black !important;
}

.depletion-low {
    color: black !important;
}

.depletion-none {
    color: black !important;
}

/* Dark mode styles for BALs View */
.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

.dark-mode #gecko-stats {
    background-color: #2d2d2d;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    color: white;
}

.dark-mode #gecko-stats>div {
    background-color: #2d2d2d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark-mode h1,
.dark-mode h2,
.dark-mode h3 {
    color: #fff;
}

.dark-mode .sort-button {
    color: #aaa;
}

.dark-mode .sort-button:hover {
    color: #2196F3;
}

.dark-mode li {
    border-bottom: 1px solid #404040;
}

.dark-mode li strong {
    color: #e0e0e0;
}

.dark-mode .depletion-high {
    color: #ffffff !important;
}

.dark-mode .depletion-medium {
    color: #000000 !important;
}

.dark-mode .depletion-low {
    color: #000000 !important;
}

.dark-mode .depletion-none {
    color: #000000 !important;
    background-color: #ffffff;
}

.dark-mode .percent-lost {
    background-color: #404040;
    color: #ffffff;
}

.dark-mode #gecko-stats h3 {
    border-bottom: 2px solid #404040;
    color: white;
}

.dark-mode .immortal-ids {
    background-color: #333;
}

.dark-mode .ids-list {
    background-color: #404040;
    border-color: #555;
}

.dark-mode .gecko-id:hover {
    background-color: #505050;
}

.percent-lost {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 10px;
    background-color: rgba(0, 0, 0, 0.1);
}

.sort-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    color: #666;
    font-size: 0.9em;
}

.sort-button:hover {
    color: #2196F3;
}

#gecko-stats {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h3 {
    color: #555;
}

ul {
    list-style-type: none;
    padding: 0;
}

li {
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    border-radius: 4px;
    margin: 2px 0;
}

li span {
    display: inline-block;
}

li span:last-child {
    text-align: right;
}

li strong {
    font-weight: 600;
    color: #333;
}

/* Add styles for the delta values */
li span strong:nth-of-type(2) {
    color: #1a1a1a;
    font-size: 1.1em;
}

/* Improve section spacing */
#gecko-stats>div {
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Make headers more prominent */
#gecko-stats h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    color: #333;
    font-size: 1.2em;
}

#gecko-stats h2 {
    color: #444;
    text-align: center;
    margin-top: 40px;
}

#gecko-stats p {
    text-align: center;
    font-weight: bold;
}

.dark-mode #gecko-stats h2 {
    color: #ffffff;
    text-align: center;
    margin-top: 40px;
}

.dark-mode #gecko-stats p {
    text-align: center;
    font-weight: bold;
    color: #e0e0e0;
}

.dark-mode .immortal-ids {
    background-color: #333;
    margin: 20px 0;
    padding: 15px;
    border-radius: 5px;
}

.dark-mode .ids-list {
    background-color: #404040;
    border-color: #555;
    color: #e0e0e0;
    max-height: 150px;
    overflow-y: auto;
    padding: 10px;
    border-radius: 3px;
    font-family: monospace;
    line-height: 1.5;
    word-wrap: break-word;
}

.dark-mode .gecko-id {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    color: #2196F3;
}

.dark-mode .gecko-id:hover {
    background-color: #505050;
}

.stats-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stats-header .immortal-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.stats-header p {
    margin: 0;
    font-size: 1.1em;
}

.stats-header strong {
    color: #2196F3;
}

/* Dark mode styles for stats header */
.dark-mode .stats-header {
    background-color: #2d2d2d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dark-mode .stats-header p {
    color: #e0e0e0;
}

.dark-mode .stats-header strong {
    color: #64b5f6;
}

.depletion-legend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin: 15px 0;
    padding: 5px 10px;
    font-size: 0.9em;
}

.depletion-legend-item {
    width: 100%;
    max-width: 600px;
    display: flex;
    justify-content: center;
}

.depletion-legend-gradient {
    width: 100%;
    height: 25px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(to right,
            #ffffff 0%,
            rgb(220, 220, 100) 5%,
            rgb(255, 180, 70) 35%,
            rgb(255, 120, 50) 65%,
            rgb(255, 30, 30) 85%,
            rgb(255, 0, 0) 100%);
}

/* Update the delta legend gradient to only show red shades */
.delta-legend-gradient {
    width: 100%;
    height: 20px;
    border-radius: 4px;
    background: linear-gradient(to right,
            rgb(255, 50, 50) 0%,
            /* Deep red for highest loss */
            rgb(255, 100, 100) 25%,
            /* Medium red */
            rgb(255, 150, 150) 50%,
            /* Light red */
            rgb(255, 200, 200) 75%,
            /* Very light red */
            rgb(245, 245, 245) 100%
            /* Neutral for no change */
        );
}

.depletion-legend-labels {
    width: 100%;
    max-width: 600px;
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
    color: #666;
}

/* Dark mode styles for legend */
.dark-mode .depletion-legend {
    color: #e0e0e0;
}

.dark-mode .depletion-legend-gradient {
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .depletion-legend-labels {
    color: #aaa;
}

.balance-bar-container {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    height: 24px;
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.balance-bar {
    transition: all 0.3s ease;
    border-radius: 2px;
    position: absolute;
    height: 100%;
}

.balance-bar-background {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
}

.dark-mode .balance-bar-container {
    background: #2d2d2d;
    border-color: #444;
}

.dark-mode .balance-bar-center {
    background: #888 !important;
}

.dark-mode .balance-bar-background {
    background: linear-gradient(to right,
            rgba(150, 255, 150, 0.05) 0%,
            rgba(150, 255, 150, 0.05) 49%,
            rgba(255, 150, 150, 0.05) 51%,
            rgba(255, 150, 150, 0.05) 100%) !important;
}

.balance-bar-center {
    position: absolute;
    left: 50%;
    width: 2px;
    height: 100%;
    background: #666;
    transform: translateX(-50%);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Add hover effects for trait items */
li:hover {
    background-color: rgba(33, 150, 243, 0.1);
}

.dark-mode li:hover {
    background-color: rgba(33, 150, 243, 0.2);
}

/* Smooth transitions for color changes */
.depletion-high,
.depletion-medium,
.depletion-low,
.depletion-none {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Improve mobile responsiveness */
@media (max-width: 768px) {
    .view-toggle-container {
        flex-direction: column;
        gap: 10px;
    }

    .mode-select {
        width: 100%;
        max-width: 300px;
    }

    li {
        padding: 12px 8px;
    }

    .stats-header {
        flex-direction: column;
    }
}

/* Add tooltips */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

[data-tooltip]:hover:before {
    opacity: 1;
    visibility: visible;
}

/* Improve legend visibility */
.depletion-legend,
.delta-legend {
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 1;
    visibility: visible;
}

.depletion-legend.hidden,
.delta-legend.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Update percent-lost styles to inherit colors */
.percent-lost {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 10px;
    background-color: rgba(0, 0, 0, 0.1);
}

.dark-mode .percent-lost {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Add styles for balance info icon and popup */
.balance-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #666;
    color: #666;
    font-size: 12px;
    font-style: italic;
    font-family: serif;
    margin-left: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    padding: 0;
}

.balance-info-icon:hover {
    background: #f0f0f0;
    border-color: #333;
    color: #333;
}

.dark-mode .balance-info-icon {
    border-color: #aaa;
    color: #aaa;
}

.dark-mode .balance-info-icon:hover {
    background: #404040;
    border-color: #fff;
    color: #fff;
}

.balance-info-popup {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    width: max-content;
    max-width: 300px;
    font-size: 0.9em;
    display: none;
}

.balance-info-popup.active {
    display: block;
}

.dark-mode .balance-info-popup {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
}

.balance-info-popup::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: inherit;
    border-left: 1px solid #ddd;
    border-top: 1px solid #ddd;
}

.dark-mode .balance-info-popup::before {
    border-color: #444;
}

.balance-info-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.balance-info-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.balance-info-row strong {
    color: #2196F3;
}

.dark-mode .balance-info-row strong {
    color: #64b5f6;
}

.wallet-distribution-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    margin-right: 4px;
    padding: 0;
    border: 1px solid #666;
    border-radius: 50%;
    background: transparent;
    color: #666;
    cursor: pointer;
    font-size: 12px;
    font-family: serif;
    font-style: italic;
    font-weight: normal;
    line-height: 1;
    vertical-align: middle;
    transition: all 0.2s ease;
}

.wallet-distribution-trigger:hover,
.wallet-distribution-trigger:focus {
    background: #f0f0f0;
    border-color: #333;
    color: #333;
    outline: none;
}

.dark-mode .wallet-distribution-trigger {
    border-color: #aaa;
    color: #aaa;
}

.dark-mode .wallet-distribution-trigger:hover,
.dark-mode .wallet-distribution-trigger:focus {
    background: #404040;
    border-color: #fff;
    color: #fff;
}

.wallet-distribution-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
}

.wallet-distribution-modal,
.wallet-distribution-modal * {
    font-family: Arial, sans-serif;
    text-shadow: none;
}

.wallet-distribution-content {
    width: min(500px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #333;
}

.wallet-distribution-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 20px 12px;
    border-bottom: 2px solid #eee;
}

.wallet-distribution-header h2 {
    margin: 0;
    color: #444;
    font-size: 1.2em;
    letter-spacing: 0;
    text-align: left;
}

.wallet-distribution-header p {
    margin: 6px 0 0;
    color: #333;
    font-size: 0.9em;
    font-weight: bold;
    text-align: left;
}

.wallet-distribution-close {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    color: #aaa;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 5px;
}

.wallet-distribution-close:hover,
.wallet-distribution-close:focus {
    color: #333;
    outline: none;
}

.wallet-distribution-list {
    display: flex;
    flex-direction: column;
    padding: 8px 20px 20px;
}

.wallet-distribution-row {
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.wallet-distribution-row:last-child {
    border-bottom: 0;
}

.wallet-distribution-row-top,
.wallet-distribution-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wallet-distribution-row-top {
    color: #333;
    font-size: 0.95em;
}

.wallet-distribution-row-top strong {
    color: #2196F3;
}

.wallet-distribution-meta {
    margin-top: 4px;
    color: #666;
    font-size: 0.85em;
}

.wallet-distribution-bar {
    height: 8px;
    margin-top: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    background: #f4f4f9;
}

.wallet-distribution-bar span {
    display: block;
    height: 100%;
    border-radius: 2px;
    background: #2196F3;
}

.dark-mode .wallet-distribution-content {
    border-color: #444;
    background-color: #2d2d2d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: #e0e0e0;
}

.dark-mode .wallet-distribution-header {
    border-bottom-color: #404040;
}

.dark-mode .wallet-distribution-header h2 {
    color: #ffffff;
}

.dark-mode .wallet-distribution-header p {
    color: #e0e0e0;
}

.dark-mode .wallet-distribution-close:hover,
.dark-mode .wallet-distribution-close:focus {
    color: #fff;
}

.dark-mode .wallet-distribution-row {
    border-bottom-color: #404040;
}

.dark-mode .wallet-distribution-row-top {
    color: #ffffff;
}

.dark-mode .wallet-distribution-row-top strong {
    color: #64b5f6;
}

.dark-mode .wallet-distribution-meta {
    color: #aaa;
}

.dark-mode .wallet-distribution-bar {
    border-color: #444;
    background: #1a1a1a;
}
