/* --- START OF FILE css/library-common.css --- */

/* =========================================
   変数定義 (Variables)
   ※共通コンポーネント（検索、アコーディオン等）で使用する変数
   ========================================= */
:root {
    /* Colors */
    --bg-color: #121212;
    --card-bg: #000;
    --card-bg-hover: #252528;
    
    /* Text Colors */
    --text-main: #f0f2f5;
    --text-sub: #a0a0a0;
    
    /* Accent Colors */
    --accent-blue: #a4d5eb;
    --accent-yellow: #e0d66e;
    --accent-green: #85d6b3;
    --accent-pink: #e3a1a1;
    
    /* Borders & Shadows */
    --border-color: #333;
    
    /* Radius */
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

/* =========================================
   共通アニメーション定義
   ========================================= */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInUpResult {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   検索バー (Search Area)
   ========================================= */
#search-area {
    margin-bottom: 30px;
    /* フォーカス時にz-indexを上げてオーバーレイより手前に表示する */
    position: relative;
    z-index: 10; 
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    transition: z-index 0s 0.3s; /* 閉じる時のアニメーション待ち */
}

/* フォーカスモード時：エリア全体を最前面へ */
#search-area.is-focused {
    z-index: 1001; /* マイページ等の親コンテキスト内でも最前面になるように */
    transition: z-index 0s;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
    z-index: 2; /* オーバーレイ(1)より手前 */
}

#search-input {
    width: 100%;
    /* 右はボタンが入るので広めにとる */
    padding: 16px 90px 16px 20px;
    
    border-radius: 30px;
    border: 3px solid #eee;
    background-color: #fff;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #333;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    box-shadow: 0 4px 0px rgba(0,0,0,0.1);
}
/* ▼▼▼ 追加: クリアボタン (×) のスタイル ▼▼▼ */
#search-clear-btn {
    position: absolute;
    right: 56px; /* 検索ボタン(right:10px + width:36px) の左側に配置 */
    top: 50%;
    transform: translateY(-50%);
    
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background-color: #ccc; /* グレーの背景 */
    cursor: pointer;
    
    /* 入力があるときだけ表示するためのクラス */
    display: none;
    opacity: 0;
    transition: opacity 0.2s, background-color 0.2s;
    z-index: 6; /* 検索ボタンより手前か同等に */
}

/* 表示状態のクラス（JSで付与） */
#search-clear-btn.is-visible {
    display: block;
    opacity: 1;
}

/* ホバー時に少し濃くする */
#search-clear-btn:hover {
    background-color: #999;
}

/* ×印をCSSで描画 */
#search-clear-btn::before,
#search-clear-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    background-color: #fff; /* 白いバツ印 */
    border-radius: 1px;
}

#search-clear-btn::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

#search-clear-btn::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* 入力時の枠線色 */
#search-input:focus {
    border-color: var(--accent-blue);
    background-color: #fff;
}

/* ▼ 右側の検索ボタン */
#search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    
    border-radius: 50%;
    border: none;
    cursor: pointer;
    
    /* 通常時は薄いグレー */
    background-color: #eee; 
    
    /* アイコン画像 */
    background-image: url('../images/icon_search.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 28px;
    
    transition: all 0.3s ease;
    z-index: 5;
}

/* ホバー時 */
#search-btn:hover {
    background-color: #e1e5e8;
}

/* ▼ 入力中（フォーカス時）のデザイン変更 */
/* 検索窓にフォーカスが当たると、ボタンの背景色が枠線と同じ色になる */
.search-input-wrapper:focus-within #search-btn {
    background-color: var(--accent-blue);
	background-image: url('../images/icon_searchW.svg');
}

/* ▼▼▼ 修正: 黒い半透明の幕 (オーバーレイ) ▼▼▼ */
/* 親のtransformによる制限を回避するため、絶対配置で画面を覆いつつ過剰なはみ出しを防ぐサイズ調整 */
#search-focus-overlay {
    position: absolute;
    top: -150vh;
    bottom: -150vh;
    left: -50vw;
    right: -50vw;
    background-color: rgba(0, 0, 0, 0.6); 
    backdrop-filter: blur(2px); 
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s;
    /* 検索エリア(#search-area)内での配置。入力欄(2)の下になるように1を指定 */
    z-index: 1; 
}

/* フォーカスモードが有効になったときのオーバーレイ */
#search-area.is-focused #search-focus-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* クリックを受け付ける */
}


/* =========================================
   検索結果 (Search Results)
   ========================================= */
#search-results-container {
    display: none;
    padding-bottom: 40px;
    max-width: 500px;
    margin: 0 auto;
    
    /* オーバーレイより手前に表示するための設定 */
    position: relative;
    /* z-indexの遷移を少し待たせる（閉じる時のチラつき防止） */
    transition: z-index 0s 0.3s;
}

/* 検索モード中（JSで付与）は最前面へ */
#search-results-container.is-focused {
    z-index: 1002; /* 検索窓エリア(1001)よりもさらに上 */
    transition: z-index 0s;
}

.search-result-card {
    background-color: #fff;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    gap: 16px;
    
    /* アニメーション設定 */
    opacity: 0; /* 初期状態は透明 */
    animation: fadeInUpResult 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    
    /* ホバーアニメーション用 */
    transition: background-color 0.3s, transform 0.3s;
    border: 1px solid transparent;
    margin-bottom: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.search-result-card:hover {
    background-color: #f0f0f0;
    /* ホバー時は少し右に動く */
    transform: translateX(5px) !important;
}

.search-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(164, 213, 235, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-result-icon::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--accent-blue);
    border-radius: 50%;
}

.search-result-title {
    font-weight: bold;
    font-size: 1rem;
}

.search-result-subtitle {
    font-size: 0.8rem;
    color: #666;
    margin-top: 2px;
}


/* =========================================
   アコーディオン ライブラリ (Library Accordion)
   ========================================= */

.library-content-area {
    display: flex;
    flex-direction: column;
    min-height: 200px;
    max-width: 500px;
    margin: 0 auto;
}

/* --- アコーディオン共通設定 --- */
.accordion-card {
    background-color: var(--card-bg);
    transition: all 0.3s ease;
    overflow: hidden;
}

.accordion-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.accordion-toggle-icon {
    position: relative;
    transition: transform 0.3s;
}

.accordion-toggle-icon::before,
.accordion-toggle-icon::after {
    content: '';
    position: absolute;
    background: #ccc;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s;
}

.accordion-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0, 1, 0, 1), opacity 0.5s ease;
}

.accordion-card.is-open > .accordion-content {
    max-height: 5000px;
    opacity: 1;
}

.accordion-card.is-open > .accordion-header .accordion-toggle-icon {
    transform: rotate(180deg);
}


/* --- Level 1 アコーディオン --- */
.accordion-card.level-1 {
    border-radius: 24px;
    border: 6px solid #fff;
    margin-bottom: 12px;
    box-shadow: 0 4px 0px rgba(0,0,0,0.08);
}

.accordion-card.level-1.is-open {
    padding-bottom: 10px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
}

.level-1-header {
    padding: 22px 20px;
	padding-left:12px;
    border-bottom: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 15px;
}

.accordion-card.level-1.is-open .level-1-header {
    border-bottom-color: rgba(0,0,0,0.05);
}

.header-icon-area {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 30px;
}

.accordion-title-area {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    flex-grow: 1;
}

.accordion-title-main.u-main {
    font-size: 1.3rem;
    font-weight: 900;
    color: #111;
    line-height: 1;
}

.accordion-title-sub.u-sub {
    font-size: 1rem;
    font-weight: normal;
    color: #444;
}

.level-1-header .accordion-toggle-icon {
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    margin-right: 0;
    flex-shrink: 0;
}

.level-1-header .accordion-toggle-icon::before,
.level-1-header .accordion-toggle-icon::after {
    width: 12px;
    height: 2px;
    background: #555;
}
.level-1-header .accordion-toggle-icon::after {
    width: 2px;
    height: 12px;
}

.accordion-card.is-open > .accordion-header .accordion-toggle-icon {
    background: #fff;
	border-radius: 50%;
}
.accordion-card.is-open > .accordion-header .accordion-toggle-icon::before {
    background: var(--accent-blue);
}
.accordion-card.is-open > .accordion-header .accordion-toggle-icon::after {
    height: 0;
}

.level-1-content {
    padding: 0 10px;
}

.accordion-inner-wrapper {
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* タイプ別カラー */
.type-subject.accordion-card.level-1 { background-color: #dfecf5; }
.type-subject .header-icon-area { background-color: #99b1c4; background-image: url('../images/myPage_icon_subject.svg'); }

.type-grade.accordion-card.level-1 { background-color: #daf2e5; }
.type-grade .header-icon-area { background-color: #99c4b1; background-image: url('../images/myPage_icon_school.svg'); }

.type-qualification.accordion-card.level-1 { background-color: #e6dded; }
.type-qualification .header-icon-area { background-color: #ac99c4; background-image: url('../images/myPage_icon_qualification.svg'); }

.type-culture.accordion-card.level-1 { background-color: #f0dae7; }
.type-culture .header-icon-area { background-color: #c499b1; background-image: url('../images/myPage_icon_liberalArts.svg'); }


/* --- Level 2 (中分類) --- */
.accordion-card.level-2 {
    border-radius: 16px;
    border: none;
    background-color: #fff;
}

.accordion-card.level-2:hover {
    border-color: #444;
}

.accordion-card.level-2.is-open {
    background-color: #bbb;
    border-color: #999;
}

.level-2-header {
    padding: 15px 16px;
    gap: 12px;
}

.accordion-title {
    font-size: 20px;
    font-weight: 700;
    flex-grow: 1;
    color: #222;
}

.level-2-header .accordion-toggle-icon {
    width: 24px;
    height: 24px;
    background: transparent;
}

.level-2-header .accordion-toggle-icon::before {
    width: 10px;
    height: 2px;
    background: #666;
}

.level-2-header .accordion-toggle-icon::after {
    width: 2px;
    height: 10px;
    background: #666;
}

.accordion-card.level-2.is-open .accordion-toggle-icon::before {
    background: #6c99ad;
}

/* --- リストアイテム (Level 3以降のアイテム共通) --- */
.subcategory-list {
    list-style: none;
    padding: 15px 10px; /* 余白を追加 */
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px; /* カード同士の間隔 */
    box-sizing: border-box;
}

/* タイプ別のリスト背景色（親のLevel 1の色に合わせる） */
.type-subject .subcategory-list { background-color: #dfecf5; }
.type-grade .subcategory-list { background-color: #daf2e5; }
.type-qualification .subcategory-list { background-color: #e6dded; }
.type-culture .subcategory-list { background-color: #f0dae7; }

.subcategory-item {
    border-top: none; /* 独立したボタンにするため境界線を削除 */
}

/* フレックスボックスの配置を変更 (space-betweenを解除し、flex-growを活用) */
.subcategory-item a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 20px; /* ボタンとしての余白に調整 */
    text-decoration: none;
    color: #333;
    background-color: #fff; /* ボタンの背景色 */
    border-radius: 12px; /* 角丸 */
    box-shadow: 0 3px 0px rgba(0, 0, 0, 0.08); /* 影 */
    transition: all 0.2s;
}

.subcategory-item a:hover {
    background-color: #eef5ff; /* ホバー時の背景色を少し青白く */
    color: var(--accent-blue);
    padding-left: 24px; /* ホバーで少し右に動かす */
}

.subcategory-item a:active {
    transform: scale(0.98);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05);
}

/* 矢印アイコンを右端に押しやる */
.subcategory-item a::after {
    content: '';
    width: 6px;
    height: 6px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.5;
    margin-left: auto; /* ここで右端に固定 */
}

/* ▼▼▼ 追加: 3階層目以降のネストされたアコーディオン ▼▼▼ */
.nested-accordion-wrapper {
    background-color: #fff;
    display: flex;
    flex-direction: column;
}

.accordion-card.nested-accordion {
    border-top: 1px solid #eee;
    background-color: #fff;
    border-radius: 0;
    box-shadow: none;
}


/* 連続するリストとアコーディオンの境界線の調整 */
.subcategory-list + .nested-accordion-wrapper .accordion-card.nested-accordion:first-child,
.accordion-content > .nested-accordion-wrapper .accordion-card.nested-accordion:first-child {
    border-top: none;
}

.nested-accordion-header {
    padding: 16px 16px 16px 16px;
    gap: 12px;
}

/* 階層ごとのインデント調整 */
.level-4-header {
    padding-left: 16px;
	background-color:#eee;
}
.level-5-header {
    padding-left: 16px;
}

.nested-accordion-title {
    font-size: 18px;
    font-weight: 700;
    flex-grow: 1;
    color: #444; /* Level 2より控えめな色 */
}

.nested-accordion-header .accordion-toggle-icon {
    width: 20px;
    height: 20px;
    background: transparent;
}

.nested-accordion-header .accordion-toggle-icon::before {
    width: 10px;
    height: 2px;
    background: #888;
}

.nested-accordion-header .accordion-toggle-icon::after {
    width: 2px;
    height: 10px;
    background: #888;
}

.accordion-card.nested-accordion.is-open > .nested-accordion-header {
    background-color: #f7f9fa; 
}

/* 階層ごとに開いた時のヘッダー背景色を少しずつ濃くしてわかりやすくする */
.accordion-card.nested-accordion.level-3.is-open > .nested-accordion-header {
    background-color: #ccc; 
}

.accordion-card.nested-accordion.level-4.is-open > .nested-accordion-header {
    background-color: #ddd; 
}

.accordion-card.nested-accordion.level-5.is-open > .nested-accordion-header {
    background-color: #eee; 
}

.accordion-card.nested-accordion.is-open > .nested-accordion-header .accordion-toggle-icon::before {
    background: #6c99ad;
}

/* 階層が深い場合のリストアイテムのインデント調整 */
.level-3-content .subcategory-item a {
    padding-left: 16px;
}
.level-3-content .subcategory-item a:hover {
    padding-left: 20px;
}
.level-4-content .subcategory-item a {
    padding-left: 16px;
}
.level-4-content .subcategory-item a:hover {
    padding-left: 20px;
}
.level-5-content .subcategory-item a {
    padding-left: 16px;
}
.level-5-content .subcategory-item a:hover {
    padding-left: 20px;
}

/* =========================================
   ローディング (Loading)
   ========================================= */
.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 40px 0;
    color: var(--text-sub);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* =========================================
   フローティングドック (Dynamic Island Style)
   ========================================= */

.floating-dock-wrapper {
    position: fixed;
    bottom: calc(15px + env(safe-area-inset-bottom, 0px)); 
    left: 50%;
    width: 90%;
    max-width: 360px;
    
    transform: translate(-50%, 0) scale(1);
    
    z-index: 900;
    display: flex;
    justify-content: center;
    pointer-events: none;
    
    transition: transform 0.4s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.4s ease, visibility 0.4s;
    opacity: 1;
    visibility: visible;
}

.floating-dock-wrapper.is-hidden {
    transform: translate(-50%, 20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.floating-dock {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    
    width: 100%;
    height: 70px;
    
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    
    border-radius: 40px; 
    border: 1px solid #444;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.35);
    
    padding: 0 10px;
    box-sizing: border-box;
}


/* ボタン共通 */
.dock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s;
    height: 100%;
    padding: 0;
}

.dock-btn:active {
    transform: scale(0.92);
}

/* 左右のサブボタン */
.dock-btn-side {
    width: 50px; /* タップしやすい幅 */
    flex-shrink: 0;
}

/* 中央のメインボタン（教科選択） */
.dock-btn-main {
    flex-grow: 1;
    margin: 0 8px;
    height: 50px; /* ドック内で少し小さく */
    
    /* 角丸の背景色設定 */
    background: linear-gradient(135deg, #0b4070, #083157);
    border-radius: 25px; /* 完全な角丸 */
    box-shadow: 0 3px 0px rgba(0, 0, 0, 1.0);
}

.dock-btn-main:hover {
}

/* --- アイコン設定 --- */
.dock-icon {
    display: block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* 左：マイページアイコン */
.dock-icon.icon-mypage {
    width: 50px;
    height: 50px;
    background-image: url('../images/topPageIcon_mypage.svg');
}

/* 右：検索アイコン */
.dock-icon.icon-search {
    width: 50px;
    height: 50px;
    background-image: url('../images/topPageIcon_search.svg');
}

/* 中：教科選択アイコン */
/* 背景色の上に配置されるためサイズ調整 */
.dock-btn-main .dock-icon.icon-library {
    width: 100%;
    height: 100%;
    /* 画像パス変更 */
    background-image: url('../images/topPageIcon_subject.svg');
    
    /* 以前のfilter(黒色化)を解除し、元のSVGの色を表示 */
    filter: none;
    
    /* ボタン内に収まるようサイズ調整 (padding含め) */
    transform: scale(0.85); 
}

/* マイページ専用：トップに戻るアイコン */
.dock-icon.icon-home {
    width: 50px;
    height: 50px;
    background-image: url('../images/topPageIcon_home.svg');
}

/* =========================================
   オーバーレイ・モーダル (検索 ＆ 教科選択)
   ========================================= */
.overlay-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    visibility: hidden;
}

.overlay-modal.is-active {
    pointer-events: auto;
    visibility: visible;
}

/* 背景の暗幕 */
.modal-backdrop {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay-modal.is-active .modal-backdrop {
    opacity: 1;
}

/* 1. ボトムシート型 (教科選択) */
.bottom-sheet .modal-content {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    max-height: 85vh;
    background-color: #f9f9f9;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 1, 0.23, 1);
    display: flex;
    flex-direction: column;
}

.bottom-sheet.is-active .modal-content {
    transform: translateY(0);
}

.sheet-handle {
    width: 40px;
    height: 5px;
    background-color: #ddd;
    border-radius: 3px;
    margin: 12px auto 0;
    cursor: pointer;
}

/* 2. フェードイン型 (検索) */
.fade-screen .modal-content {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.98);
    transition: all 0.3s ease;
}

.fade-screen.is-active .modal-content {
    opacity: 1;
    transform: scale(1);
}

/* --- モーダル共通部品 --- */
.modal-header {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #333;
}

.modal-close-btn {
    background: #e0e0e0;
    border: none;
    width: 30px; height: 30px;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #555;
}

.modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0 20px 40px;
}


/* --- 検索モーダル専用スタイル --- */

/* ヘッダー位置調整: ナビゲーションボタンと重ならないよう上部に余白を追加 */
#search-modal .modal-header {
    padding-top: 80px;
    padding-bottom: 10px; /* 下の余白は少し詰める */
}

.modal-search-wrapper {
    display: flex;
    flex-direction: column; /* ★変更: 縦並びにする */
    align-items: stretch;   /* 横幅いっぱいに伸ばす */
    width: 100%;
    gap: 8px; /* 入力欄とキャンセルボタンの間隔 */
}

/* 入力欄とボタンを囲むコンテナ */
.modal-input-group {
    position: relative;
    width: 100%;
}

#modal-search-input {
    width: 100%;
    /* 右側の検索アイコン分の余白だけ確保 */
    padding: 16px 50px 16px 20px;
    border-radius: 30px;
    border: 2px solid transparent;
    background-color: #f0f2f5;
    box-shadow: none;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
}

/* モーダル内の検索ボタン（装飾・アイコン） */
.modal-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: transparent;
    
    background-image: url('../images/icon_search.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px;
    pointer-events: none;
    transition: all 0.3s;
}

/* フォーカス時のスタイル */
#modal-search-input:focus {
    background-color: #fff;
    border-color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* フォーカス時にボタンの色を変える */
.modal-input-group:focus-within .modal-search-btn {
    background-color: var(--accent-blue);
    background-image: url('../images/icon_searchW.svg');
}

/* キャンセルボタン（改行して右下に配置） */
.modal-close-text {
    align-self: flex-end; /* 右寄せ */
    background: none;
    border: none;
    color: #ccc;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 20px;
    transition: background-color 0.2s;
    
    /* アイコン風の装飾を追加 */
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 閉じるアイコン（×）をCSSで追加してオシャレにする */
.modal-close-text::before {
    content: '';
    display: block;
    width: 30px;
    height: 30px;
    background-color: #a30b22;
    border-radius: 50%;
    
    /* ×印を描画 */
    background-image: 
        linear-gradient(45deg, transparent 45%, #000 45%, #000 55%, transparent 55%),
        linear-gradient(-45deg, transparent 45%, #000 45%, #000 55%, transparent 55%);
    background-size: 14px 14px; /* ×のサイズ */
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.2s;
}

.modal-close-text:hover {
    color: #333;
    background-color: rgba(0,0,0,0.05);
}

.modal-close-text:hover::before {
    background-color: #ccc;
    transform: rotate(90deg); /* ホバーでくるっと回る演出 */
}

#modal-search-results {
    margin-top: 10px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* =========================================
   カスタムカテゴリスタイル (特定カテゴリの装飾)
   ========================================= */

/* 「その他」などの特定の文字を小さく・少し細くする */
.text-small {
    font-size: 0.75em;
    font-weight: 500;
    color: inherit; /* 基本は親の色を引き継ぐ */
    opacity: 0.8;   /* 少し薄くする */
    margin-right: 2px;
}

/* 目立たなくするカテゴリ（マイナー）の背景色・文字色調整（※Level 2のみに限定） */
.accordion-card.level-2.category-minor {
    background-color: #bdcfdb; /* 少しグレーがかった控えめな色 */
    border-color: #e0e0e0;
}

.accordion-card.level-2.category-minor.is-open {
    background-color: #9bb7c9; /* 開いた時も控えめな色に */
    border-color: #d0d0d0;
}

/* タイトル文字の色を薄くする */
.accordion-card.level-2.category-minor > .accordion-header .accordion-title {
    color: #222;
    font-weight: 600; 
}

/* 右側の＋－アイコンの色も少し薄くする */
.accordion-card.level-2.category-minor > .accordion-header .accordion-toggle-icon::before,
.accordion-card.level-2.category-minor > .accordion-header .accordion-toggle-icon::after {
    background: #666;
}
.accordion-card.level-2.category-minor.is-open > .accordion-header .accordion-toggle-icon::before {
    background: #888;
}

/* --- END OF FILE css/library-common.css --- */