@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
}

.container {
    padding: 15px;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 8px;
}

h2 {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 15px;
    text-align: center;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    border: 3px solid #000000;
    table-layout: fixed;
}

th,
td {
    padding: 7px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    text-align: left;
    border: 1px solid #000000 !important;
    box-sizing: border-box;
}

/* Gender row specific styling */
tr:nth-child(2) td[colspan="2"] {
    width: 25%;
    box-sizing: border-box;
    text-align: center;
}

#male-label, #female-label {
    width: 25%;
    box-sizing: border-box;
    text-align: center;
}

tr:nth-child(3) td[colspan="2"] {
    width: 25%;
    box-sizing: border-box;
    text-align: center;
}

tr td[colspan="3"] {
    width: 50%;
    box-sizing: border-box;
}

th {
    background-color: #f4f4f4;
    font-weight: 700;
}

.category {
    font-weight: 700;
    background-color: #e0e0e0;
    text-align: left;
    padding-left: 10px;
}

.tri-state-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 30px;
    background-color: #ddd;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
}

.tri-state-option {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 2;
    transition: color 0.3s;
}

.tri-state-slider {
    position: absolute;
    width: 33.33%;
    height: 100%;
    background-color: #2b6c7c;
    border-radius: 18px;
    transition: left 0.3s ease;
}

.save-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    border-radius: 5px;
}

.save-button:active {
    background-color: #45a049;
}

.tri-state-disabled {
    pointer-events: none;
    opacity: 0.5;
}

.radio-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Updated radio button styling to match slider color */
input[type="radio"] {
    margin: 0;
    transform: scale(1.5);
    cursor: pointer;
    appearance: auto !important;
    -webkit-appearance: auto !important;
    opacity: 1 !important;
    accent-color: #2a6c7c;
}

input[type="radio"]:focus {
    outline: 2px solid #2a6c7c;
    outline-offset: 2px;
}

input[type="radio"]:checked {
    background-color: #2a6c7c;
    border-color: #2a6c7c;
}

/* Gender selection styling */
tr:has(input[type="radio"][value="male"]:checked) td:nth-of-type(4) {
    font-weight: 900;
}

tr:has(input[type="radio"][value="female"]:checked) td:nth-of-type(6) {
    font-weight: 900;
}

/* Border styling for specific rows */
tr:has(td:contains("Halbschuh")) td,
tr:has(td:contains("Weitenauswahl")) td {
    border: 3px solid black !important;
}

#tri-state-width {
    margin: 5px 0;
}

/* Responsive styles */
@media (max-width: 480px) {
    th,
    td {
        font-size: 13px;
        padding: 6px;
    }

    .save-button {
        font-size: 14px;
        padding: 10px;
    }

    .tri-state-container {
        height: 20px;
    }

    .tri-state-option {
        font-size: 11px;
    }
}

#shoe-table tr:nth-last-child(3) td {
    border-top: 1px solid black !important;
}

/* Default styles for gender labels */
#male-label, #female-label {
    font-weight: normal;
}

/* Transitions for smooth visual updates */
#male-label, #female-label {
    transition: font-weight 0.3s ease;
}

/* Additional border consistency rules */
td[colspan="4"] {
    border: 1px solid black !important;
}

td:last-child, th:last-child {
    border-right: 3px solid black !important;
}

table td, table th {
    padding: 7px;
    margin: 0;
}