.bodyfat-card {
    max-width: 1000px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0ebff 100%);
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex-wrap: wrap;
    padding: 3rem;
}

/* Method Selection */
.bodyfat-method-selection {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 1rem;
}

.method-btn {
    padding: 0.9rem 4rem;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-weight: 500;
    text-transform: uppercase;
    color: #000;
    font-family: "Roboto Slab", serif;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.method-btn.active {
    background: linear-gradient(135deg, #0F2BC9 0%, #667eea 100%);
    color: #fff;
}

/* Card content: inputs on left, chart on right */
.bodyfat-card-content {
    display: flex;
    gap: 3rem;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
}

/* Left side: Inputs */
.bodyfat-inputs-left {
    flex: 1;
    min-width: 280px;
}

.bodyfat-chart-right {
    flex: 1;
    min-width: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.bodyfat-input-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    flex-direction: column;
}

.bodyfat-input-field {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    flex: 1;
}

.bodyfat-input-field label {
    font-weight: 600;
    margin-bottom: 5px;
    margin-top: 15px;
}

.bodyfat-input-field input {
    width: 100%;
    padding: 13px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-weight: 400;
    font-family: "Roboto Slab", serif;
    font-size: 1rem;
    box-sizing: border-box;
}

/* Custom gender select */
.bodyfat-custom-select {
    position: relative;
    width: 100%;
}

.select-selected {
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 13px 12px;
    font-weight: 400;
    font-family: "Roboto Slab", serif;
    font-size: 1rem;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.select-selected:after {
    content: "\25BC";
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.select-items {
    position: absolute;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 999;
    display: none;
    max-height: 150px;
    overflow-y: auto;
}

.select-items div {
    padding: 10px;
    cursor: pointer;
    font-weight: 400;
}

.select-items div:hover {
    background-color: #f0f4ff;
}

.select-items.show {
    display: block;
}

.select-arrow-active:after {
    transform: translateY(-50%) rotate(180deg);
}

/* Extra fields (Neck & Waist) */
.bf-extra-fields {
    display: flex;
    gap: 2rem;
}

.ada-hidden .bf-extra-fields {
    display: none;
}

/* Calculate Button */
.bodyfat-calc-btn-container {
    display: flex;
    justify-content: flex-start;
    margin-top: 20px;
}

.calculate-btn {
    padding: 1rem 3rem;
    background: linear-gradient(135deg, #0F2BC9 0%, #667eea 100%);
    text-transform: uppercase;
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
    font-family: "Roboto Slab", serif;
    transition: background 0.3s ease;
}

.calculate-btn:hover {
    transform: translateY(1px);
}

/* Gauge Chart Container */
.bodyfat-chart-container {
    max-width: 300px;
    width: 100%;
    position: relative;
    text-align: center;
    margin: 50px auto;
}

.bodyfat-value-display {
    position: absolute;
    top: 70%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.3rem;
    font-weight: 400;
    color: #000;
    text-align: center;
    pointer-events: none;
}

/* Chart Legend */
.bodyfat-gauge-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.bodyfat-gauge-legend.two-rows {
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-content: center;
    gap: 1rem 2rem;
    margin-top: -5rem;
}

.bodyfat-gauge-legend div {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
    font-size: 1rem;
}

.bodyfat-gauge-legend .dot {
    height: 15px;
    width: 15px;
    border-radius: 50%;
    display: inline-block;
}

/* Chart Dots Colors */
.dot-athletes {
    background-color: #28a745;
}

.dot-fitness {
    background-color: #17a2b8;
}

.dot-average {
    background-color: #ffc107;
}

.dot-obese {
    background-color: #dc3545;
}

/* Body Fat Result Section */
.bodyfat-result {
    max-width: 900px;
    margin: 2rem auto 0 auto;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.bodyfat-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.bodyfat-value-message {
    font-size: 1.6rem;
    font-weight: 500;
    font-family: "Roboto Slab", serif;
}

.bodyfat-value {
    margin-right: 0.3rem;
}

.bodyfat-category {
    margin-left: 0.3rem;
}

.bodyfat-message {
    font-size: 1.1rem;
    font-weight: 500;
    font-family: "Roboto Slab", serif;
    color: #555;
    margin: 0;
}

.bodyfat-action-plan {
    width: 100%;
    margin-top: 1rem;
}

.bodyfat-tips-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    margin-top: -3px;
    font-size: 1.3rem;
    font-weight: 500;
    font-family: "Roboto Slab", serif;
    text-align: center;
}

.bodyfat-tip {
    font-size: 1.3rem;
    font-weight: 600;
    text-align: center;
}

#bfTipsRow1,
#bfTipsRow2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    color: #333;
    margin-top: 6px;
    padding: 6px 8px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

#bfTipsRow1 span,
#bfTipsRow2 span {
    color: inherit;
    font-weight: 600;
}

/* Input adjustments */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

.formula-block-fat {
    font-weight: bold;
    font-size: 1.1rem;
    background: #f0f4ff;
    width: auto;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
}

/* Responsive Media Queries */
@media (max-width: 991px) {
    .bodyfat-card {
        max-width: 900px;
        padding: 3rem;
        gap: 1.5rem;
    }

    .bodyfat-result {
        max-width: 800px;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .bodyfat-card {
        max-width: 560px;
        padding: 2.5rem;
        gap: 1.5rem;
    }

    .bodyfat-method-selection {
        flex-direction: column;
    }

    .bodyfat-card-content {
        flex-direction: row;
        gap: 2rem;
        flex-wrap: wrap;
    }

    .bodyfat-result {
        max-width: 550px;
        padding: 2rem;
    }

    .bodyfat-value-message {
        font-size: 1.5rem;
    }

    .bodyfat-message {
        font-size: 1rem;
    }
}

@media (max-width: 450px) {
    .bodyfat-card {
        max-width: 400px;
        padding: 2.5rem;
        gap: 1.5rem;
    }

    .bodyfat-chart-container {
        max-width: 250px;
        width: 100%;
        position: relative;
        text-align: center;
        margin: 10px auto;
    }

    .bodyfat-result {
        max-width: 400px;
        padding: 2rem;
    }

    .bodyfat-gauge-legend.two-rows {
        gap: 1rem 2rem;
        margin-top: -1rem;
    }

    .bodyfat-value-display {
        font-size: 1.05rem;
    }

    .bodyfat-value-message {
        font-size: 1.2rem;
    }

    .bodyfat-message {
        font-size: 0.9rem;
    }

    .formula-block-fat {
        font-weight: bold;
        font-size: 0.9rem;
    }

    .bodyfat-gauge-legend div {
        font-size: 0.95rem;
    }

    #bfTipsRow1,
    #bfTipsRow2 {
        display: flex;
        justify-content: flex-end;
        align-items: flex-start;
        flex-direction: column;
        font-size: 0.9rem;
        padding: 6px 8px;
        gap: 2px;
    }

    #bfTipsRow1 span,
    #bfTipsRow2 span {
        color: inherit;
        font-weight: 600;
        font-size: 1.4rem;
        margin-top: 1px;
    }
}

@media (max-width: 365px) {
    .bodyfat-card {
        max-width: 350px;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .bodyfat-chart-container {
        max-width: 200px;
        width: 100%;
        position: relative;
        text-align: center;
        margin: 10px auto;
    }

    .bodyfat-result {
        max-width: 340px;
        padding: 2rem;
    }

    .bodyfat-gauge-legend.two-rows {
        gap: 1rem 2rem;
        margin-top: -1rem;
    }

    .bodyfat-value-display {
        font-size: 1rem;
    }

    .bodyfat-gauge-legend div {
        font-size: 0.8rem;
    }

    .bodyfat-value-message {
        font-size: 1.2rem;
    }

    .bodyfat-message {
        font-size: 0.9rem;
    }

    .formula-block-fat {
        font-weight: bold;
        font-size: 0.9rem;
    }

    #bfTipsRow1,
    #bfTipsRow2 {
        display: flex;
        justify-content: flex-end;
        align-items: flex-start;
        flex-direction: column;
        font-size: 0.8rem;
        padding: 6px 8px;
        gap: 2px;
    }

    #bfTipsRow1 span,
    #bfTipsRow2 span {
        color: inherit;
        font-weight: 600;
        font-size: 1.1rem;
        margin-top: 1px;
    }
}