/**
 * Q&A Navigator スタイル
 */
.aqn-quiz-container {
    max-width: 100%;
    margin: 2em 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    overflow: hidden;
    padding: 2em;
    position: relative;
}

.aqn-progress-bar {
    width: 100%;
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1em;
}

.aqn-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #022f7c 0%, #0451c7 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.aqn-progress-text {
    text-align: center;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 1.5em;
    font-weight: 500;
}

.aqn-progress-text .aqn-current-step {
    color: #022f7c;
    font-weight: 600;
}

.aqn-quiz-title {
    margin: 0 0 1.5em;
    padding: 0 0 1em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 1.2em;
    font-weight: 600;
    text-align: center;
    color: #022f7c;
}

.aqn-question-text {
    margin-top: 0;
    margin-bottom: 1.2em;
    font-size: 1.2em;
    font-weight: 600;
    line-height: 1.4;
    color: #022f7c;
}

.aqn-question-description {
    margin-bottom: 1.5em;
    font-size: 0.9em;
    line-height: 1.6;
    color: #555;
}

.aqn-question-image {
    margin-bottom: 1.5em;
    text-align: center;
}

.aqn-question-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.aqn-answer-button,
.aqn-restart-button,
.aqn-continue-button,
.aqn-result-link {
    display: inline-block;
    padding: 0.85em 1.5em;
    background-color: #022f7c;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-decoration: none !important;
    margin-top: 1em;
    min-height: 50px;
    vertical-align: middle;
    box-sizing: border-box;
}

.aqn-answer-button:hover:not(.aqn-disabled),
.aqn-continue-button:hover,
.aqn-result-link:hover {
    background-color: #033e9f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 47, 124, 0.3);
}

.aqn-answer-button.aqn-active {
    background-color: #0451c7;
    transform: scale(0.95);
}

.aqn-answer-button.aqn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.aqn-answer-button:active:not(.aqn-disabled),
.aqn-restart-button:active,
.aqn-continue-button:active,
.aqn-result-link:active {
    transform: translateY(1px);
}

.aqn-question {
    animation: aqn-fade-in 0.4s ease-out;
}

@keyframes aqn-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.aqn-answers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1em;
    align-items: stretch; /* すべてのアイテムを高さ方向に伸ばす */
}

.aqn-answers.single-column {
    grid-template-columns: 1fr;
}

.aqn-answer-button {
    flex: 1;
    min-width: 140px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    padding: 0.5em 1em;
    line-height: 1.3;
    white-space: normal;
    word-wrap: break-word;
    margin: 0; /* ボタン間のマージンを削除 */
    width: 100%; /* 幅を100%に設定 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.aqn-answer-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.aqn-answer-button:active::before {
    width: 300px;
    height: 300px;
}

.aqn-result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: aqn-result-fade-in 0.6s ease-out;
}

@keyframes aqn-result-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.aqn-result-image {
    max-width: 100%;
    margin-bottom: 1.5em;
}

.aqn-result-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.aqn-result-title {
    color: #022f7c;
    margin: 0 0 0.8em;
    font-size: 1.5em;
    font-weight: 600;
    animation: aqn-title-bounce 0.6s ease-out 0.2s both;
}

@keyframes aqn-title-bounce {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.aqn-result-description {
    margin-bottom: 1.5em;
    line-height: 1.6;
    color: #555;
}

.aqn-result-link {
    min-width: 280px;
    text-align: center;
    padding: 1em 2.5em;
    font-weight: 600;
    display: block;
    margin: 1.5em auto 1em auto;
}

.aqn-result-note {
    margin-top: 0.2em;
    text-align: center;
    font-size: 0.8em;
    color: #666;
    line-height: 1.5;
}

.aqn-result-note-link {
    color: #022f7c;
    text-decoration: underline;
    font-weight: 500;
}

.aqn-result-note-link:hover {
    color: #033e9f;
    text-decoration: none;
}

.aqn-restart-button,
.aqn-continue-button {
    background-color: #6c757d;
    margin-top: 2em;
    margin-right: 1em;
}

/* 「もう一度試す」ボタンのサイズ調整 */
.aqn-restart-button {
    font-size: 0.85em;
    padding: 0.5em 1em;
    min-height: 35px;
    min-width: 150px;
}

.aqn-restart-button:hover,
.aqn-continue-button:hover {
    background-color: #5a6268;
}

.aqn-continue-button {
    background-color: #4a6bdf;
}

.aqn-continue-button:hover {
    background-color: #3c58bf;
}

/* スケルトンスクリーン */
.aqn-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: aqn-skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes aqn-skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .aqn-quiz-container {
        padding: 1.5em;
    }
    
    .aqn-answers {
        gap: 0.5em;
    }
    
    .aqn-progress-bar {
        height: 5px;
    }
    
    .aqn-progress-text {
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .aqn-quiz-container {
        padding: 0.8em;
    }
    
    /* タイトルと質問のサイズ */
    .aqn-quiz-title,
    .aqn-question-text,
    .aqn-result-title {
        font-size: 0.9em;
        margin-bottom: 0.8em;
    }
    
    /* 説明文のサイズ */
    .aqn-question-description,
    .aqn-result-description {
        font-size: 0.8em;
        line-height: 1.4;
    }
    
    /* ボタンのサイズ調整 */
    .aqn-answer-button {
        font-size: 0.85em;
        padding: 0.6em 1em;
        min-height: 40px;
    }
    
    /* 結果ページのリンクボタン */
    .aqn-result-link {
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        line-height: normal;
        padding-top: 0;
        padding-bottom: 0;
        font-size: 0.85em;
        min-width: 220px;
    }
    
    /* やり直しボタン */
    .aqn-restart-button {
        font-size: 0.8em;
        padding: 0.4em 0.8em;
        min-height: 30px;
        min-width: 120px;
    }
    
    .aqn-answers {
        gap: 0.3em;
    }
}