html {
    background-color: #bbbbbb;
    padding: 0px;
    scroll-behavior: smooth;
}

/* Language Toggle Logic */
body.lang-en .lang-zh { display: none !important; }
body.lang-zh .lang-en { display: none !important; }

/* Language Toggle Button Styles */
.lang-toggle {
    position: absolute;
    top: 20pt;
    left: 20pt;
    background-color: #2196f3;
    color: white;
    border: none;
    border-radius: 8pt;
    padding: 8pt 16pt;
    font-family: 'Montserrat', sans-serif;
    font-size: 14pt;
    font-weight: 700;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: background-color 0.2s, transform 0.2s;
}
.lang-toggle:hover {
    background-color: #1976d2;
    transform: translateY(-2px);
}

body {
    width: 80%;
    min-height: calc(100vh - 4em);
    margin: 0 auto;
    padding: 2em;
    background-color: #dddddd;
    border-color: #eeeeee;
    border-left-style: solid;
    border-right-style: solid;
    border-width: 20px;
}
p {
    color: #444444;
    font-family: 'Roboto', sans-serif;
    font-size: 18.5pt;
    line-height: 1.15;
    margin: 4pt;
}

p.value {
    margin-top: 22px;
    margin-bottom: 22px;
    text-indent: -16pt;
    margin-left: 20pt;
    font-size: 24pt;
    line-height: 2.11666656px;
    letter-spacing: 0.03em;
    font-family: 'Montserrat';
}

p.axis_name {
    margin-top: 50px;
    color: #333333;
    font-size: 19pt;
    font-family: 'Montserrat';
}
p.question {
    margin: 16pt auto;
    color: #333333;
    font-family: 'Montserrat', sans-serif;
    font-weight: normal;
    width: 70%;
    min-width: 500pt;
    min-height: 144pt;
    background-color: #eeeeee;
    padding: 16pt;
    border-radius: 16pt;
    font-size: 36pt;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;

}
h1 {
    color: #222222;
    font-family: 'Montserrat', sans-serif;
    font-size: 72pt;
    text-align: center;
    line-height: 72pt;
    margin-top: 0pt;
    margin-bottom: 0pt;
}
h2 {
    color: #333333;
    font-family: 'Montserrat', sans-serif;
    font-size: 34pt;
    line-height: 36pt;
    margin-top: 12pt;
    margin-bottom: 10pt;
}
li {
    font-size: 16pt;
    text-indent: 16pt;
}
a {
    font-family: inherit;
}
div.center {
    background-color: #eeeeee;
    font-family: 'Montserrat', sans-serif;
    border-radius: 8pt;
    padding: 6pt;
    color: white;
    width: 50%;
    min-width: 488pt;
    text-align: center;
    text-decoration: none;
    display: block;
    font-size: 24pt;
    margin: auto;
}
img.quadcolumn {
    width: 23.75%;
    transition: transform .3s;
}
img.quadcolumn:hover {
    transform: scale(1.05);
  }
div.quadcolumn {
    width: 23.75%;
}
div.axis_name {
    color: #333333;
    font-size: 19pt;
    font-family: 'Montserrat';
    display: inline-block;
    padding-bottom: 8.65pt;
}
.spacer {
    display: flex;
}
.spacer > div{
    margin-top: 10px;
    display: inline-block;
    text-align: center;
}
.button {
    background-color: #2196f3;
    font-family: 'Montserrat', sans-serif;
    border: none;
    border-radius: 8pt;
    color: white;
    padding: 8pt;
    width: 50%;
    min-width: 500pt;
    text-align: center;
    text-decoration: none;
    display: block;
    font-size: 24pt;
    margin: -2px auto;
    cursor: pointer;
}
.button:hover, .button:focus { background: #1687e0; }
.stronglyAgree { background: #1b5e20; }
.stronglyAgree:hover, .stronglyAgree:focus { background: #154a19; }
.agree { background: #4caf50; }
.agree:hover, .agree:focus { background: #29942e; }
.neutral { background: #949494; }
.neutral:hover, .neutral:focus { background: #656565; }
.disagree { background: #f44336; }
.disagree:hover, .disagree:focus { background: #d6271a; }
.stronglyDisagree { background: #b71c1c; }
.stronglyDisagree:hover, .stronglyDisagree:focus { background: #a00e0e; }

.small_button, .small_button_off {
    background-color: #333;
    font-family: 'Montserrat', sans-serif;
    border: none;
    border-radius: 8pt;
    color: white;
    padding: 8pt;
    width: 10%;
    min-width: 100pt;
    text-align: center;
    text-decoration: none;
    display: block;
    font-size: 18pt;
    margin: -2px auto;
    cursor: pointer;
}

.small_button:hover, .small_button:focus {
    background: #222;
}

.small_button_off {
    background-color: #ddd;
    color: #888;
    border: 2px solid #888;
    cursor: not-allowed;
    margin: -4px auto;
}
.arrow {
    width: 60%;
    height: auto;
}
div.explanation_blurb_left {
    vertical-align: top;
    width: 37%;
    margin-left: 1%;
    margin-right: 1%;
}
div.explanation_blurb_right {
    vertical-align: top;
    width: 37%;
    margin-left: 1%;
    margin-right: 1%;
}
div.explanation_axis {
    width: 20.9%;
    vertical-align: top;
}
div.axis {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
div.bar {
    height: 56pt;
    line-height: 56pt;
    padding: 8pt;
    margin-top: 4pt;
    margin-bottom: 4pt;
    border-width: 4px;
    border-right-width: 1px;
    border-top-style: solid;
    border-bottom-style: solid;
    border-color: #222222;
    background-color: #eeeeee;
    display: block;
    width: 50%;
}
div.text-wrapper {
    font-family: 'Montserrat', sans-serif;
    font-size: 36pt;
    line-height: 56pt;
    color: #222222;
    display: inline-block;
}
div.equality {
    background-color: #f44336;
    text-align: left;
    border-right-style: solid;
}
div.wealth {
    background-color: #00897b;
    text-align: right;
    border-left-style: solid;
}
div.liberty {
    background-color: #ffeb3b;
    text-align: left;
    border-right-style: solid;
}
div.authority {
    background-color: #3f51b5;
    text-align: right;
    border-left-style: solid;
}
div.peace {
    background-color: #03a9f4;
    text-align: right;
    border-left-style: solid;
}
div.might {
    background-color: #ff9800;
    text-align: left;
    border-right-style: solid;
}
div.progress {
    background-color: #9c27b0;
    text-align: right;
    border-left-style: solid;
}
div.tradition {
    background-color: #8bc34a;
    text-align: left;
    border-right-style: solid;
}
span.weight-300 {
    font-weight: 300;
}
.explanation_bg {
    background-color: #eeeeee;
    border-radius: 25px;
    margin-top: 15px;
}
#banner {
    border-color: #444444;
    border-style: solid;
    border-width: 2px;
    border-radius: 8pt;
    display: block;
    margin: 8pt;
    margin-left: auto;
    margin-right: auto;
}

/* ============================
   AI Model Selection Grid
   ============================ */
.ai-model-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16pt;
    padding: 16pt 0;
    max-width: 900pt;
    margin: 0 auto;
}

.ai-model-card {
    background-color: #eeeeee;
    border: 3px solid #cccccc;
    border-radius: 12pt;
    padding: 20pt 24pt;
    width: 200pt;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    position: relative;
    overflow: hidden;
}

.ai-model-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4pt;
    background: linear-gradient(90deg, #2196f3, #9c27b0);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ai-model-card:hover {
    background-color: #e8e8e8;
    border-color: #2196f3;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.ai-model-card:hover::before {
    opacity: 1;
}

.ai-model-card:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* AI Icon Wrapper — circular background for logos */
.ai-model-icon-wrapper {
    width: 60pt;
    height: 60pt;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10pt auto;
    transition: transform 0.3s ease;
}

.ai-model-card:hover .ai-model-icon-wrapper {
    transform: scale(1.1);
}

.ai-icon-bg-light {
    background-color: #f5f5f5;
    border: 2px solid #e0e0e0;
}

.ai-icon-bg-dark {
    background-color: #1a1a1a;
    border: 2px solid #333333;
}

.ai-logo-img {
    width: 32pt;
    height: 32pt;
}

/* For dark backgrounds, the currentColor SVGs need to be white */
.ai-icon-bg-dark .ai-logo-img {
    filter: brightness(0) invert(1);
}

.ai-model-name {
    font-size: 18pt;
    font-weight: 700;
    color: #222222;
    margin-bottom: 4pt;
}

.ai-model-company {
    font-size: 12pt;
    font-weight: 300;
    color: #666666;
    letter-spacing: 0.05em;
}

/* ============================
   Title Logo in Results Page
   ============================ */
.title-logo-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48pt;
    height: 48pt;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 8pt;
}

.title-logo-img {
    width: 28pt;
    height: 28pt;
}

.title-logo-wrapper.ai-icon-bg-dark .title-logo-img {
    filter: brightness(0) invert(1);
}

/* ============================
   Bar Container (for marker overlay)
   ============================ */
.bar-container {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    position: relative;
}

.bar-container > .bar {
    box-sizing: border-box;
    flex-shrink: 1;
}

/* ============================
   Axis Markers (other AI logos on bars)
   ============================ */
.axis-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none; /* let clicks pass through to bars, except on markers */
}

.axis-marker-link {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: all;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.axis-marker-link:hover {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 20;
}

.axis-marker {
    width: 34pt;
    height: 34pt;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    border: 2px solid rgba(255,255,255,0.8);
    transition: box-shadow 0.2s ease;
}

.axis-marker-link:hover .axis-marker {
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}

.axis-marker-img {
    width: 20pt;
    height: 20pt;
}

.axis-marker.ai-icon-bg-dark .axis-marker-img {
    filter: brightness(0) invert(1);
}

/* ============================
   Collapsible Answers Section
   ============================ */
.answers-toggle {
    cursor: pointer;
    background-color: #eeeeee;
    border-radius: 10pt;
    padding: 14pt 20pt;
    margin-top: 16pt;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s ease;
    border: 2px solid #cccccc;
    user-select: none;
}

.answers-toggle:hover {
    background-color: #e4e4e4;
    border-color: #2196f3;
}

.toggle-arrow {
    font-size: 24pt;
    color: #666;
    transition: transform 0.3s ease, color 0.2s ease;
    font-family: 'Montserrat', sans-serif;
}

.answers-toggle:hover .toggle-arrow {
    color: #2196f3;
}

.answers-collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease, opacity 0.3s ease;
}

.answers-expanded {
    max-height: 100000px; /* large enough for any content */
    opacity: 1;
    transition: max-height 0.8s ease, opacity 0.4s ease 0.1s;
}

/* ============================
   Answer Detail List
   ============================ */
.answer-item {
    background-color: #eeeeee;
    border-radius: 10pt;
    margin: 10pt 0;
    padding: 16pt 20pt;
    border-left: 5px solid #cccccc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.answer-item:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.answer-header {
    display: flex;
    align-items: flex-start;
    gap: 10pt;
    margin-bottom: 10pt;
}

.answer-number {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14pt;
    color: #888888;
    min-width: 32pt;
    flex-shrink: 0;
}

.answer-question {
    font-family: 'Roboto', sans-serif;
    font-size: 16pt;
    color: #333333;
    line-height: 1.4;
    font-weight: 700;
}

.answer-body {
    margin-left: 42pt;
}

.answer-badge {
    display: inline-block;
    padding: 4pt 14pt;
    border-radius: 20pt;
    font-family: 'Montserrat', sans-serif;
    font-size: 12pt;
    font-weight: 700;
    color: white;
    margin-bottom: 8pt;
    letter-spacing: 0.02em;
}

.answer-strongly-agree {
    background-color: #1b5e20;
}

.answer-agree {
    background-color: #4caf50;
}

.answer-neutral {
    background-color: #949494;
}

.answer-disagree {
    background-color: #f44336;
}

.answer-strongly-disagree {
    background-color: #b71c1c;
}

/* Color the left border based on answer */
.answer-item:has(.answer-strongly-agree) {
    border-left-color: #1b5e20;
}
.answer-item:has(.answer-agree) {
    border-left-color: #4caf50;
}
.answer-item:has(.answer-neutral) {
    border-left-color: #949494;
}
.answer-item:has(.answer-disagree) {
    border-left-color: #f44336;
}
.answer-item:has(.answer-strongly-disagree) {
    border-left-color: #b71c1c;
}

.answer-explanation {
    font-family: 'Roboto', sans-serif;
    font-size: 14pt;
    color: #555555;
    line-height: 1.5;
    margin: 4pt 0 0 0;
    padding-left: 2pt;
}

/* ============================
   Responsive adjustments
   ============================ */
@media (max-width: 800px) {
    body {
        width: 95%;
        padding: 1em;
        border-width: 0;
    }
    h1 {
        font-size: 32pt;
        line-height: 36pt;
    }
    h2 {
        font-size: 20pt;
        line-height: 24pt;
    }
    p {
        font-size: 13pt;
    }
    .lang-toggle {
        font-size: 10pt;
        padding: 6pt 10pt;
        top: 10pt;
        left: 10pt;
    }
    .button {
        min-width: unset;
        width: 90%;
        font-size: 16pt;
    }
    .ai-model-grid {
        gap: 8pt;
    }
    .ai-model-card {
        width: 45%;
        padding: 10pt 5pt;
    }
    .ai-model-name {
        font-size: 12pt;
    }
    .ai-model-icon-wrapper {
        width: 36pt;
        height: 36pt;
    }
    .ai-logo-img {
        width: 20pt;
        height: 20pt;
    }
    .answer-body {
        margin-left: 0;
        flex-direction: column;
        align-items: flex-start;
    }
    .answer-badge {
        min-width: unset;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        margin-bottom: 8pt;
    }
    .answer-header {
        flex-direction: column;
        gap: 4pt;
    }
    .axis-marker {
        width: 18pt;
        height: 18pt;
        border-width: 1px;
    }
    .axis-marker-img {
        width: 10pt;
        height: 10pt;
    }
    /* Value images on index page */
    div.center {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
        width: 100%;
        min-width: unset;
        box-sizing: border-box;
        padding: 4px;
    }
    div.center img.quadcolumn {
        width: 100%;
        margin-bottom: 0px;
    }
    div.center div.axis_name {
        font-size: 8pt;
        padding-bottom: 2pt;
        width: auto;
        margin-bottom: 0px;
    }
    /* Explanation text container flow */
    .spacer {
        flex-direction: column;
        align-items: center;
    }
    div.explanation_blurb_left, div.explanation_blurb_right {
        width: 100%;
        margin-bottom: 12pt;
    }
    div.explanation_axis {
        width: 100%;
        margin-bottom: 12pt;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .arrow {
        width: 20%;
        margin-bottom: 10pt;
    }
    p.value {
        text-indent: 0;
        margin-left: 0;
        text-align: center;
    }
    /* SVG adjustments on results page */
    .axis > img {
        height: auto !important;
        width: 15vw !important;
        max-width: 60px;
    }
    div.bar {
        height: 28pt;
        line-height: 28pt;
        padding: 4pt;
        border-width: 1px;
    }
    /* Canvas banner max-width */
    #banner {
        width: 100%;
        height: auto;
        display: block;
        margin: 0 auto;
    }
    #ai-model-title {
        font-size: 20pt !important;
    }
    #ai-model-subtitle {
        font-size: 10pt !important;
    }
    div.text-wrapper {
        font-size: 10pt;
    }
    h2 {
        word-wrap: break-word;
        word-break: break-word;
    }
}
