/* =========================
   Radboud University style
   ========================= */

/* ---------- Variables ---------- */

:root {
    --ru-red: #e3000b;          /* Red Impact */
    --ru-red-dark: #be311e;     /* Lady Bug */
    --ru-gray: #797777;
    --ru-gray-dark: #494949;
    --ru-bg: #fff5f3;
    --ru-surface: #ffffff;
    --ru-white: #ffffff;
    --ru-border: #e9d8d6;
}

/* ---------- Reset / base ---------- */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #faf7f5;
    color: #1f1f1f;
    font-family: "Open Sans", Arial, Helvetica, sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

/* ---------- Layout ---------- */

main {
    max-width: 760px;
    margin: 2rem auto 4rem;
    padding: 0 1.5rem;
}

header {
    margin-bottom: 1.25rem;
}

#brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 1.5rem 1.5rem;
    border-radius: 24px;
    background: var(--ru-surface);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.05);
}

#brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

#brand-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#logo {
    width: 100px;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    border-radius: 18px;
    border: none;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

#language-switcher {
    display: flex;
    gap: 0.5rem;
}

#language-switcher button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--ru-border);
    background: var(--ru-surface);
    color: #1f1f1f;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

#language-switcher button:hover {
    background: var(--ru-bg);
}

#language-switcher button.active {
    background: var(--ru-red);
    color: white;
    border-color: var(--ru-red);
}

#brand h1 {
    font-size: 3rem;
    margin: 0;
    color: #1f1f1f;
    line-height: 1.03;
    font-weight: 700;
    transition: color 0.2s ease;
}

#brand h1:hover {
    color: var(--ru-red);
}

#brand .subtitle {
    margin: 0;
    color: var(--ru-gray-dark);
    font-size: 1rem;
    font-weight: 600;
}

#stemwijzer {
    background: var(--ru-surface);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 3rem 3rem;
    margin-top: 1.25rem;
    border-radius: 24px;
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.05);
}

/* ---------- Headings ---------- */

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--ru-red);
    margin: 0 0 0.5rem;
}

h2 {
    font-size: 1.6rem;
    margin-top: 0;
}

/* ---------- Intro ---------- */

#intro {
    color: var(--ru-gray-dark);
    background: #fff;
    padding: 1.1rem 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

/* ---------- Question ---------- */

#question-container {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 2.5rem;
}

/* ---------- Buttons ---------- */

#buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

#bottom-controls {
    display: flex;
    justify-content: center;
    margin-top: 0.75rem;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

#party-opinions-btn {
    min-width: 220px;
    max-width: 280px;
    width: 100%;
    padding: 0.95rem 1.3rem;
    text-align: center;
    order: 1;
}

#bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    width: 100%;
}

#progress {
    color: var(--ru-gray-dark);
    font-weight: 700;
    text-align: left;
    flex: 1;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
    line-height: 1;
    font-size: 16px;
}

button.skip {
    background: #f5f5f5;
    color: #999;
    border: 1px solid #e0e0e0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.04);
    padding: 0 1rem !important;
    font-size: 16px !important;
    font-weight: 700;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: fit-content;
    white-space: nowrap;
    flex-shrink: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0;
}

button.skip:hover {
    background: #e8e8e8;
    color: #555;
}

/* ========== Media Query Desktop ========== */

@media (min-width: 601px) {
    #bottom-controls {
        justify-content: center;
        margin-bottom: 1.5rem;
    }

    #party-opinions-btn {
        width: auto;
        flex: 0 0 auto;
        min-width: 220px;
        max-width: 280px;
    }

    #bottom-row {
        justify-content: space-between;
        align-items: center;
        margin-top: 0;
        gap: 1rem;
    }

    #progress {
        text-align: left;
        flex: 0 0 auto;
    }

    button.skip {
        position: static;
        margin: 0;
        flex: 0 0 auto;
    }
}

/* ========== Media Query Mobile ========== */

button {
    padding: 1rem 1.2rem;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button.agree,
button.disagree {
    background: #fff;
    color: #1f1f1f;
    border: 1px solid rgba(31, 31, 31, 0.12);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

button:hover {
    transform: translateY(-1px);
    background: #f7f7f7;
}

button.agree:hover,
button.disagree:hover {
    color: #1f1f1f;
}

button.skip:hover {
    background: #e8e8e8;
    color: #555;
}

/* ---------- Score Circles ---------- */

#top-score-circles,
#other-score-circles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    justify-items: center;
}

#other-score-circles {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    margin-top: 1rem;
}

.score-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.score-circle svg {
    width: 120px;
    height: 120px;
    min-width: 120px;
    transform: rotate(-90deg);
}

.score-circle.top svg {
    width: 160px;
    height: 160px;
    min-width: 160px;
}

.score-circle.small svg {
    width: 120px;
    height: 120px;
    min-width: 120px;
}

.score-circle.top .party-name {
    font-size: 1.2rem;
}

.score-circle.top .score-text {
    font-size: 1rem;
}

.circle-bg {
    fill: none;
    stroke: #e9e9e9;
    stroke-width: 8;
}

.circle-fill {
    fill: none;
    stroke: var(--ru-red);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 314;
    stroke-dashoffset: 314;
    transition: stroke-dashoffset 1.5s ease-out;
}

.circle-fill.animate {
    stroke-dashoffset: var(--dashoffset, 314);
}

.circle-label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    text-align: center;
}

.party-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f1f1f;
}

.score-text {
    font-size: 0.95rem;
    color: #666;
    font-weight: 600;
}

/* ---------- Progress ---------- */

#progress {
    text-align: center;
    margin-top: 1.75rem;
    font-size: 0.95rem;
    color: var(--ru-gray);
}

/* ---------- Result ---------- */

#result {
    display: none;
    margin-top: 2rem;
    background: var(--ru-white);
    padding: 2rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 24px;
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease-in-out;
}

#result strong {
    font-size: 1.3rem;
    color: var(--ru-red);
}

#result ul {
    padding-left: 1.3rem;
}

#result li {
    margin-bottom: 0.4rem;
}

#party-opinions-btn {
    display: block;
    margin: 1.5rem auto 0;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(227, 0, 11, 0.2);
    border-radius: 999px;
    color: var(--ru-red);
    box-shadow: 0 10px 24px rgba(227, 0, 11, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
}

#party-opinions-btn:hover {
    background: #f2f2f2;
    color: #1f1f1f;
}

.party-opinions {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--ru-white);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
}

.party-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: stretch;
}

.party-chip {
    display: block;
    border-radius: 18px;
    background: #f6f5f4;
    color: #1f1f1f;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.party-chip summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
    user-select: none;
    gap: 1rem;
}

.party-chip summary span:first-child {
    flex: 1;
    text-align: left;
}

.party-chip summary span:last-child {
    flex: 0 0 auto;
    text-align: right;
}

.party-chip summary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

.party-chip summary::after {
    content: "▼";
    font-size: 0.7rem;
    margin-left: 0.5rem;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.party-chip[open] summary::after {
    transform: rotate(180deg);
}

.party-chip summary::-webkit-details-marker {
    display: none;
}

.party-chip p {
    margin: 0;
    padding: 0.75rem 1rem 1rem;
    color: var(--ru-gray);
    font-size: 0.95rem;
    line-height: 1.6;
}

.party-yes summary {
    background: rgba(45, 156, 82, 0.14);
    border: 1px solid rgba(45, 156, 82, 0.22);
    color: #2d9c52;
}

.party-no summary {
    background: rgba(227, 0, 11, 0.12);
    border: 1px solid rgba(227, 0, 11, 0.18);
    color: #be311e;
}

.party-chip[open] summary {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Question summary */
.question-summary {
    margin-bottom: 1.75rem;
    padding: 1.2rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    background: var(--ru-white);
}

.question-summary h4 {
    margin: 0 0 1rem;
    color: #1f1f1f;
    font-size: 1.1rem;
}

.question-summary .party-grid {
    margin-bottom: 1rem;
}

.question-summary details {
    margin-top: 0.75rem;
}

.question-summary summary {
    cursor: pointer;
    font-weight: 600;
}

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
    main {
        margin: 1rem auto 2rem;
    }

    header {
        margin-bottom: 0.75rem;
    }

    #brand {
        flex-direction: row;
        padding: 1rem 1rem;
        margin-bottom: 0.75rem;
        gap: 1rem;
    }

    #logo {
        width: 70px;
        flex-shrink: 0;
    }

    #brand-text {
        flex: 1;
        justify-content: center;
    }

    #brand h1 {
        font-size: 1.8rem;
    }

    #brand .subtitle {
        font-size: 0.8rem;
    }

    #intro {
        padding: 0.8rem 1rem;
    }

    #stemwijzer {
        padding: 1.5rem 1.25rem;
        margin-top: 0.75rem;
    }

    #question-container {
        font-size: 1.35rem;
        margin-bottom: 1.75rem;
    }

    #buttons {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    button {
        padding: 0.9rem 1rem;
        font-size: 1rem;
        width: 100%;
    }

    #bottom-controls {
        flex-direction: column;
    }

    #party-opinions-btn {
        flex: none;
        width: calc(100% + 1rem);
    }

    #bottom-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 1rem;
        position: static;
        height: auto;
        gap: 1rem;
    }

    #progress {
        display: flex;
        align-items: center;
        text-align: left;
        flex: 1;
        height: 48px;
    }

    button.skip {
        margin: 0;
        width: fit-content;
        position: static;
        flex-shrink: 0;
    }

    #top-score-circles,
    #other-score-circles {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .score-circle {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .score-circle svg {
        width: 100px;
        height: 100px;
        min-width: 100px;
    }

    .score-circle.top svg {
        width: 140px;
        height: 140px;
        min-width: 140px;
    }

    .party-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .party-chip summary {
        padding: 0.8rem 0.9rem;
        font-size: 0.95rem;
    }

    .question-summary {
        padding: 1rem;
        margin-bottom: 1.25rem;
    }

    .question-summary h4 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    #result {
        padding: 1.5rem 1.25rem;
        margin-top: 1.5rem;
    }
}