@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Audiowide&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

@font-face {
    font-family: 'Formula1-Black';
    src: url('fonts/Formula1-Black.ttf') format('truetype');
}

@font-face {
    font-family: 'Formula1-Bold';
    src: url('fonts/Formula1-Bold_web.ttf') format('truetype');
}

@font-face {
    font-family: 'Formula1-Bold-4';
    src: url('fonts/Formula1-Bold-4.ttf') format('truetype');
}

@font-face {
    font-family: 'Formula1-Italic';
    src: url('fonts/Formula1-Italic.ttf') format('truetype');
}

@font-face {
    font-family: 'Formula1-Regular';
    src: url('fonts/Formula1-Regular-1.ttf') format('truetype');
}

@font-face {
    font-family: 'Formula1-Wide';
    src: url('fonts/Formula1-Wide.ttf') format('truetype');
}

body {
    font-family: 'Formula1-Regular', Arial, sans-serif;
    background-color: #121212;
    color: #ffffff;
    margin: 0;
    padding: 0;
}

h1, h2 {
    font-family: 'Formula1-Black', Arial, sans-serif;
    text-align: center;
    margin: 20px 0;
    color: #ffffff;
}

.header-title {
    font-size: 1.5em; /* Make the header-title text larger than the rest */
    color: #a0a0a0; /* Slightly lighter gray for non-bold text */
}

.header-title b {
    color: #ffffff; /* Keep bold text the same as the rest of the text */
}

table {
    margin: 20px auto;
    border-collapse: collapse;
    background-color: #1e1e1e;
    color: #ffffff;
    border: none; /* Remove the outer border of the table */
    font-size: 0.7em;
    text-align: left;
}

table td {
    padding: 1px; /* Reduced from 4px to minimize spacing */
    border-bottom: none; /* Remove the border between rows */
}

table td.top-score {
    background-color: #771888; /* Set the background color for the top-score cell */
    color: #ffffff; /* Ensure text is readable */
}

table tr {
    background-color: #1e1e1e; /* Set all rows to the darker color */
    justify-content: space-between;
    align-items: left;
    margin: 0; /* Remove any additional margin between rows */
}

table tr:nth-child(even) {
    background-color: #1e1e1e; /* Remove alternating colors */
}

/* table tr:nth-child(odd) {
    background-color: #1e1e1e;
} */

table td:nth-child(1) {
    text-align: center;
    width: 30px; /* Fixed width for rank column */
    vertical-align: middle;
}

table td:nth-child(2) {
    width: auto; /* Allow column 2 to auto size to fit the text */
    text-align: left;
    padding-left: 0; /* Remove left padding */
    padding-right: 6px; /* Add spacing between icon column and name column */
}

table td:nth-child(4) {
    text-align: right; /* Right justify column 3 */
    padding-left: 4px; /* Reduced from 8px */
    padding-right: 4px; /* Reduced from 8px */
}

table td:nth-child(5) {
    text-align: right; /* Right justify column 4 */
    padding-left: 4px; /* Reduced from 8px */
    padding-right: 4px; /* Reduced from 8px */
}

table td:nth-child(6) { /* Style for the new 6th column */
    text-align: center;
    padding: 0; /* Remove padding to allow background to fill */
    width: 24px; /* Fixed width for the icon cell */
}

.top-change-cell {
    background-color: #771888; /* Purple square */
    /* Ensure the cell is square-like if possible, or adjust padding/width/height */
}

.empty-change-cell {
    background-color: #121212; /* Match body background */
    border: none; /* Ensure no borders are visible */
}

img.top-change-icon {
    width: 16px; /* Adjust to match row text size */
    height: auto; /* Maintain aspect ratio */
    vertical-align: middle;
    filter: brightness(0) invert(1); /* Makes the SVG white */
}

span.last-name {
    text-transform: uppercase;
    font-weight: bold;
}
span.short-name {
    text-transform: uppercase;
    font-weight: bold;
}

span.score {
    font-family: 'Formula1-Regular', Arial, sans-serif;
    font-style: normal;
    font-size: 1.1em; /* Increase font size slightly */
    letter-spacing: 0.07em; /* Increase kerning for better readability */
}

span.change {
    font-family: 'Formula1-Regular', Arial, sans-serif;
    font-style: normal;
    font-size: 1.1em; /* Increase font size slightly */
    letter-spacing: 0.07em; /* Increase kerning for better readability */
}

img.elite-top-score, img.ald-logo, img.aisling-logo, img.edmund-logo, img.rui-logo, img.grom-logo, img.archer-logo, img.antal-logo, img.kaine-logo, img.archon-logo, img.winters-logo, img.denton-logo, img.zemina-logo {
    width: 18px; /* Slightly smaller size */
    height: auto; /* Maintain aspect ratio */
    vertical-align: middle; /* Align vertically with text */
}

img.aisling-logo {
    /* filter: drop-shadow(0 0 5px #0099ff); */
    color: #00a3fc;
    filter: invert(50%) sepia(53%) saturate(5061%) hue-rotate(177deg) brightness(106%) contrast(102%);
}

img.ald-logo {
    color: #8c00fb;
    /* filter: drop-shadow(0 0 5px #8000ff); */
    filter: invert(9%) sepia(97%) saturate(7434%) hue-rotate(276deg) brightness(104%) contrast(118%);
}

img.edmund-logo {
    /* filter: drop-shadow(0 0 5px #00ff00); */
    color: #008306;
    filter: invert(28%) sepia(97%) saturate(1106%) hue-rotate(97deg) brightness(96%) contrast(106%);
}

img.rui-logo {
    /* filter: drop-shadow(0 0 5px #bfff00); */
    color: #00fe62;
    filter: invert(60%) sepia(91%) saturate(1014%) hue-rotate(90deg) brightness(110%) contrast(109%);}

img.grom-logo {
    /* filter: drop-shadow(0 0 5px #ff4000); */
    color: #ff4e00;
    filter: invert(37%) sepia(50%) saturate(2993%) hue-rotate(358deg) brightness(98%) contrast(112%);
}

img.archer-logo {
    /* filter: drop-shadow(0 0 5px #ff0000); */
    color: #ff00fe;
    filter: invert(17%) sepia(100%) saturate(2941%) hue-rotate(292deg) brightness(123%) contrast(134%);
}

img.antal-logo {
    /* filter: drop-shadow(0 0 5px #ffff00); */
    color: #fff400;
    filter: invert(90%) sepia(26%) saturate(4121%) hue-rotate(4deg) brightness(110%) contrast(104%);
}

img.kaine-logo {
    color: #cc00ff;
    filter: invert(17%) sepia(100%) saturate(2941%) hue-rotate(292deg) brightness(123%) contrast(134%);
}

img.archon-logo {
    /* filter: drop-shadow(0 0 5px #80ff00); */
    color: #d41213;
    filter: invert(26%) sepia(80%) saturate(4238%) hue-rotate(346deg) brightness(78%) contrast(114%);
}

img.winters-logo {
    /* filter: drop-shadow(0 0 5px #ff8000); */
    color: #ff8c00;
    filter: invert(60%) sepia(33%) saturate(4524%) hue-rotate(360deg) brightness(102%) contrast(106%);
}

img.denton-logo {
    /* filter: drop-shadow(0 0 5px #00ffff); */
    color: #11c9ca;
    filter: invert(79%) sepia(55%) saturate(4516%) hue-rotate(132deg) brightness(96%) contrast(87%);
}

img.zemina-logo {
    /* filter: drop-shadow(0 0 5px #0040ff); */
    color: #004dfe;
    filter: invert(17%) sepia(100%) saturate(3314%) hue-rotate(223deg) brightness(103%) contrast(113%);
}

img.elite-top-score {
    color: #ffffff;
}

.scoring-method {
    font-family: 'Formula1-Bold';
    display: flex;
    align-items: center;
    gap: 10px;
}

.scoring-method select {
    font-family: 'Formula1-Bold';
    background-color: #1a1a1a;
    color: #fff;
    border: 2px solid #333;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    outline: none;
    min-width: 80px;
}

.scoring-method select:hover {
    border-color: #444;
}

.scoring-method select:focus {
    border-color: #666;
}

.scoring-method label {
    color: #fff;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
}

.cycle-select {
    font-family: 'Formula1-Bold';
    display: flex;
    align-items: center;
    gap: 10px;
}

.cycle-select select {
    font-family: 'Formula1-Bold';
    background-color: #1a1a1a;
    color: #fff;
    border: 2px solid #333;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    outline: none;
    min-width: 80px;
}

.cycle-select select:hover {
    border-color: #444;
}

.cycle-select select:focus {
    border-color: #666;
}

.cycle-select label {
    color: #fff;
}

.table-type {
    font-family: 'Formula1-Bold';
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-type select {
    font-family: 'Formula1-Bold';
    background-color: #1a1a1a;
    color: #fff;
    border: 2px solid #333;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    outline: none;
    min-width: 80px;
}

.table-type select:hover {
    border-color: #444;
}

.table-type select:focus {
    border-color: #666;
}

.table-type label {
    color: #fff;
}

/* Rank cell with chevron support */
.rank-cell {
    text-align: center !important;
    padding: 0px !important; /* Reduced from 2px to minimize spacing */
    vertical-align: middle;
}

.rank-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 20px; /* Reduced from 30px to tighten spacing */
}

.rank-number {
    font-family: 'Formula1-Regular', Arial, sans-serif;
    font-size: 1.1em; /* Match the size of score and change text */
    line-height: 0.8; /* Reduced from 1 to tighten vertical spacing */
    color: #ffffff;
    margin: 0;
    padding: 0;
}

.chevron {
    width: 12px; /* Increased from 8px to match larger text */
    height: 9px; /* Increased from 6px to match larger text */
    margin: 0;
    padding: 0;
    /* Color filters are applied in specific chevron-up and chevron-down classes */
}

.chevron-up {
    margin-bottom: 0px; /* Reduced from 1px to tighten spacing */
    filter: invert(28%) sepia(97%) saturate(1106%) hue-rotate(97deg) brightness(96%) contrast(106%); /* Mahon green color */
}

.chevron-down {
    margin-top: 0px; /* Reduced from 1px to tighten spacing */
    filter: invert(26%) sepia(80%) saturate(4238%) hue-rotate(346deg) brightness(78%) contrast(114%); /* Delaine red color */
}

.chevron-placeholder {
    width: 12px; /* Increased from 8px to match larger chevrons */
    height: 9px; /* Increased from 6px to match larger chevrons */
    margin: 0;
    padding: 0;
    /* Empty space to maintain consistent spacing */
}

/* Styles for the Systems Change Table */
#systemsChangeTable {
    margin: 20px auto;
    border-collapse: collapse;
    background-color: #1e1e1e;
    color: #ffffff;
    border: none; /* Remove the outer border of the table */
    font-size: 0.7em;
    text-align: left;
    width: auto; /* Allow table to size based on content or be controlled by a wrapper */
}

#systemsChangeTable th {
    font-family: 'Formula1-Bold', Arial, sans-serif;
    padding: 8px;
    text-align: center;
    background-color: #333; /* Darker background for headers */
}

#systemsChangeTable td {
    padding: 4px 8px;
    border-bottom: none; /* Remove the border between rows */
    text-align: center; /* Center align numbers */
}

#systemsChangeTable td:first-child { /* Power icon column */
    text-align: center;
    width: 20px; /* Fixed width for icon */
}

#systemsChangeTable td:nth-child(2) { /* Power name column */
    text-align: left;
    padding-left: 8px;
}

.positive-change {
    color: #4CAF50; /* Green */
}

.negative-change {
    color: #F44336; /* Red */
}

.no-change {
    color: #a0a0a0; /* Light gray */
}
