:root {
    --accent: #c7427e;
    --accent2: #626262;
    --bg: #2b2b2b;
    --bg2: #202020;
    --border: #5c2d2a;
    --border2: #373737;
    --fg: #ededed;
    --fg2: #d2b48c;
    --hov: #ffffff05;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.125);
    --shadow2: 0 4px 12px rgba(0, 0, 0, 0.25);
}

html {
  box-sizing: border-box;
}

body {
    font-family: sans-serif;
    background: var(--bg);
    color: var(--fg);
    display: flex;
    height: 100vh;
    margin: 0;
}

/* Text */
h2 {
    margin-top: 0;
    margin-bottom: 0;
    color: var(--fg);
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    font-size: 28px;
    font-weight: 500;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
}

/* Sidebar */
#sidebar {
    max-width: 333px;
    width: 33vw;
    background: var(--bg2);
    padding: 20px;
    border-right: 1px solid var(--border2);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}

#sidebarSearch,
select {
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--border2);
    border-radius: 4px;
}

#sidebarSearchResults:not(:empty) {
    margin-top: -21px;
    margin-bottom: 10px;
    border-top: none;
    color: var(--fg);
    background-color: var(--bg);
    border: 1px solid var(--border2);
    box-shadow: var(--shadow);
    border-radius: 4px;
}

#sidebarSearchResults div small {
    cursor: pointer;
    color: var(--fg2);
}

#sidebarSearchResults div:last-child {
    border-bottom: none !important;
}

#sidebarSearchResults div:hover {
    background-color: var(--hov);
}

.sidebar-button {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    color: var(--fg);
    background-color: var(--bg);
    border: 1px solid var(--border2);
    cursor: pointer;
    font-weight: bold;
    border-radius: 4px;
}

/* Content Area */
#content {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    max-width: 1080px;
    margin: 0 auto;
}

#header-container {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-bottom: 20px;
}

/* Chart */
.chart-container {
    flex-grow: 1;
    background-color: var(--bg2);
    border: 1px solid var(--border);
    padding: 10px;
    box-shadow: var(--shadow);
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.chart-container label {
    display: block;
    margin-top: 10px;
    color: var(--fg);
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

/* Chart Tabs */
.chart-tabs-container {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    overflow: visible;
}

.chart-tab-button {
    flex: 1 1 0;
    min-width: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--fg2);
    border-left: 1px solid var(--border);
    border-image: linear-gradient(to top, var(--border), transparent) 1;
    padding: 10px 2px;
    white-space: nowrap;
    overflow: hidden;
    text-align: center;
    margin-bottom: -1px;
}

.chart-tab-button.active {
    color: var(--fg);
    background-image: linear-gradient(to top, var(--bg2), transparent);
    border-left: 1px solid var(--border);
}

.chart-tab-button:last-child {
    border-right: 1px solid var(--border);
    border-image: linear-gradient(to top, var(--border), transparent) 1;
}

.chart-tab-button:hover {
    text-decoration: underline;
}

.chart-tab-button[aria-expanded="true"] .arrow {
    display: inline-block;
    transform: rotate(180deg);
}

.chart-tab-dropdown {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    display: flex;
    justify-content: center;
}

.chart-tab-dropdown:last-child {
    border-right: 1px solid var(--border);
    border-image: linear-gradient(to top, var(--border), transparent) 1;
}

.chart-tab-button[aria-expanded="true"] {
    background-image: none;
    border-left: 1px solid var(--border);
}

.chart-tab-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0px;
    right: -1px;
    background-color: var(--bg);
    z-index: 1000;
    border: 1px solid var(--border);
    border-top: none;
    box-shadow: var(--shadow2);
}

.chart-tab-dropdown-content.show {
    display: block;
}   

.chart-tab-dropdown-content button {
    width: 100%;
    padding: 10px;
    text-align: center;
    background: none;
    color: var(--fg2);
    border: none;
    cursor: pointer;
    border-top: 1px solid var(--border2);
    overflow: hidden;
}

.chart-tab-dropdown-content button:hover {
    background-color: var(--hov);
}

.chart-tab-dropdown-content button.active {
    color: var(--fg);
}

/* Rates Grid */
.rates-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    margin-top: 20px;
    border: 1px solid var(--border);
    background-color: var(--bg2);
    overflow: hidden;
    box-shadow: var(--shadow);
    border-radius: 4px;
}

.rate-item {
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-right: 1px solid var(--bg);
    border-bottom: 1px solid var(--bg);
    margin-right: -1px;
    margin-bottom: -1px;
}

.rate-item.highlight,
.rate-item:hover {
    background-color: var(--hov);
}

.rate-value {
    color: var(--fg2);
    font-family: monospace;
    font-size: 14px;
}

.grid-input {
    background: transparent;
    border: none;
    color: var(--fg2);
    width: 100%;
    font-size: inherit;
    font-family: inherit;
    outline: none;
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
}

.grid-input-2 {
    background: transparent;
    border: none;
    color: var(--fg);
    width: auto;
    font-size: 12px;
    font-weight: 500;
    outline: none;
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
    padding-left: 0px;
    margin-bottom: 2px;

}

.grid-input-2::placeholder,
.grid-input::placeholder {
    color: var(--accent2);
}

.grid-input-2::-webkit-outer-spin-button,
.grid-input-2::-webkit-inner-spin-button
.grid-input::-webkit-outer-spin-button,
.grid-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.grid-input-warning {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffa500' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'%3E%3C/path%3E%3Cline x1='12' y1='9' x2='12' y2='13'%3E%3C/line%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0px center;
  background-size: 14px;
}

.grid-input-error {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ff4d4d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'%3E%3C/path%3E%3Cline x1='12' y1='9' x2='12' y2='13'%3E%3C/line%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0px center;
  background-size: 14px;
}


/* Data */
#dataSmall {
    margin-top: 20px;
    display: block;
    color: var(--fg) !important;
}

/* Desktop Menu */
#headerButton {
    display: none;
}

/* Mobile */
@media (max-width: 768px) {

    /* Mobile Header */
    #header-container {
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--bg2);
        border-bottom: 1px solid var(--border2);
        padding: 10px 20px;
        padding-top: calc(env(safe-area-inset-top) + 10px);
        margin: 0px -20px 20px -20px;
        align-items: center;
        gap: 15px;
        z-index: 1001;
        box-shadow: var(--shadow);
    }

    #headerButton {
        display: block !important;
        position: static !important;
        background: transparent;
        color: white;
        border: none;
        cursor: pointer;
        font-size: 24px;
    }

    #headerH2 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-top: 0px;
        margin-bottom: 0px;
        font-size: 24px;
    }

    /* Mobile Sidebar */
    #sidebar {
        width: 66vw;
        left: -66vw;
        position: fixed;
        z-index: 999;
        height: 100vh;
        padding-top: 80px;
        z-index: 1000;
        max-width: 100vw;
        transition: left 0.2s;
    }

    #sidebar.open {
        left: 0;
    }

    #sidebarOverlay {
        display: none;
        position: fixed;
        z-index: 998;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
    }

    #sidebarOverlay.show {
        display: block;
    }

    #content {
        padding-top: 0;
    }

    /* Mobile Input */
    #sidebarSearch,
    select {
        font-size: 16px !important;
    }

    .grid-input-2,
    .grid-input  {
        font-size: 16px !important;
    }
}

/* Accessibility */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    border-radius: 4px;
}

.grid-input:focus-visible,
.grid-input-2:focus-visible {
    outline-offset: 4px;
}

/* Deprecated */
#statSelect {
    display: none;
}

*, *::before, *::after {
  box-sizing: inherit;
}

