﻿:root {
    --primary-blue: rgb(0, 64, 128);
    --bg-white: rgb(255, 255, 255);
    --row-odd: rgb(240, 248, 255);
    --border-color: rgb(70, 180, 220);
    --table-border: rgb(0, 64, 128);
    --focus-bg: rgb(220, 255, 225);
    --male-bg: rgb(64, 156, 255);
    --male-border: rgb(0, 90, 180);
    --female-bg: rgb(199, 21, 133);
    --female-border: rgb(139, 0, 139);
    --yes-bg: rgb(30, 70, 120);
    --yes-border: rgb(0, 90, 180);
    --no-bg: rgb(30, 120, 50);
    --no-border: rgb(46, 125, 50);
    --gender-text: rgb(255, 255, 255);
    --gender-unselected-bg: rgb(245, 245, 245);
    --error-red: rgb(220, 53, 69);
    --success-bg: rgb(200, 240, 220);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-white);
    padding: 10px;
    padding-bottom: 120px;
    color: var(--primary-blue);
    line-height: 1.4;
}

.thyroid-container {
    max-width: 1000px;
    margin: 0 auto;
    margin-bottom: 500px;
    background-color: rgb(205, 235, 245);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 2px solid var(--table-border);
    overflow: hidden;
}

.thyroid-header {
    background-color: rgb(50, 110, 130);
    color: white;
    padding: 15px;
    text-align: center;
}

    .thyroid-header h1 {
        font-size: 1.4rem;
        margin: 0;
        color: white;
    }

.thyroid-main {
    padding: 15px;
}

.thyroid-form {
    display: grid;
    gap: 12px;
}

@media (min-width: 769px) {
    .thyroid-form {
        grid-template-columns: 1fr 1fr;
        grid-template-areas: "gender pregnant" "age tsh" "ft3 ft4" "hgb hct" "weight height" "cold-extremities rough-dry-skin" "excessive-sleep puffy-face" "cognitives constipation" "weight-gain hair-loss";
        gap: 15px;
    }

    .area-gender {
        grid-area: gender;
    }

    .area-pregnant {
        grid-area: pregnant;
    }

    .area-age {
        grid-area: age;
    }

    .area-tsh {
        grid-area: tsh;
    }

    .area-ft3 {
        grid-area: ft3;
    }

    .area-ft4 {
        grid-area: ft4;
    }

    .area-hgb {
        grid-area: hgb;
    }

    .area-hct {
        grid-area: hct;
    }

    .area-weight {
        grid-area: weight;
    }

    .area-height {
        grid-area: height;
    }

    .area-puffy-face {
        grid-area: puffy-face;
    }

    .area-Cognitives {
        grid-area: cognitives;
    }

    .area-Constipation {
        grid-area: constipation;
    }

    .area-rough-dry-skin {
        grid-area: rough-dry-skin;
    }

    .area-excessive-sleep {
        grid-area: excessive-sleep;
    }

    .area-weight-gain {
        grid-area: weight-gain;
    }

    .area-cold-extremities {
        grid-area: cold-extremities;
    }

    .area-HairLoss {
        grid-area: hair-loss;
    }

    .input-group:not(.area-gender):not(.area-symptom):not(.area-pregnant) {
        padding: 5px 12px;
        min-height: 70px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

        .input-group:not(.area-gender):not(.area-symptom):not(.area-pregnant) label {
            font-size: 14px;
            margin-bottom: 2px;
            font-weight: 600;
            color: var(--primary-blue);
        }

        .input-group:not(.area-gender):not(.area-symptom):not(.area-pregnant) input[type="text"] {
            font-size: 22px;
            height: 35px;
            width: 100%;
            border: none;
            background: transparent;
            font-weight: bold;
            color: var(--primary-blue);
            outline: none;
        }
}

@media (max-width: 768px) {
    .thyroid-form {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .input-group:not(.area-gender):not(.area-symptom):not(.area-pregnant) {
        padding: 15px;
        min-height: 100px;
    }

        .input-group:not(.area-gender):not(.area-symptom):not(.area-pregnant) label {
            font-size: 18px;
            margin-bottom: 8px;
        }

        .input-group:not(.area-gender):not(.area-symptom):not(.area-pregnant) input[type="text"] {
            font-size: 28px;
            height: 45px;
        }
}

.area-gender, .area-symptom {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
    min-height: 70px;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 5px;
}

.area-HairLoss {
    min-height: 70px;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 5px;
}

.area-gender:focus-within, .area-symptom:focus-within {
    border-color: rgb(40, 167, 69);
    background-color: var(--focus-bg);
}

.input-group.invalid {
    border-color: var(--error-red) !important;
    background-color: rgb(255, 245, 245) !important;
    padding-bottom: 22px !important;
}

@media (min-width: 769px) {
    .area-gender label, .area-symptom label {
        flex: 0 0 48%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        font-size: 14px;
        font-weight: 600;
        color: var(--primary-blue);
        text-align: left;
        margin: 0;
        padding-right: 15px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        line-height: 1.3;
        height: 100%;
        min-height: 40px;
    }

    .gender-options, .symptom-options {
        flex: 0 0 48%;
        display: flex;
        gap: 10px;
        justify-content: flex-end;
        height: 100%;
        align-items: center;
    }

    .gender-option, .symptom-option {
        flex: 1;
        max-width: calc(50% - 5px);
        position: relative;
    }

        .gender-option input[type="radio"], .symptom-option input[type="radio"] {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }

    .gender-label, .symptom-label {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
        height: 40px !important;
        background: var(--gender-unselected-bg) !important;
        border: 2px solid rgb(180, 180, 180) !important;
        border-radius: var(--radius) !important;
        color: rgb(80, 80, 80) !important;
        cursor: pointer !important;
        font-weight: 600 !important;
        font-size: 16px !important;
        transition: all 0.2s ease !important;
        line-height: 1 !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

@media (max-width: 768px) {
    .area-gender, .area-symptom, .area-HairLoss {
        min-height: 120px;
        padding: 15px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

        .area-gender label, .area-symptom label {
            font-size: 16px;
            font-weight: 600;
            color: var(--primary-blue);
            margin-bottom: 15px;
            text-align: left;
            width: 100%;
            word-wrap: break-word;
            overflow-wrap: break-word;
            white-space: normal;
            line-height: 1.3;
        }

    .gender-options, .symptom-options {
        display: flex;
        gap: 15px;
        width: 100%;
        justify-content: space-between;
    }

    .gender-option, .symptom-option {
        flex: 1;
        max-width: 45%;
        position: relative;
    }

        .gender-option input[type="radio"], .symptom-option input[type="radio"] {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }

    .gender-label, .symptom-label {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        width: 100% !important;
        height: 60px !important;
        background: var(--gender-unselected-bg) !important;
        border: 2px solid rgb(180, 180, 180) !important;
        border-radius: var(--radius) !important;
        color: rgb(80, 80, 80) !important;
        cursor: pointer !important;
        font-weight: 600 !important;
        font-size: 18px !important;
        transition: all 0.2s ease !important;
        line-height: 1 !important;
        padding: 0 !important;
        margin: 0 !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    }
}

input[type="radio"]:checked + .male-label {
    background: var(--male-bg) !important;
    border-color: var(--male-border) !important;
    color: var(--gender-text) !important;
}

input[type="radio"]:checked + .female-label {
    background: var(--female-bg) !important;
    border-color: var(--female-border) !important;
    color: var(--gender-text) !important;
}

input[type="radio"]:checked + .yes-label {
    background: var(--yes-bg) !important;
    border-color: var(--yes-border) !important;
    color: var(--gender-text) !important;
}

input[type="radio"]:checked + .no-label {
    background: var(--no-bg) !important;
    border-color: var(--no-border) !important;
    color: var(--gender-text) !important;
}

.input-group {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: background-color 0.2s, border-color 0.2s;
    position: relative;
}

    .input-group:focus-within {
        border-color: rgb(40, 167, 69);
        background-color: var(--focus-bg);
    }

    .input-group input[type="text"] {
        width: 100%;
        border: none;
        background: transparent;
        font-weight: bold;
        color: var(--primary-blue);
        outline: none;
        padding-right: 10px;
        opacity: 1;
        -webkit-text-fill-color: var(--primary-blue);
    }

.area-pregnant {
    border: 2px solid var(--border-color);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    border-radius: var(--radius);
    position: relative;
    padding: 10px 15px;
}

    .area-pregnant .checkbox-option {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        gap: 15px;
    }

    .area-pregnant input[type="checkbox"] {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
        accent-color: var(--female-bg);
        cursor: pointer;
    }

    .area-pregnant .checkbox-option label {
        font-size: 18px;
        font-weight: 600;
        color: var(--primary-blue);
        cursor: pointer;
        margin: 0;
        text-align: center;
        display: flex;
        align-items: center;
    }

    .area-pregnant::before {
        content: "Check if Pregnant";
        position: absolute;
        top: 8px;
        left: 12px;
        font-size: 14px;
        font-weight: 600;
        color: var(--primary-blue);
    }

@media (max-width: 768px) {
    .area-pregnant {
        min-height: 100px;
        padding: 15px;
    }

        .area-pregnant::before {
            font-size: 16px;
            top: 15px;
            left: 15px;
        }

        .area-pregnant input[type="checkbox"] {
            width: 35px !important;
            height: 35px !important;
            min-width: 35px !important;
            min-height: 35px !important;
        }

        .area-pregnant .checkbox-option label {
            font-size: 20px;
        }
}

.field-hint {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 13px;
    font-weight: 500;
    color: rgb(100, 100, 100);
    pointer-events: none;
}

.text-danger, .input-error {
    display: block;
    position: absolute;
    bottom: 2px;
    left: 12px;
    right: 12px;
    background: transparent !important;
    border: none !important;
    font-size: 12px !important;
    color: var(--error-red);
    font-weight: bold;
    text-align: right;
    pointer-events: none;
    white-space: nowrap;
    z-index: 5;
}

@media (max-width: 768px) {
    .text-danger, .input-error {
        bottom: 4px;
        font-size: 13px !important;
    }
}

.action-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: transparent;
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    pointer-events: none;
}

.btn {
    pointer-events: auto;
    flex: 1;
    max-width: 200px;
    padding: 12px;
    border: none;
    border-radius: var(--radius);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.btn-primary {
    background-color: var(--primary-blue);
    color: rgb(255, 255, 0);
    order: 2;
}

.btn-secondary {
    background-color: rgba(60, 90, 80, 0.9);
    color: white;
    order: 1;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
}

    .btn-secondary:hover {
        background-color: rgba(60, 90, 80, 1);
    }

.result-container {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: var(--radius);
    background-color: var(--success-bg);
    border: 2px solid rgb(25, 135, 84);
}

.dosage-info {
    text-align: left;
    padding: 1rem;
}

    .dosage-info strong {
        color: rgb(0, 64, 128) !important;
        display: block;
        margin-bottom: 0.5rem;
        font-size: 1.1rem;
    }

.badge-dose {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: bold;
    margin: 0 0.25rem;
    transition: all 0.3s ease;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 1.5rem;
}

.badge-dose-normal {
    background-color: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.badge-dose-high {
    background: linear-gradient(135deg, #87ceeb, #4169e1);
    color: white;
    border: 2px solid #1e90ff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.badge-dose-low {
    background: linear-gradient(135deg, #ffb347, #ff8c00);
    color: white;
    border: 2px solid #ff9500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.area-HairLoss.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden !important;
}
