/* =================================================================
 * 老眼チェック・老眼年齢テスト (visiontest-presbyopia)
 * スコープ: #app-visiontest-presbyopia
 * ================================================================= */

/* --- 検査面（白背景・黒文字を強制して検査条件を統一） --- */
#app-visiontest-presbyopia .presby-test-surface {
    background-color: #ffffff;
    color: #111111;
    border: 1px solid #dee2e6;
}

/* --- 近点距離テストのステージ --- */
#app-visiontest-presbyopia #np-stage {
    min-height: 300px;
    padding: 1.5rem;
    text-align: center;
}

#app-visiontest-presbyopia .presby-np-target {
    /* 実寸は JS で height/font-size を px 指定して上書きする */
    line-height: 1;
    color: #111111;
    font-weight: 700;
    font-family: "Noto Sans JP", sans-serif;
    display: inline-block;
}

#app-visiontest-presbyopia .presby-np-caption {
    margin-top: 1.25rem;
    font-size: 0.8rem;
    color: #6c757d;
}

/* --- 文字サイズ判読テスト --- */
#app-visiontest-presbyopia .presby-read-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0.25rem;
    border: none;
    border-bottom: 1px solid #eee;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#app-visiontest-presbyopia .presby-read-row:last-child {
    border-bottom: none;
}

#app-visiontest-presbyopia .presby-read-row:hover,
#app-visiontest-presbyopia .presby-read-row:focus {
    background-color: #f2effa;
    outline: none;
}

#app-visiontest-presbyopia .presby-read-row.selected {
    background-color: #e7dffa;
    box-shadow: inset 3px 0 0 #7c5ac3;
}

#app-visiontest-presbyopia .presby-read-sample {
    color: #111111;
    font-family: "Noto Sans JP", sans-serif;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    flex: 1 1 auto;
}

#app-visiontest-presbyopia .presby-read-meta {
    flex: 0 0 auto;
    font-size: 0.72rem;
    color: #6c757d;
    text-align: right;
    white-space: nowrap;
}

/* --- 年齢別比較チャート（横棒） --- */
#app-visiontest-presbyopia .presby-bar-row {
    display: grid;
    grid-template-columns: 6.5em 1fr auto;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

#app-visiontest-presbyopia .presby-bar-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bs-body-color);
    text-align: right;
}

#app-visiontest-presbyopia .presby-bar-track {
    background-color: var(--bs-tertiary-bg);
    border-radius: 50rem;
    height: 16px;
    overflow: hidden;
}

#app-visiontest-presbyopia .presby-bar-fill {
    height: 100%;
    border-radius: 50rem;
    background-color: var(--bs-secondary);
    transition: width 0.5s ease;
}

#app-visiontest-presbyopia .presby-bar-row.is-user .presby-bar-fill {
    background-color: var(--bs-primary);
}

#app-visiontest-presbyopia .presby-bar-row.is-user .presby-bar-label {
    color: var(--bs-primary);
    font-weight: 700;
}

#app-visiontest-presbyopia .presby-bar-value {
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    min-width: 3.5em;
    text-align: right;
}

/* --- キャリブレーション（visiontest 本家と同じ見た目） --- */
#app-visiontest-presbyopia #calibration-target,
#calibration-target {
    transform-origin: center center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    max-width: 100%;
}

.calib-card {
    background-color: #333;
    border-radius: 8px;
    color: white;
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    max-width: 100%;
    overflow: hidden;
}

.calib-coin {
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #f0f0f0, #bdbdbd);
    border: 2px solid #9e9e9e;
    color: #555;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.2);
}

.calib-ruler {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.2);
    background-image:
        linear-gradient(90deg, #000 1px, transparent 1px),
        linear-gradient(90deg, #666 1px, transparent 1px);
    background-size: 20% 100%, 2% 50%;
    background-repeat: repeat-x;
    background-position: left bottom;
    color: #000;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold;
    font-family: monospace;
}

/* =================================================================
 * タブメニュー（visiontest と同じ: PC ピル / スマホ グリッド）
 * ================================================================= */
.test-menu-container {
    position: relative;
}

.custom-scroll-nav {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.custom-scroll-nav::-webkit-scrollbar {
    display: none;
}

.custom-scroll-nav .nav-link {
    color: var(--bs-body-color);
    background-color: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 50rem;
    transition: all 0.2s ease-in-out;
}

.custom-scroll-nav .nav-link:hover {
    background-color: var(--bs-tertiary-bg);
    transform: translateY(-1px);
}

.custom-scroll-nav .nav-link.active {
    background-color: var(--bs-primary) !important;
    color: #fff !important;
    border-color: var(--bs-primary) !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .test-menu-container {
    background-color: #1a1d20 !important;
    border-color: #333 !important;
}

[data-bs-theme="dark"] .custom-scroll-nav .nav-link:not(.active) {
    background-color: #2b3035;
    border-color: #495057;
    color: #e9ecef;
}

@media (max-width: 768px) {
    .custom-scroll-nav {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 8px !important;
        overflow: visible !important;
    }

    .custom-scroll-nav .nav-item {
        width: 100%;
    }

    .custom-scroll-nav .nav-link {
        width: 100%;
        height: 100%;
        aspect-ratio: 1 / 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 4px !important;
        border-radius: 12px !important;
        font-size: 0.72rem;
        text-align: center;
        white-space: normal !important;
        line-height: 1.2;
    }

    .custom-scroll-nav .nav-link i {
        margin-right: 0 !important;
        margin-bottom: 6px;
        font-size: 1.5rem;
    }

    #app-visiontest-presbyopia #np-stage {
        min-height: 240px;
    }
}

/* --- ダークモード時の SEO コンテンツ視認性（visiontest 準拠） --- */
[data-bs-theme="dark"] #app-visiontest-presbyopia .seo-table .table-light,
[data-bs-theme="dark"] #app-visiontest-presbyopia .seo-table .table-light th {
    background-color: #343a40 !important;
    color: #f8f9fa !important;
    border-color: #495057 !important;
}
[data-bs-theme="dark"] #app-visiontest-presbyopia .seo-table {
    color: #e9ecef !important;
}
[data-bs-theme="dark"] #app-visiontest-presbyopia .seo-table td,
[data-bs-theme="dark"] #app-visiontest-presbyopia .seo-table th {
    border-color: #495057 !important;
}
