/* === keyboard.css (完成版) === */
/* PCでのキーボード操作に関する共通スタイル */

/* --- キーボードヒントの表示エリア --- */
.keyboard-hints {
    display: none;
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: #444;
    border-radius: 15px;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    color: white;
    /* ★追加: 角丸のアニメーション */
    transition: border-bottom-left-radius 0.1s ease 0.3s, border-bottom-right-radius 0.1s ease 0.3s;
}

/* 画面幅が901px以上のPCで表示 */
@media (min-width: 901px) {
    .keyboard-hints {
        display: block;
    }
}

/* --- 開閉機能付きタイトルバー --- */
.hints-title-toggle {
    cursor: pointer;
    outline: none;
    padding: 10px 15px 5px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transition: border-bottom-color 0.4s ease, opacity 0.2s ease;
}
.hints-title-toggle:hover {
    opacity: 0.6;
}
.hints-title-toggle:focus-visible {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}
.toggle-main-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.hints-title-text {
    font-weight: bold;
    font-size: 13px;
    display: flex;
    align-items: center;
    color: white;
}
.hints-title-text::before {
    content: '';
    display: inline-block;
    width: 28px;
    height: 28px;
    margin-right: 5px;
    background-image: url('../images/icon_keyboard.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.hints-toggle-icon {
    width: 12px;
    height: 12px;
    border-style: solid;
    border-color: #fff;
    border-width: 0 2px 2px 0;
    display: inline-block;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin: 0 5px 3px 0;
}
.toggle-hint-text {
    font-size: 11px;
    color: #ccc;
    text-align: right;
    padding-right: 2px;
    height: 14px;
    line-height: 1;
}
.hint-open { display: none; }
.hint-close { display: inline; }


/* --- ヒント本体のラッパー --- */
.hints-body {
    padding: 5px 15px 10px 15px;
    max-height: 500px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out, padding-top 0.4s ease-out, padding-bottom 0.4s ease-out;
}

/* --- パネルが閉じている時のスタイル --- */
/* ★変更: 角丸のスタイルを追加 */
.keyboard-hints.is-collapsed {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    /* ★変更: アニメーションがスムーズに見えるように調整 */
    transition: border-bottom-left-radius 0.4s ease, border-bottom-right-radius 0.4s ease;
}
.keyboard-hints.is-collapsed .hints-title-toggle {
    border-bottom-color: transparent;
    padding-bottom: 10px;
}
.keyboard-hints.is-collapsed .hints-toggle-icon {
    transform: rotate(-135deg);
    margin-bottom: 0;
}
.keyboard-hints.is-collapsed .hint-open { display: inline; }
.keyboard-hints.is-collapsed .hint-close { display: none; }
.keyboard-hints.is-collapsed .hints-body {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}


/* --- ヒント本体のテーブル --- */
.hints-table {
    width: 100%;
    border-collapse: collapse;
    line-height: 1.6;
    font-size: 13px;
}

.hints-table > tbody > tr > td {
    padding-top: 4px;
    padding-bottom: 4px;
}
.action-label {
    text-align: left;
    padding-right: 15px;
    white-space: nowrap;
    color: #ccc;
    transition: color 0.2s ease;
}
.key-cell {
    text-align: right;
    white-space: nowrap;
}
.key {
    display: inline-block;
    background-color: #333;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Consolas', 'Menlo', monospace;
    font-size: 12px;
    box-shadow: 0 2px 0 #222;
    margin: 0 2px;
    min-width: 1em;
    text-align: center;
    vertical-align: middle;
    color: white !important;
}

/* ★★★★★ 以下を新規追加 ★★★★★ */
/* タイトルバー内のキーのスタイルを微調整 */
.toggle-hint-text .key {
    font-size: 11px;
    padding: 1px 5px;
    box-shadow: 0 1px 0 #222;
    margin: 0;
    vertical-align: baseline; /* 周囲のテキストと高さを合わせる */
}


/* --- フォーカスされたカードのスタイル --- */
.study-card.is-focused {
    outline: 3px solid #1fa2ff;
    outline-offset: 2px;
    box-shadow: 0 8px 15px rgba(31, 162, 255, 0.15);
    transition: outline 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    transform: scale(1.02);
}

/* --- アコーディオンのスタイル (改善版) --- */
.accordion-toggle {
    transition: opacity 0.2s ease;
}
.accordion-toggle:hover {
    opacity: 0.5;
}
.accordion-toggle td {
    cursor: pointer;
    user-select: none;
}
.accordion-toggle .action-label {
    color: #fff;
}
.accordion-label-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.accordion-plus-icon {
    width: 1.2em;
    height: 1.2em;
    font-style: normal;
    font-weight: bold;
    font-size: 1.2em;
    line-height: 1;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), color 0.2s ease;
    transform-origin: center;
    transform: rotate(0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.accordion-toggle.is-open .accordion-plus-icon {
    transform: rotate(45deg);
}
.accordion-content td {
    padding: 0 !important;
    border: none;
}
.accordion-inner-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
    padding-left: 15px;
}
.accordion-content.is-open .accordion-inner-content {
    max-height: 200px;
    padding-top: 4px;
    padding-bottom: 4px;
}
.hints-divider td {
    padding-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}