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

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

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

* {
    box-sizing: border-box;
}

body {
    background-color: #1F1F1E;
    color: #dee0e3;
    margin: 0;
    font-family: 'Poppins', sans-serif;
}

.container {
    margin: 0;
    display: grid;
    justify-items: center;
    width: 100%;
    min-width: 0;
}

.row {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.filter-label {
    text-align: center;
    align-self: center;
    font-size: 12px;
}

.upload-box {
    width: 100vw;
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;

    background-image: url('../images/creative.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.upload-box input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 4;
}

.upload-box span {
    position: relative; 
    font-size: 16px;
    font-weight: bold;
    color: black;
    pointer-events: none; 
    text-align: center;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-box::before {
    content: "";
    position: absolute;
    inset: 0;

    background-image: url('../images/logo_no_background_text_1.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: 240px auto;

    opacity: 1;
    transition: opacity 0.3s ease;

    z-index: 1;
}

.upload-box::after {
    content: "";
    position: absolute;
    inset: 0;

    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;

    z-index: 2;
}

.upload-box:hover::before {
    opacity: 0;
}

.upload-box:hover span {
    opacity: 1;
}

.upload-box:hover::after {
    background: rgba(0, 0, 0, 0.4);
}

.upload-box.dragging::before {
    background: rgba(0, 0, 0, 0.4);
}

#description-container {
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    width: 100%;
    max-width: 735px;
    background-color: white;
    color: black;
    border-radius: 10px;
    text-align: left;
}

.description {
    line-height: 1.5;
    font-size: 16px;
    margin: 5px;
}

.description-list {
    line-height: 1.5;
    font-size: 14px;
    margin: 5px;
}

#player-database-container {
    box-sizing: border-box;
    height: 800px;
    width: 100%;
    max-width: 759px;
    min-width: 351px;

    background-color: white;
    color: black;
    border-radius: 12px;
    padding: 12px;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}

.csvTable-container {
    width: 100%;
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;
}

.csvTable-container::-webkit-scrollbar {
    width: 12px;
}

.csvTable-container::-webkit-scrollbar-track {
    border-radius: 10px;
    background-color: #dee0e3
}

.csvTable-container::-webkit-scrollbar-thumb {
    background: #dee0e3;
    border-radius: 10px;
    border: 2px solid #1F1F1E;
}

.csvTable-container::-webkit-scrollbar-thumb:hover {
    background: #b0b3b6;
}

.loading-spinner {
    width: 300px;
    height: 300px;
    margin: 20px auto;
    display: block;

    animation: spin 1s linear infinite;
}

.loading-text {
    font-family: 'Pacifico', cursive;
    font-size: 36px;
    color: #dee0e3;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #dee0e3;
    width: 0;
    display: inline-block;
}

.loading-text.loading {
    animation: typing 2s steps(20, end) infinite,
                blink 0.8s infinite;
}

.loading-text.error {
    animation: typing 2s steps(20, end) 1 forwards,
                blink 0.8s infinite;
}

@keyframes typing {
    from { width: 0;}
    to { width: 20ch;}
}

@keyframes blink {
    50% {border-color: transparent;}
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#result {
    width: 500px;
    height: 500px;
}

.filter-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    align-items: start;
}

.dropdown {
    position: relative;
    width: 100%;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
}

.dropdown-menu.show {
    display: block;
}

.player-database-table-controls {
    width: 100%;
    flex-shrink: 0;

    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.filter-group label {
    font-size: 15px;
    font-weight: 600;
}

.filter-group input:not([type="range"]), 
.filter-group select, 
#position-toggle {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #cccccc;
    font-family: 'Poppins', sans-serif;
    background: white;
    cursor: pointer;
    height: 36px;
    min-width: 0;
    box-sizing: border-box;
    color: black;
}

#position-toggle {
    text-align: center;
    background: white;
    font-size: 12px;
}

#player-search {
    font-size: 12px;
    text-align: center;
}

#position-toggle::after {
    content: "▼";
    float: right;
    font-size: 12px;
}

#position-options input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    gap: 6px;
}

.checkbox-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-item label:hover .checkbox-box {
    border-color: #136d19;
}

.checkbox-box {
    width: 16px;
    height: 16px;
    border: 2px solid #888;
    border-radius: 4px;
    background: white;

    display: inline-block;
    position: relative;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.checkbox-item input[type="checkbox"]:checked + label .checkbox-box {
    background-color: #136d19;
    border-color: #136d19;
}

.checkbox-item input[type="checkbox"]:checked + label .checkbox-box::after {
    content: "";
    position: absolute;

    left: 50%;
    top: 50%;

    width: 5px;
    height: 10px;

    border: solid white;
    border-width: 0 2px 2px 0;

    transform: translate(-50%, -55%) rotate(45deg);
}

.slider-container {
    position: relative;
    width: 100%;
    height: 40px;
}

.slider-container input[type="range"] {
    position: absolute;
    width: 100%;
    /* top: 50%; */
    height: 40px;
    margin: 0;
    background: none;
    appearance: none;
    -webkit-appearance: none;
    pointer-events: none;
}

.slider-container input[type="range"]::-webkit-slider-runnable-track {
    background: transparent;
}

.slider-container input[type="range"]::-moz-range-track {
    background: transparent;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #136d19;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: transform 0.08s ease;
    pointer-events: all;
}

.slider-container input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.2);
}

.slider-container input[type="range"]::-moz-range-thumb:active {
    transform: scale(1.2);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #136d19;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.08s ease;
    pointer-events: all;
}

.slider-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: #ddd;
    transform: translateY(-50%);
    border-radius: 3px;
}

.slider-range {
    position: absolute;
    top: 50%;
    height: 6px;
    background: #136d19;
    transform: translateY(-50%);
    border-radius: 3px;
}

.slider-values {
    text-align: center;
    width: 100%;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #888;
}

#csvTable {
    table-layout: fixed;
    border-collapse: collapse;

    width: 100%;
    max-width: 759px;
    font-size: clamp(10px, 2vw, 16px);
}

#csvTable thead th {
    position: sticky;
    top: 0;
    z-index: 2;

    background-color: white;
    box-shadow: inset 0 -2px 0 black;
    font-size: clamp(12px, 2.2vw, 18px);
}

#csvTable td {
    border-bottom: 1px solid black;
    padding: 5px 5px;
}

.player-image {
    width: clamp(40px, 7vw, 75px);
    height: auto;
}

.award-image {
    width: clamp(25px, 5vw, 50px);
    height: auto;
    cursor: help;
}

#csvTable tr:hover {
    background-color: #f5f5f5;
}

#results-table-container {
    overflow-y: auto;
    overflow-x: auto;
    width: 500px;
    min-width: 0;
    background-color: white;
    color: black;
    border-radius: 10px;
    padding: 10px;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
}

#results-table {
    width: 100%;
    border-collapse: collapse;
}

#results-table td {
    padding: 5px 5px;
}

#results-table:has(tr:nth-child(2)) td {
    border-bottom: 1px solid black;
}

@media (max-width: 650px) {
    .player-database-table-controls {
        flex-direction: column;
        width: 100%;
    }

    .filter-group {
        width: 100%;
    }
}
