/* --- Global Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #f8fafc;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #1E2936;
    padding: 2rem 1rem;
    line-height: 1.5;
}

/* --- Container Form Box --- */
form[action="Results.html"] {
    max-width: 850px;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    padding: 2rem 2.5rem;
}

/* --- Typography & Header --- */
h1 {
    font-size: 2.5rem;
    color: #1E2936;
    text-align: center;
    margin-bottom: 0.5rem;
}

p {
    font-size: 1.1rem;
    color: #64748B;
    text-align: center;
    margin-bottom: 2rem;
}

p strong {
    color: #1E2936;
}

/* --- Table Structure --- */
#questionTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    margin-bottom: 2rem;
}

#questionTable th {
    color: #64748B;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

#questionTable th:last-child {
    text-align: center;
    width: 220px;
}

/* --- Question Row Cards --- */
#questionTable tbody tr {
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

#questionTable tbody tr:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    background-color: #f1f5f9;
    cursor: pointer;
}

#questionTable td {
    padding: 1.1rem 1.25rem;
    border: none;
    vertical-align: middle;
}

#questionTable td:first-child {
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
    font-weight: 600;
    color: #1E2936;
    width: 25%;
}

#questionTable td:nth-child(2) {
    color: #64748B;
    font-size: 1rem;
}

#questionTable td:last-child {
    border-top-right-radius: 15px;
    border-bottom-right-radius: 15px;
    white-space: nowrap;
    text-align: right;
}

/* --- Sliders & Value Badges --- */

span[id$="-val"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 2px 8px;
    border: 2px solid #1E2936;
    border-radius: 15px;
    background-color: #1E2936;
    color: white;
    font-weight: bold;
    font-size: 0.95rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}

/* --- Finish Quiz Button --- */
button[type="submit"] {
    display: block;
    width: 100%;
    background-color: #1E2936;
    color: white;
    padding: 18px;
    border-radius: 15px;
    border: none;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    width: 140px;
    height: 6px;
    background: #64748B;
    border-radius: 999px;
    outline: none;
    vertical-align: middle;
}

/* Circle */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #1E2936;
    border-radius: 50%;
    cursor: pointer;
}


button[type="submit"]:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
    background-color: #64748B;
}

button[type="submit"]:active {
    transform: translateY(0);
}

/* --- Secret Container (All Zeros Trigger) --- */
.secret-box {
    display: none;
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem;
    border: 2px dashed #1E2936;
    border-radius: 15px;
    background-color: #f1f5f9;
}

.secret-box.show {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

.secret-box img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.secret-box p {
    font-size: 1.4rem;
    font-weight: bold;
    color: #1E2936;
    margin-top: 1rem;
    margin-bottom: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Mobile Responsiveness --- */
@media (max-width: 680px) {
    form[action="Results.html"] {
        padding: 1.5rem 1rem;
    }

    #questionTable, thead, tbody, th, td, tr {
        display: block;
    }

    thead {
        display: none;
    }

    #questionTable tbody tr {
        margin-bottom: 1rem;
        padding: 0.5rem;
    }

    #questionTable td {
        padding: 0.5rem 0.75rem;
        text-align: left !important;
        width: 100% !important;
    }

    #questionTable td:last-child {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 0.5rem;
        border-top: 1px solid #e2e8f0;
    }

    input[type="range"] {
        flex-grow: 1;
    }
}

/* --- Keyboard Focus Accessibility --- */

/* Highlight sliders, buttons, and form inputs when tabbed onto */
input[type="range"]:focus-visible,
button[type="submit"]:focus-visible {
    outline: 3px solid #0066FF;
    outline-offset: 4px;
    border-radius: 8px;
}

/* Highlight the whole table row when tabbing into its slider */
#questionTable tbody tr:has(input[type="range"]:focus-visible) {
    outline: 2px solid #0066FF;
    background-color: #f1f5f9;
}