:root {
    --primary-color: #00a8e8;
    --secondary-color: #007ea7;
    --background-color: #f0f8ff;
    --text-color: #333;
    --white-color: #ffffff;
    --gray-color: #ccc;
    --light-gray-color: #f0f0f0;
    --accent-color: #ffc300;
    --font-family-sans: 'Noto Sans JP', sans-serif;
    --font-family-pop: 'BIZ UD Gothic', sans-serif;
}

body {
    font-family: var(--font-family-sans);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column; /* Change to column layout */
    min-height: 100vh;
    align-items: center; /* Keep content centered horizontally */
    justify-content: center; /* Center content vertically */
}

footer{
    font-size:8px;
    color:#000;
    margin-top: 30px; /* Add margin to push it below main content */
    text-align: center;
    width: 100%; /* Ensure footer takes full width */
}
footer a{
    text-decoration-line: none;
}
footer a:link{
    color: #999999;
}
footer a:hover{
    color: #999999;
}
footer a:visited{
    color: #999999;
}
.hide-footer {
    display: none;
}

.container {
    width: 100%;
    max-width: 1100px; /* 幅を広げます */
    background-color: var(--white-color);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 30px 40px;
    box-sizing: border-box;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: var(--secondary-color);
}

header h1 {
    font-family: var(--font-family-pop);
    font-size: 2.5rem;
    margin: 0;
}

header h1 span {
    font-family: var(--font-family-sans);
    font-size: 1.2rem;
    font-weight: 700;
    display: block;
    margin-top: 5px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Concierge Style */
.concierge {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.concierge-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    margin-right: 20px;
    visibility: hidden; /* Initially hidden */
    opacity: 0;
    transition: opacity 0.5s ease-in-out; /* Fade-in animation */
}

.concierge-img.visible {
    visibility: visible;
    opacity: 1;
}

.speech-bubble {
    position: relative;
    background: var(--light-gray-color);
    border-radius: 10px;
    padding: 15px 20px;
    flex: 1;
}

.speech-bubble:after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 0;
    border: 15px solid transparent;
    border-right-color: var(--light-gray-color);
    border-left: 0;
    margin-top: -15px;
    margin-left: -15px;
}

/* Button Style */
.btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 20px auto 0;
    padding: 15px 20px;
    font-family: var(--font-family-sans);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white-color);
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 126, 167, 0.4);
}

.btn:disabled {
    background: var(--gray-color);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.start-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

@media (max-width: 768px) {
    .start-buttons {
        flex-direction: column;
        align-items: center; /* 中央揃え */
    }
    .start-buttons .btn {
        width: 80%; /* ボタンの幅を調整 */
        max-width: 300px;
    }
}

.account-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: -10px;
}
@media (max-width: 768px) {
    .account-actions {
        flex-direction: column;
        align-items: center; /* 中央揃え */
    }
    .account-actions a {
        width: 80%; /* ボタンの幅を調整 */
        max-width: 200px;
    }
}
.account-actions a{
    padding:auto 10px;
    max-width:200px;
    font-size:0.8rem;
    text-decoration-line: none;
}

.btn-secondary {
    background: var(--secondary-color);
    background: linear-gradient(45deg, var(--secondary-color), #005f7a);
}

.btn-secondary:hover {
    box-shadow: 0 6px 15px rgba(0, 95, 122, 0.4);
}

.btn-tertiary {
    background: var(--light-gray-color);
    color: var(--text-color);
    font-size: 1rem; /* 少し小さく */
    padding: 12px 20px;
    box-shadow: none;
    border: 1px solid #ddd;
}

.btn-tertiary:hover {
    background: #e0e0e0;
    box-shadow: none;
}

.btn-tertiary:disabled {
    background: var(--gray-color);
    color: var(--white-color);
    border-color: var(--gray-color);
    cursor: not-allowed;
}

.navigation-buttons {
    display: grid;
    grid-template-columns: 1fr minmax(300px, 60%) 1fr; /* 中央列の幅を調整 */
    align-items: center;
    gap: 20px;
    margin-top: 30px;
}

.navigation-buttons .btn#next-btn {
    grid-column: 2; /* 中央の列に配置 */
    width: 100%; /* 列の幅いっぱいに広げる */
}

.navigation-buttons .btn#prev-btn {
    grid-column: 1; /* 左の列に配置 */
    justify-self: start; /* 左端に寄せる */
    width: auto;
    padding: 8px 20px;
    font-size: 0.9rem;
}



/* Question Screen */
#progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: var(--light-gray-color);
    border-radius: 5px;
    margin-bottom: 20px;
    overflow: hidden;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 5px;
    transition: width 0.3s ease-in-out;
}

.question-counter {
    text-align: right;
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 700;
}

#question-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-align: center;
    color: var(--secondary-color);
}

#question-body {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 30px;
}

#options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option {
    display: block;
    padding: 15px 20px;
    background-color: var(--light-gray-color);
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.option:hover {
    background-color: #e0e0e0;
}

.option input {
    margin-right: 10px;
}

.option.selected {
    background-color: var(--accent-color);
    color: var(--text-color);
    font-weight: 700;
}


/* Result Screen */
#result-container {
    text-align: center;
    padding: 20px;
    background-color: #fdfdfd;
    border: 2px dashed var(--primary-color);
    border-radius: 15px;
    margin-top: 20px;
}

.result-label {
    font-size: 1rem;
    color: var(--secondary-color);
    margin: 15px 0 5px;
}

.result-value {
    font-family: var(--font-family-pop);
    font-size: 2.2rem;
    color: var(--primary-color);
    margin: 0 0 15px;
}

.result-details {
    text-align: left;
    margin-bottom: 25px;
    padding: 15px;
    background-color: var(--light-gray-color);
    border-radius: 10px;
}

.result-details h4 {
    color: var(--secondary-color);
    margin-top: 15px;
    margin-bottom: 5px;
}

.result-details ul {
    padding-left: 20px;
    margin: 0;
}


#main-country-details, #recommended-countries {
    text-align: left;
    margin-top: 20px;
}

.country-card {
    background-color: var(--light-gray-color);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    text-align:left;
}

.country-card h4 {
    margin: 0 0 10px;
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.country-card p {
    margin: 0 0 10px;
}

.country-card a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

/* --- list.html specific styles --- */

.header-subtext {
    font-size: 1rem;
    margin-top: 10px;
    color: var(--text-color);
}

.link-to-main {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}

.link-to-main:hover {
    color: var(--secondary-color);
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.ideology-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px; /* 少しギャップを狭めます */
}

.matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.small-card {
    padding: 15px;
    text-align: center;
}

.small-card .small-name {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.small-card .level-indicator {
    font-size: 0.8rem;
    margin-top: 5px;
    padding: 2px 8px;
}


.type-card {
    background-color: var(--white-color);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    text-align: center;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
    border: 1px solid var(--light-gray-color);
}

.type-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.12);
}

.type-card-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--light-gray-color);
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

.type-card:hover .type-card-img {
    border-color: var(--primary-color);
}

.type-card-name {
    font-family: var(--font-family-pop);
    font-size: 1.4rem;
    color: var(--secondary-color);
    margin: 0;
}

.level-indicator {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--white-color);
    background-color: var(--primary-color);
    padding: 3px 10px;
    border-radius: 15px;
    display: inline-block;
    margin-top: 10px;
}

/* --- Big Five & Political Ideologies List specific styles --- */
.trait-section, .category-section {
    margin-bottom: 40px;
}

.trait-title, .category-title {
    font-family: var(--font-family-pop);
    font-size: 1.8rem;
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 20px;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
}

.category-title-full-width {
    grid-column: 1 / -1; /* グリッドの全幅を占める */
    font-family: var(--font-family-pop);
    font-size: 1.8rem;
    color: var(--secondary-color);
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
}

.category-title-full-width:first-child {
    margin-top: 0;
}


/* Modal Styles */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: var(--white-color);
    margin: 10% auto;
    padding: 40px;
    border-radius: 20px;
    width: 80%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideIn 0.4s ease-out;
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover,
.close-btn:focus {
    color: var(--text-color);
}

#modal-body {
    text-align: center;
}

#modal-body img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid var(--primary-color);
    margin-bottom: 20px;
}

#modal-body h2 {
    font-family: var(--font-family-pop);
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

#modal-body p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

#modal-body .level-indicator {
    color: var(--white-color);
    background-color: var(--secondary-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 1rem;
    line-height: 1.5;
}

.value-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  margin: 0 6px -8px 0;
  vertical-align: middle;
  background: #fff;
  box-shadow: 0 1px 6px #0001;
}

.modal-components {
    margin-top: 20px;
    text-align: left;
    background-color: var(--light-gray-color);
    padding: 15px;
    border-radius: 10px;
}

.modal-components strong {
    display: block;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.modal-components ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-components li {
    background-color: var(--white-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Animations */
@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

@keyframes slideIn {
    from {transform: translateY(-50px); opacity: 0;}
    to {transform: translateY(0); opacity: 1;}
}


/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }
    header h1 span {
        font-size: 1rem;
    }

    .concierge {
        flex-direction: column;
        text-align: center;
    }

    .concierge-img {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .speech-bubble:after {
        display: none; /* Hide arrow on small screens */
    }

    #question-title {
        font-size: 1.5rem;
    }

    .modal-content {
        margin: 20% auto;
        padding: 30px;
        width: 90%;
    }
}

/* Language Selector */
header {
    position: relative;
    padding-top: 30px; /* Add padding to make space for the language selector */
}

.language-selector {
    position: absolute;
    top: 5px; /* Adjusted for better spacing */
    right: 5px; /* Adjusted for better spacing */
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding-top: 40px; /* More padding for smaller screens */
    }
    .language-selector {
        top: 10px; /* Further adjust for mobile */
        right: 10px; /* Further adjust for mobile */
    }
    .start-buttons {
        flex-direction: column;
        align-items: center; /* 中央揃え */
    }
    .start-buttons .btn {
        width: 80%; /* ボタンの幅を調整 */
        max-width: 300px;
    }
    .account-actions {
        flex-direction: column;
        align-items: center; /* 中央揃え */
    }
    .account-actions a {
        width: 80%; /* ボタンの幅を調整 */
        max-width: 200px;
    }
    .mobile-hidden-spacer {
        display: none; /* Hide the spacer div on mobile */
    }
}

#languageButton {
    background-color: var(--white-color);
    border: 1px solid var(--gray-color);
    border-radius: 20px;
    padding: 5px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.lang-change-icon {
    font-size: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

.language-button-text {
    font-family: var(--font-family-sans);
    font-weight: 700;
}

.language-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--white-color);
    border: 1px solid var(--gray-color);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
}

.language-dropdown a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-color);
}

.language-dropdown a:hover {
    background-color: var(--light-gray-color);
}

/* Auth Form Styles */
.auth-form {
    max-width: 400px;
    margin: 30px auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 700;
    color: var(--secondary-color);
}

.form-group input {
    padding: 12px;
    border: 1px solid var(--gray-color);
    border-radius: 8px;
    font-size: 1rem;
}

.auth-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--primary-color);
    text-decoration: none;
}

/* 万国共通・文字なし・スタイリッシュなSNSシェアボタン */
.sns-share-btn.modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin: 0 10px 10px 0;
  border-radius: 50%;
  background: #f7f7f7;
  color: #222;
  font-size: 1.7rem;
  box-shadow: 0 2px 8px #0001;
  border: 1.5px solid #e0e0e0;
  transition: background 0.18s, color 0.18s, border 0.18s, box-shadow 0.18s, transform 0.12s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none !important;
  vertical-align: middle;
}
.sns-share-btn.modern .fab, .sns-share-btn.modern .fas {
  font-size: 1.5em;
  line-height: 1;
  vertical-align: middle;
}
.sns-share-btn.modern.x,
.sns-share-btn.modern.facebook,
.sns-share-btn.modern.line,
.sns-share-btn.modern.whatsapp,
.sns-share-btn.modern.telegram,
.sns-share-btn.modern.linkedin {
  background: #f7f7f7;
  color: #222;
  border: 1.5px solid #e0e0e0;
  box-shadow: 0 2px 8px #0001;
}
.sns-share-btn.modern:hover {
  background: #111;
  color: #fff;
  border-color: #111;
  filter: none;
  transform: translateY(-2px) scale(1.08);
  opacity: 1;
}
.sns-share-btn.modern:active {
  filter: brightness(0.88);
  transform: scale(0.97);
}
.sns-share-btn.modern .sns-label {
  display: none;
}
.sns-share-btn.modern.reddit,
.sns-share-btn.modern.copylink {
  background: #f7f7f7;
  color: #222;
  border: 1.5px solid #e0e0e0;
  box-shadow: 0 2px 8px #0001;
}
.sns-share-btn.modern.reddit:hover,
.sns-share-btn.modern.copylink:hover {
  background: #111;
  color: #fff;
  border-color: #111;
}
.sns-share-btn.modern.copylink.copied {
  background: #2ecc40;
  color: #fff;
  border-color: #2ecc40;
  transition: background 0.18s, color 0.18s, border 0.18s;
}

