body {
  font-family: 'Montserrat', sans-serif;
  overflow-x: hidden;
}


.container {
  max-width: 100%;
  width: 95%;
  max-width: 900px; /* estää sen leviämisen liian leveäksi isolta näytöltä */
  margin: 20px auto;
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}


.site-branding {
    text-align: right;
    color: #777;
    font-size: 0.9em;
    margin-bottom: 20px;
}

h1, h2, h3, h4 {
    color: #333;
    margin-bottom: 15px;
}

h1 {
    text-align: center;
    font-size: 2.2em;
    color: #2c3e50;
}

h2 {
    font-size: 1.8em;
    color: #34495e;
}

h3 {
    font-size: 1.5em;
    color: #34495e;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-top: 30px;
}

p {
    margin-bottom: 10px;
}

/* --- Esittelyosion tyylit --- */
.intro-text {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-left: 5px solid #3498db;
    border-radius: 4px;
}

.mbti-intro-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    margin-bottom: 20px;
}

.mbti-intro-table th,
.mbti-intro-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.mbti-intro-table th {
    background-color: #eaf2f8;
    color: #34495e;
    font-weight: bold;
}

.mbti-intro-table td strong {
    color: #2c3e50;
}

.identity-dimension {
    list-style-type: disc;
    margin-left: 20px;
    margin-bottom: 20px;
}

.source-info {
    font-size: 0.85em;
    color: #777;
    text-align: right;
    margin-top: 20px;
    font-style: italic;
}

/* --- Aloita testi -painike --- */
.start-button-container {
    text-align: center;
    margin-top: 40px;
}

.start-button {
    display: inline-block;
    background-color: #27ae60; /* Vihreä nappi */
    color: white;
    padding: 15px 30px;
    font-size: 1.2em;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.start-button:hover {
    background-color: #229a54;
}

/* Tyylit punaiselle "Aloita testi" -napille */
.start-button-punainen {
    background-color: #000080; /* Navy Blue */
    color: white; /* Valkoinen teksti erottuu */
    padding: 18px 35px; /* Reilusti tilaa napin sisällä */
    font-size: 20px; /* Isompi teksti */
    font-weight: bold; /* Lihavoitu teksti */
    margin: 15px; /* Reilumpi marginaali ympärillä */
    cursor: pointer; /* Osoitin muuttuu kädeksi */
    border: none; /* Ei reunaa */
    border-radius: 10px; /* Selkeästi pyöristetyt kulmat */
    box-shadow: 0 8px 15px rgba(0, 0, 128, 0.4); /* Voimakas varjo, navy blue -sävyinen */
    transition: all 0.3s ease; /* Pehmeä siirtymä kaikkiin muutoksiin */
    text-transform: uppercase; /* Teksti isoilla kirjaimilla */
    letter-spacing: 1px; /* Hieman väljempää kirjainväliä */
}

/* Hover-tila (kun hiiri on napin päällä) */
.start-button-punainen:hover {
    background-color: #000066; /* Hieman tummempi navy blue hoverissa */
    transform: translateY(-3px); /* Nousee hieman ylöspäin */
    box-shadow: 0 12px 20px rgba(0, 0, 128, 0.6); /* Voimakkaampi varjo hoverissa */
}

/* Active-tila (kun nappia painetaan) */
.start-button-punainen:active {
    transform: translateY(0); /* Palaa takaisin alas */
    box-shadow: 0 5px 10px rgba(0, 0, 128, 0.3); /* Varjo pienenee, kun painetaan */
}
/* --- Kysymysosion tyylit --- */

.pagination-info {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1em;
    color: #555;
}

.question-block {
    border: 1px solid #ccc;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 8px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.question-type-label {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 10px;
    border-bottom: 1px dashed #ddd;
    padding-bottom: 5px;
}

.question-type-label strong {
    color: #333;
}

.question-type-label .type-name-info {
    display: block;
    font-style: italic;
    font-size: 0.85em;
    color: #777;
    margin-top: 5px;
}

.question-text {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #333;
    font-weight: bold;
}

/* RADIO-RYHMÄN ASETTELU */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.radio-group label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0;
    cursor: pointer;
    background-color: #f0f8ff;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #e0efff;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    font-size: 0.85em;
    flex-grow: 1;
    min-width: 100px;
    max-width: 180px;
    text-align: center;
    justify-content: center;
}

.radio-group label:hover {
    background-color: #e0f0ff;
    border-color: #c0dfff;
}

.radio-group input[type="radio"] {
    margin-right: 4px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border: 2px solid #3498db;
    border-radius: 50%;
    vertical-align: middle;
    outline: none;
    cursor: pointer;
    position: relative;
    top: -1px;
    flex-shrink: 0;
}

.radio-group input[type="radio"]:checked {
    background-color: #3498db;
    border-color: #f30317; /* Punainen reuna valitulle */
}

/* Custom radio button inner circle */
.radio-group input[type="radio"]:checked::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-group input[type="radio"]:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.4);
}

.radio-group span {
    vertical-align: middle;
    font-size: 0.85em;
    color: #444;
    text-align: center;
    flex-grow: 1;
}

/* Navigointipainikkeet (yleiset) */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.navigation-buttons button {
    padding: 12px 25px;
    font-size: 1.1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    flex-grow: 1;
    min-width: 150px;
}

.prev-button {
    background-color: #f39c12; /* Oranssi */
    color: white;
}

.prev-button:hover {
    background-color: #e67e22;
}

.next-button,
.submit-button {
    background-color: #3498db; /* Sininen */
    color: white;
}

.next-button:hover,
.submit-button:hover {
    background-color: #2980b9;
}

/* Testinapit (Täytä satunnaiset vastaukset) */
.test-button-container {
    text-align: center;
    margin-top: 10px;
}

.test-page-button {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 12px 25px;
    font-size: 1em;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
    width: auto;
    min-width: 200px;
}

.test-page-button:hover {
    background-color: #2980b9;
}

/* --- Tulossivun tyylit --- */
.result-type {
    text-align: center;
    font-size: 1em;
    font-weight: bold;
    color: #2c3e50;
    margin: 30px 0;
    letter-spacing: 2px;
}

.result-type .identity-char {
    font-size: 0.5em;
    color: #3498db;
}

.result-type .type-name {
    display: block;
    font-size: 1.2em;
    color: #555;
    margin-top: 5px;
    font-weight: normal;
}

.description-box {
    background-color: #eaf8f4;
    border: 1px solid #d4ede3;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.description-box h3 {
    color: #286c5e;
    margin-top: 0;
    border-bottom: none;
}

.description-box p {
    margin-bottom: 10px;
}

.note {
    font-size: 0.9em;
    color: #777;
    font-style: italic;
    margin-top: 20px;
}

/* --- Yhteiset tulososion pohjaluokat --- */
.results-breakdown {
    margin-top: 30px;
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dimension-row {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dimension-label {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    width: 100%;
}

/* --- Pisteiden erittelynäkymä (yksittäiset pisteet) --- */
.score-breakdown {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f0f8ff;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.05);
}

.dimension-score {
    display: flex;
    align-items: center;
    font-size: 1.2em;
    font-weight: normal;
    color: #555;
    background-color: #ffffff;
    padding: 8px 15px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.dimension-score .score-label {
    padding: 0 5px;
}

.dimension-score .score-label strong {
    color: #3498db;
    font-size: 1.3em;
}

.dimension-score .score-separator {
    color: #ccc;
    margin: 0 5px;
}

/* --- Vaakapalkkidiagrammien tyylit --- */
.dimension-bar-container {
    display: flex;
    width: 90%;
    max-width: 600px; /* Voit kasvattaa tätä tarvittaessa, esim. 700px tai 800px */
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    height: 40px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
}

.dimension-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em; /* Kokeile tätä, jos teksti on yhä liian iso */
    height: 100%;
    transition: width 0.5s ease-in-out;
    white-space: nowrap;
    position: relative;
    padding: 0 5px;
    box-sizing: border-box; /* Varmistaa, että padding ei kasvata leveyttä */
}

.dimension-segment .char {
    font-size: 1.2em; /* Kirjainten koko */
    margin: 0 5px;
}

.dimension-segment .score {
    font-size: 0.8em; /* Pistemäärän koko */
    opacity: 0.8;
}

.dimension-segment.segment-left {
    border-top-left-radius: 5px;
    border-bottom-left-radius: 5px;
    justify-content: flex-start; /* Kirjain vasemmalla */
}

.dimension-segment.segment-right {
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    justify-content: flex-end; /* Kirjain oikealla */
}

.dimension-summary { /* Käytössä vaakapalkkien kanssa */
    font-size: 1em;
    color: #555;
    margin-top: 5px;
    font-style: italic;
}

.dimension-summary .winning-type {
    font-weight: bold;
    color: #333;
}

.dimension-summary .winning-percentage {
    font-weight: bold;
    color: #333;
}

/* --- MBTI opas --- */
.mbti-guide {
    margin-top: 40px;
    background-color: #f9f9f9;
    border-left: 5px solid #bdc3c7;
    padding: 20px;
    border-radius: 4px;
}

.mbti-definitions li,
.mbti-use-cases li {
    margin-bottom: 5px;
}

.mbti-types-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.mbti-types-table th,
.mbti-types-table td {
    border: 1px solid #eee;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

.mbti-types-table th {
    background-color: #f2f2f2;
}

.short-guide-text {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #ddd;
}

/* Paluu-linkki tai nappi */
.return-link {
    display: block;
    text-align: center;
    margin-top: 30px;
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
}

.return-link:hover {
    text-decoration: underline;
}

.footer-note {
    text-align: center;
    margin-top: 40px;
    font-size: 0.8em;
    color: #999;
}

.footer-note a {
    color: #999;
    text-decoration: none;
}

.footer-note a:hover {
    text-decoration: underline;
}

/* --- TULOSTUSNAPIN TYYLIT --- */
.print-button-container {
    text-align: center;
    margin-top: 20px;
}

.responsive-kuva {
    max-widt:100%;
    height: auto;
    display: block;

}


.container img {
    max-width: 100%;
    height: auto;
    display: block;
}


img {
    max-width: 100%;
    height: auto;
    display: block;
}



.print-button {
    background-color: #6a0dad;
    color: #ffffff;
    padding: 14px 32px;
    font-size: 1.2em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    background-image: linear-gradient(to right, #8e44ad 0%, #6a0dad 100%);
    outline: none;
    width: 250px;
}

.print-button:hover {
    background-color: #5b0a9d;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    background-image: linear-gradient(to right, #6a0dad 0%, #5b0a9d 100%);
}

.print-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* --- Tulostukseen liittyvät tyylit --- */
@media print {
    /* Pakota selaimet tulostamaan taustavärit ja -kuvat */
    body {
        -webkit-print-color-adjust: exact !important; /* Chrome, Safari */
        print-color-adjust: exact !important; /* Yleinen standardi */
        background-color: #ffffff !important; /* Varmista valkoinen tausta tulosteessa */
    }

    /* Varmista, että tekstin väri on musta ja näkyvä */
    body, p, h1, h2, h3, h4, .container, .question-text, .dimension-label, .dimension-segment {
        color: #000000 !important; /* Musta teksti luettavuuden parantamiseksi */
    }

    /* Säilytä taustavärit niillä elementeillä, joilla ne ovat tärkeitä, esim. palkkidiagrammit */
    .dimension-bar-container {
        background-color: #e9ecef !important; /* Palkin tausta */
        border: 1px solid #ddd !important;
    }

    /* Aseta segmenttien (palkkien) tekstin väri valkoiseksi, jotta se näkyy värillisen taustan päällä */
    .dimension-segment {
        color: #ffffff !important;
    }

    /* PIILOTA TULOSTUSNAPPI TULOSTUSNÄKYMÄSTÄ */
    .print-button-container,
    .print-button {
        display: none !important;
    }

    /* PIILOTA MUUT ELEMENTIT, joita ei tarvita tulosteessa */
    .navigation-buttons,
    .test-button-container,
    .footer-note,
    .return-link,
    .site-branding {
        display: none !important;
    }

    /* Yleiset säädöt tulostusta varten */
    .container {
        margin: 0 !important;
        padding: 10px !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    /* Poista laatikoiden varjostukset ja säädä reunoja luettavuuden parantamiseksi */
    .question-block,
    .description-box,
    .results-breakdown,
    .score-breakdown {
        box-shadow: none !important;
        border: 1px solid #eee !important;
    }

    /* Tee taulukoiden reunoista näkyvämmät tulosteessa */
    .mbti-intro-table th, .mbti-intro-table td,
    .mbti-types-table th, .mbti-types-table td {
        border-color: #ccc !important;
    }
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Pehmeä vieritys mobiilissa */
}

.mbti-intro-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Tämän ansiosta ei pakkaudu liian kapeaksi */
}

.mbti-intro-table th,
.mbti-intro-table td {
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #ccc;
    font-size: 0.95em;
}

button {
  padding: 12px 25px;
  font-size: 17px;
  background-color: #007acc; /* Yleinen sininen tausta */
  color: white;
  border: none; /* Ei oletuskehystä */
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease; /* transitioneihin voit palata myöhemmin */
  margin: 0 10px; /* Lisää hieman tilaa painikkeiden väliin */
}

button:hover {
  background-color: #005fa3; /* Yleinen tummempi sininen hoverissa */
}

/* MikaKalpaFaniNappi -painikkeiden tyyli (musta-keltainen) */
.MikaKalpaFaniNappi {
  /* Nämä ominaisuudet ylikirjoittavat yllä olevat 'button'-säännön, jos luokkaa käytetään */
  background-color: black; /* KalPa-musta tausta */
  color: yellow; /* KalPa-keltainen teksti */
  border: 2px solid yellow; /* Keltainen kehys, 2px paksu */
  /* padding, font-size, border-radius, cursor ja margin voivat periä yllä olevasta button-säännöstä, 
     jos ne ovat samat, tai voit määrittää ne uudelleen tähän, jos ne ovat erilaisia.
     Tässä esimerkissä ne säilyvät samoina kuin yleisessä button-säännössä, mutta voit lisätä ne. */
  
  /* Varmista, että siirtymät ovat tässä mukana, jos ne ovat erilaiset kuin yleiset */
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.MikaKalpaFaniNappi:hover {
  background-color: #333; /* Hieman vaaleampi musta hoverissa */
  color: white; /* Valkoinen teksti hoverissa */
  border-color: #eee; /* Vaaleampi keltainen/harmaa kehys hoverissa */

}

/* MikaMujuLogo - KalPa-henkinen tyyli otsikolle tai tekstille */
/* --- MikaMujunenLogo - KalPa-henkinen tyyli (YHDISTETTY) --- */
/* --- MikaMujunenLogo - KalPa-henkinen tyyli (YHDISTETTY JA OPTIMOITU LINKILLE) --- */
.MikaMujunenLogo {
  display: inline-block;
  padding: 2px 5px;
  background-color: transparent;
  color: black;
  border: 1px solid yellow; /* Alkuperäinen keltainen kehys */
  border-radius: 3px;
   font-family: 'Montserrat', sans-serif; /* Käytetään samaa fonttia kuin muualla */
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: lowercase;/*pikku fontilla kivempi ja lempeäämpi */ 
  letter-spacing: 0.2px;
  box-shadow: 0 0 5px yellow,
              0 0 10px rgba(255, 255, 0, 0.3);
  text-decoration: none;
  transition: all 0.3s ease;
}

.MikaMujunenLogo:hover {
  background-color: rgba(255, 255, 0, 0.1);
  color: #333;
  border-color: #FFFF00; /* **Puhdas, kirkas keltainen reuna** */
  box-shadow:
    0 0 15px #FFFF00, /* **Voimakas, kirkas perushehku** */
    0 0 30px rgba(255, 255, 0, 0.9), /* **Intensiivisempi ja laajempi hehku** */
    0 0 60px rgba(255, 255, 0, 0.7), /* **Lisää "häikäisyä" laajemmalle alueelle** */
    0 0 100px rgba(255, 255, 0, 0.5); /* **Laaja, valoisa halo, joka muistuttaa auringon heijastusta** */
  transform: translateY(-1px);
}
