body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #24292f;
    background-color: #ffffff;
    background-image: url('img/bg-light3.jpg');
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

.dark-mode {
    background-color: #0d1117;
    color: #e6edf3;
    background-image: url('img/bg-dark3.jpg');
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

h1,
h2 {
    margin-bottom: 20px;
}

section {
    background-color: #ffffff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

a {
    color: #0969da;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

label {
    display: inline-block;
    margin-bottom: 10px;
}

button {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #1f883d;
    color: #ffffff;
    font-size: 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 20px;
}

button:hover {
    background-color: #1a7f37;
}

footer {
    text-align: center;
    margin-top: 20px;
    color: #57606a;
}

.dark-mode section {
    background-color: #161b22;
    color: #e6edf3;
    border: 1px solid #30363d;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark-mode a {
    color: #58a6ff;
}

.dark-mode a:hover {
    color: #79c0ff;
}

.dark-mode button {
    background-color: #238636;
    color: #ffffff;
}

.dark-mode button:hover {
    background-color: #2ea043;
}

.dark-mode .floating-points {
    background-color: #161b22;
    color: #e6edf3;
    border: 1px solid #30363d;
}

.section-title {
    background-color: #f6f8fa;
    padding: 10px;
    border-radius: 6px 6px 0 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #d0d7de;
}

.dark-mode .section-title {
    background-color: #21262d;
    border-bottom: 1px solid #30363d;
}

.disclaimer {
    margin-top: 40px;
    font-size: 14px;
    color: #57606a;
}

section > div,
fieldset > div {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

input[type="checkbox"],
input[type="radio"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.checkbox-label {
    display: inline-block;
    margin-left: 8px;
}

.sub-bullet {
    margin-left: 30px;
}

.floating-points {
    position: fixed;
    top: 10%;
    right: 3%;
    width: 20%;
    height: 10%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: clamp(12px, 2vw, 40px);
    background-color: #ffffff;
    border: 1px solid #d0d7de;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 100;
    border-radius: 6px;
    cursor: move;
}

.drag-handle {
    display: grid;
    grid-template-columns: repeat(3, 6px);
    grid-template-rows: repeat(2, 6px);
    gap: 3px;
    padding: 4px 0 2px;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.floating-points:hover .drag-handle {
    opacity: 0.8;
}

.grip-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #57606a;
}

.dark-mode .grip-dot {
    background-color: #8b949e;
}

.points-red {
    background-color: hsl(0, 74%, 49%);
    color: white;
}

.points-yellow-green {
    background-color: hsl(134, 100%, 23%);
    color: white;
}

.points-green {
    background-color: hsl(120, 72%, 14%);
    color: white;
}

.dark-mode .points-red {
    background-color: hsl(0, 74%, 49%);
}

.dark-mode .points-yellow-green {
    background-color: hsl(134, 100%, 16%);
}

.dark-mode .points-green {
    background-color: hsl(120, 68%, 12%);
}

.dark-mode-toggle {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.dark-mode-toggle label {
    margin-right: 10px;
    /* Increased the gap between the text and toggle */
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: #2196F3;
}

input:checked+.toggle-slider:before {
    transform: translateX(26px);
}

.toggle-icons {
    display: flex;
    justify-content: space-between;
    padding: 0 5px;
    color: #fff;
    font-size: 18px;
}

.hosted-by {
    margin-top: 20px;
    text-align: center;
}

.help-text {
    margin-top: 10px;
    margin-left: 20px;
    padding: 12px;
    background-color: #fff8c5;
    border: 1px solid #d4a72c;
    border-left: 4px solid #bf8700;
    border-radius: 6px;
    font-size: 14px;
    color: #4d2d00;
}

.dark-mode .help-text {
    background-color: #3d2e00;
    border: 1px solid #9e6a03;
    border-left: 4px solid #d29922;
    color: #f8e3a1;
}

.dark-mode footer {
    color: #8b949e;
}

.dark-mode .disclaimer {
    color: #8b949e;
}

.dark-mode .hosted-by {
    color: #8b949e;
}

/* ===== FIELDSET RESET ===== */

fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

legend {
    padding: 0;
    width: 100%;
}

legend.section-title {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 20px;
}

/* ===== PROGRESS BAR ===== */

.progress-container {
    margin: 15px 0;
}

.progress-bar-track {
    position: relative;
    width: 100%;
    height: 24px;
    background-color: #e1e4e8;
    border-radius: 12px;
    overflow: visible;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background-color: #cf222e;
    border-radius: 12px;
    transition: width 0.4s ease, background-color 0.4s ease;
    max-width: 100%;
}

.progress-marker {
    position: absolute;
    top: -6px;
    width: 2px;
    height: 36px;
    background-color: #24292f;
    transform: translateX(-50%);
}

.marker-label {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: bold;
    color: #57606a;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #57606a;
    margin-top: 4px;
}

.result-message {
    font-size: 16px;
    font-weight: 600;
    margin: 15px 0;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
}

.result-under-70 {
    background-color: #ffebe9;
    color: #82071e;
    border: 1px solid #ff8182;
}

.result-70-to-79 {
    background-color: #dafbe1;
    color: #116329;
    border: 1px solid #4ac26b;
}

.result-80-plus {
    background-color: #dafbe1;
    color: #044f1e;
    border: 1px solid #2da44e;
}

/* Dark mode variants */
.dark-mode .progress-bar-track {
    background-color: #30363d;
}

.dark-mode .progress-marker {
    background-color: #e6edf3;
}

.dark-mode .marker-label {
    color: #8b949e;
}

.dark-mode .progress-labels {
    color: #8b949e;
}

.dark-mode .result-under-70 {
    background-color: #3d1214;
    color: #ff8182;
    border: 1px solid #6e2b28;
}

.dark-mode .result-70-to-79 {
    background-color: #0d2818;
    color: #56d364;
    border: 1px solid #2ea043;
}

.dark-mode .result-80-plus {
    background-color: #04260f;
    color: #3fb950;
    border: 1px solid #238636;
}

#reset-button {
    background-color: #cf222e;
    margin-top: 10px;
}

#reset-button:hover {
    background-color: #a40e26;
}

.dark-mode #reset-button {
    background-color: #da3633;
}

.dark-mode #reset-button:hover {
    background-color: #f85149;
}

/* ===== PRINT STYLES ===== */

@media print {
    .floating-points,
    .dark-mode-toggle,
    #reset-button,
    .progress-container {
        display: none !important;
    }

    body {
        background-image: none !important;
        background-color: #ffffff !important;
        color: #000000 !important;
    }

    section {
        break-inside: avoid;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}

/* ===== MOBILE RESPONSIVENESS ===== */

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .floating-points {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 50px;
        border-radius: 0;
        font-size: 18px;
        touch-action: none;
        pointer-events: auto;
        flex-direction: row;
    }

    .drag-handle {
        display: none;
    }

    body {
        padding-bottom: 60px;
    }

    section {
        padding: 15px;
    }

    h1 {
        font-size: 1.4em;
    }

    .section-title {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    .checkbox-label {
        font-size: 14px;
    }

    .sub-bullet {
        margin-left: 15px;
    }
}
