/* Dropdown menu styles */
select{
    padding: 12px 18px;
    border: none;
    cursor: pointer;
    background-color: var(--color-dropdown-base);
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.09); /* Subtle shadow */
}

select:hover {
    background-color: var(--color-dropdown-hover); /* Slightly darker on hover */
}

#chapter-select {
    margin-bottom: 40px; /* give space for dropdown expansion */
}

/*  Custom Dropdowns */
.dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: fit-content;
    font-size: var(--font-size-med);
}

/*  Makes it look like a dropdown */
.dropdown button{
    padding: var(--height-button) var(--width-button);
    border: none;
    cursor: pointer;
    background-color: var(--color-dropdown-base);
    color: var(--color-font-primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.09); /* Subtle shadow */
    min-width: 200px;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

.dropdown .alt-color{
    background-color: var(--color-dropdown-base);
}

.dropdown button:hover,
.dropdown button:active {
    background-color: var(--color-dropdown-hover);
    transform: none !important;
}

.dropdown button:hover + .dropdown-content{
    background-color: var(--color-dropdown-hover);
}

.dropdown-content {
    display : block;
    position: absolute;
    max-height: var(--height-max-dropdown);

    font-size: var(--font-size-med);
    font-weight: bold;

    box-sizing: border-box;

    width: 100%;
    min-width: 100%;
    max-width: max-content;
    
    margin-top: 4px;
    padding: 8px; 

    background: var(--color-dropdown-base);
    border: 1px solid #ccc;
    border-radius: var(--border-radius-lg);
    
    overflow-y: auto;
    scrollbar-width: none;

    z-index: 10;
    text-align: center;

    opacity: 0;
    transform: scaleY(0);
    transform-origin: top;
    transition: 
        opacity 0.5s ease, 
        transform 0.5s ease;
}

.dropdown.narrow .dropdown-trigger{
    min-width: var(--width-dropdown-narrow);
    width: var(--width-dropdown-narrow);
}

.nav-dropdown .dropdown-content{
    width: max-content;
    min-width: max-content;
}

.dropdown-content::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.dropdown.open .dropdown-content {
    opacity: 1;
    transform: scaleY(1);
}

.custom-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding:  calc(var(--height-button) * 0.6) 4px;
    cursor: pointer;
    border-radius: 4px;
    flex-direction: row;
}

.custom-option:hover {
    background-color: var(--color-dropdown-hover);
}

.custom-option input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    
    flex-shrink: 0;

    border: 2px solid var(--color-check-border);
    border-radius: 4px;
    background: var(--color-check-bg);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.custom-option input[type="checkbox"]::after {
    content: "";
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: transform 0.15s ease-out;
    clip-path: polygon(14% 44%, 0% 65%, 50% 100%, 100% 0%, 82% 0%, 45% 62%);
    background: var(--color-checkmark);
}

.custom-option input[type="checkbox"]:checked {
    background-color: var(--color-check-bg-checked);
    border-color: var(--color-check-bg-checked);
}

.custom-option input[type="checkbox"]:checked::after{
    transform: scale(1);
}

.custom-option span {
    font-weight: bold;
    font-size: 15px;
}

#nav-toggle {
    min-width: var(--header-height);
    min-height: var(--header-height);
    padding:0px;
}

.nav-item {
    font-family: var(--font-serif);
    font-size: var(--font-size-base);
    color: var(--color-font-primary);
    white-space: nowrap;
}

/*      =======================================     */
/*      2. SCOREBOARD, LEADERBOARD & GAME ELEMENTS  */
/*      =======================================     */

/* Text Box */
#verses p {
    margin-block: 0.5em;
}

#verses p:first-child {
    margin-block-start: 0;
}

#leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-family:Arial, sans-serif;
    font-size:1rem;
}

#leaderboard-table th {
    background-color: rgba(0,0,0,0.1);
    padding: 10px;
}

#leaderboard-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(0,0,0,0.15);
}

#leaderboard-table tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.05);
}

#leaderboard-table tr:hover {
    background-color: rgba(0,0,0,0.1);
}

#lb-book-ladder,
#lb-difficulty-ladder {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

#lb-book-ladder button,
#lb-difficulty-ladder button {
    width: 100%;
}

#scoreboard {
    text-align: center;
    margin-top: 20px;
}

.runner {
    width: var(--size-runner);
    height: var(--size-runner);
    background: #ff4444;
    border-radius: 50%;
    position: absolute;
    transition: left var(--runner-animation-time) ease, top var(--runner-animation-time) ease;
    z-index: 1;
}

#diamond {
    position: relative;
    top: 0;
    width: clamp(100px, 40vw, 400px);
    aspect-ratio: 1 / 1;
    max-width: 600px;
    max-height: 600px;
    margin-top: 0;
    background: #6fd08cff;;
}

/* Baseball base elements (first, second, third, home) */
.base {
    width: clamp(20px, var(--size-base), 75px);
    aspect-ratio: 1 / 1;

    background: #ffcf88;
    border: 2px solid #000;
    position: absolute;
    transform: rotate(45deg);
    z-index: 0;
}

#strike-boxes {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.strike-box {
    width: var(--strike-box-size);
    height: var(--strike-box-size);
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 6rem;
    font-weight: bold;
    color: red;
}
