/* Global Styles */
body {
    font-family: Arial, sans-serif;
    background-color: #f7f9fc;
    color: #333;
    padding: 0;
    margin: 0;
}
h1, h2 {
    text-align: center;
    color: #2c3e50;
    margin: 40px 0 30px; /* Increased bottom margin to create more space between title and scale */
}
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}
a {
    color: #3498db;
    text-decoration: none;
}

/* Navigation Bar */
.navbar {
    background-color: #3498db;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Added shadow */
}
.navbar h1 {
    color: #fff;
    margin: 0;
    font-size: 1.5em;
}
.navbar ul {
    list-style-type: none;
    display: flex;
    margin: 0;
}
.navbar ul li {
    margin-left: 20px;
}
.navbar ul li a {
    color: #fff;
    font-size: 1em;
    position: relative; /* For the hover effect */
    transition: color 0.3s;
}
.navbar ul li a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    background: #fff;
    left: 0;
    bottom: -5px;
    transition: width 0.3s;
}
.navbar ul li a:hover {
    color: #e0e0e0; /* Lighter shade on hover */
}
.navbar ul li a:hover::after {
    width: 100%;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin: 20px 0;
    position: relative;
}
.progress-bar-fill {
    height: 20px;
    background-color: #3498db;
    width: 33%; /* Adjusted to match the progress percentage */
    transition: width 0.3s;
}
.progress-bar h3 {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    color: #fff;
    font-size: 1em;
}

/* Vital Sign Styles */
.vital-sign {
    background-color: #fff;
    border-radius: 8px;
    padding: 40px;
    margin: 40px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.vital-sign h3 {
    height: 90px;
    margin-top: 0;
    color: #3498db;
    font-size: 1.8em;
}

/* Scale Styles */
.scale-container {
    position: relative;
    margin: 30px auto 20px auto; /* Adjusted bottom margin to bring the table closer */
    height: 180px;
    width: 100%;
    max-width: 800px;
}
.track {
    position: relative;
    width: 100%;
    height: 12px;
    background: #ccc;
    border-radius: 6px;
    margin: 10px 0; /* Adjusted to create better spacing between scale components */
    cursor: pointer;
    overflow: hidden;
}
.range {
    position: absolute;
    height: 12px;
    border-radius: 6px;
    top: 0;
}

/* Thumb Styles */
.thumb {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 24px solid #fff;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 3;
    transition: border-top-color 0.3s;
}
.thumb:hover {
    border-top-color: #f0f0f0;
}

/* Thumb Levels */
.thumb-severe {
    border-top-color: #e67e22;
    top: -36px;
}
.thumb-moderate {
    border-top-color: #f1c40f;
    top: -54px;
}
.thumb-mild {
    border-top-color: #2ecc71;
    top: -72px;
}

/* Tick Marks */
.tick-container {
    position: absolute;
    width: 100%;
    height: 40px;
    bottom: -20px; /* Reduced value to bring ticks closer to the track */
}
.tick {
    position: absolute;
    width: 2px;
    height: 10px;
    background: #444;
    border-radius: 1px;
    transform: translateX(-50%);
}
.tick.major {
    height: 16px;
    background: #000;
}
.tick-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.8em;
    color: #444;
    top: 12px;
}
.tick-label.major {
    font-weight: bold;
    color: #000;
}

/* Concern Levels */
.concern-levels {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 50px;
}
.concern-level {
    flex: 1;
    text-align: center;
    padding: 15px 0;
    color: #fff;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1em;
    border-radius: 4px;
    margin: 5px;
    opacity: 1;
}
.no-concern { background-color: #2ecc71; }
.mild-concern { background-color: #f1c40f; }
.moderate-concern { background-color: #e67e22; }
.severe-concern { background-color: #e74c3c; }

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
}
.navigation-buttons a button,
.navigation-buttons button {
    padding: 15px 30px;
    font-size: 1em;
    color: #fff;
    background-color: #3498db;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.navigation-buttons a button:hover,
.navigation-buttons button:hover {
    background-color: #2980b9;
}

/* Submit Button */
#submitButton {
    display: block;
    margin: 60px auto;
    padding: 18px 36px;
    font-size: 1.2em;
    color: #fff;
    background-color: #3498db;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}
#submitButton:hover {
    background-color: #2980b9;
}

/* Table Styles */
.threshold-table, .combination-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px; /* Reduced top margin to bring the table closer to the scale */
}
.threshold-table th, .threshold-table td,
.combination-table th, .combination-table td {
    border: 1px solid #ccc;
    padding: 14px;
    text-align: left;
}
.threshold-table th, .combination-table th {
    background-color: #f5f5f5;
    font-weight: 700;
}

/* Part 2 Styles */
#part2Container {
    margin-top: 80px;
}
.combination {
    background-color: #fff;
    border-radius: 8px;
    padding: 40px;
    margin: 40px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.combination h3 {
    margin-top: 0;
    color: #3498db;
    font-size: 1.8em;
}

/* Slider Styles */
.slider-container {
    margin-top: 40px;
    position: relative;
    padding-bottom: 30px;
}

.slider-container label {
    display: block;
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 1em;
    color: #555;
}

/* General Range Input Styles */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #d3d3d3;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
    margin-bottom: 20px;
}

input[type="range"]:hover {
    opacity: 1;
}

/* General Slider Thumb Styles */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover,
input[type="range"]::-moz-range-thumb:hover {
    background: #2980b9;
}

/* Inspired Oxygen Slider Styles */
#inspiredOxygenSlider {
    background: transparent; /* Remove background as we'll set it on the track */
}

#inspiredOxygenSlider::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: linear-gradient(to right, #2ecc71 0%, #2ecc71 2%, #d3d3d3 2%, #d3d3d3 100%);
    border-radius: 5px;
}

#inspiredOxygenSlider::-moz-range-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: linear-gradient(to right, #2ecc71 0%, #2ecc71 2%, #d3d3d3 2%, #d3d3d3 100%);
    border-radius: 5px;
}

/* Customize the thumb for inspired oxygen slider */
#inspiredOxygenSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
    margin-top: -6px; /* Center the thumb on the track */
}

#inspiredOxygenSlider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

/* Hover effect for the thumb */
#inspiredOxygenSlider::-webkit-slider-thumb:hover,
#inspiredOxygenSlider::-moz-range-thumb:hover {
    background: #2980b9;
}

/* Slider Value Display */
.slider-value {
    position: absolute;
    bottom: 0;
    left: 0;
    color: #333;
    font-weight: bold;
    font-size: 1em;
    pointer-events: none;
    opacity: 1;
    transition: left 0.2s;
    transform: translateX(-50%);
}

/* Adjustments for Part 2 and Part 3 */
.combination .slider-container,
.question .slider-container {
    display: block;
    position: relative;
}

/* Ensure the span is visible for Part 2 and Part 3 */
.combination .slider-container span,
.question .slider-container span {
    display: inline-block;
    position: absolute;
    bottom: 0;
    left: 0;
    transform: translateX(-50%);
    color: #333;
    font-weight: bold;
    font-size: 1em;
    pointer-events: none;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .slider-value,
    .combination .slider-container span,
    .question .slider-container span {
        font-size: 0.9em;
    }
}

/* Part 3 Styles */
#part3Container {
    margin-top: 80px;
}
.question-set {
    background-color: #fff;
    border-radius: 8px;
    padding: 40px;
    margin: 40px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.question-set h3 {
    margin-top: 0;
    color: #3498db;
    font-size: 1.8em;
}
.question {
    margin-bottom: 25px;
}
.question label {
    display: block;
    margin-bottom: 10px;
    font-size: 1em;
    color: #555;
}
.question .slider-container {
    display: flex;
    align-items: center;
}
.question .slider-container input[type="range"] {
    flex: 1;
}
.question .slider-container span {
    margin-left: 10px;
    font-weight: bold;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .vital-sign, .question-set, .combination {
        padding: 30px;
    }
    .navbar h1 {
        font-size: 1.2em;
    }
    .navbar ul li {
        margin-left: 10px;
    }
    .navbar ul li a {
        font-size: 0.9em;
    }
}

/* Additional Styles */
.vital-sign {
    margin: 20px;
    padding: 20px;
    border: 1px solid #ccc;
}

.track {
    height: 10px;
    background: #eee;
    margin: 40px 0;
    position: relative;
}

.range {
    height: 100%;
}

.thumb-label-severe { color: #e74c3c; }
.thumb-label-moderate { color: #e67e22; }
.thumb-label-mild { color: #f1c40f; }

.scale-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* Ensure Parent Containers are Positioned Correctly */
.scale-container {
    position: relative;
}
.track {
    position: relative;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .thumb-label {
        top: -70px;
    }
    .concern-levels {
        flex-direction: column;
    }
    .concern-level {
        margin: 5px 0;
    }
}

.slider-container {
    position: relative;
    margin: 40px 0;
    padding-bottom: 40px;
}

.concern-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    outline: none;
    margin: 20px 0;
    padding: 0;
}

.concern-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    outline: none;
    margin: 20px 0;
    padding: 0;
}
.concern-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, 
        #2ecc71 0%,      /* Pure green at 0 */
        #2ecc71 8.33%,   /* Stay green until ~1.25 */
        #a7d62e 16.67%,  /* Transition at 2.5 (midpoint) */
        #f1c40f 33.33%,  /* Pure yellow at 5 */
        #f1c40f 41.67%,  /* Stay yellow until ~6.25 */
        #f39c12 50%,     /* Transition at 7.5 (midpoint) */
        #e67e22 66.67%,  /* Pure orange at 10 */
        #e67e22 75%,     /* Stay orange until ~11.25 */
        #e74c3c 83.33%,  /* Transition at 12.5 (midpoint) */
        #e74c3c 100%     /* Pure red at 15 */
    );
}

.concern-slider::-moz-range-track {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, 
        #2ecc71 0%,      /* Pure green at 0 */
        #2ecc71 8.33%,   /* Stay green until ~1.25 */
        #a7d62e 16.67%,  /* Transition at 2.5 (midpoint) */
        #f1c40f 33.33%,  /* Pure yellow at 5 */
        #f1c40f 41.67%,  /* Stay yellow until ~6.25 */
        #f39c12 50%,     /* Transition at 7.5 (midpoint) */
        #e67e22 66.67%,  /* Pure orange at 10 */
        #e67e22 75%,     /* Stay orange until ~11.25 */
        #e74c3c 83.33%,  /* Transition at 12.5 (midpoint) */
        #e74c3c 100%     /* Pure red at 15 */
    );
}


.concern-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid #333;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.concern-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 2px solid #333;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.tick-marks {
    position: absolute;
    width: calc(100% - 20px);  /* Account for thumb width */
    height: 30px;
    left: 10px;  /* Half of thumb width */
    margin-top: -10px;  /* Position below the slider */
}

.tick {
    position: absolute;
    width: 1px;
    height: 8px;
    background: #888;
    transform: translateX(-50%);
}

.tick.major {
    height: 12px;
    width: 2px;
    background: #444;
}

.tick-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: 12px;
    color: #666;
    top: 14px;
    white-space: nowrap;
}

.tick-label.major {
    font-weight: bold;
    color: #444;
}

.concern-descriptions {
    margin-bottom: 20px;
}

.concern-descriptions p {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}