/* components.css - ボタン、モーダル、フォームなどの共通コンポーネント */

/* ========================================
   統一ボタンデザインシステム
   - サイズ: sm (小), md (中/デフォルト), lg (大)
   - カラー: primary, secondary, danger, success, outline
   - 一貫した border-radius: 8px
   ======================================== */

/* ========================================
   基本ボタンスタイル
   ======================================== */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    white-space: nowrap;
    min-width: 60px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.4;
}

.btn:focus {
    outline: 2px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* ========================================
   サイズバリエーション
   ======================================== */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    min-height: 32px;
}

.btn-md {
    padding: 10px 18px;
    font-size: 14px;
    min-height: 40px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    min-height: 48px;
}

/* ========================================
   プライマリボタン (紫グラデーション)
   ======================================== */
.btn-primary {
    background: var(--gradient-brand);
    color: white;
    box-shadow: 0 2px 4px rgba(168, 181, 245, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-primary) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 181, 245, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(168, 181, 245, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   ツールバーボタン（統一スタイル）
   - btn-add: 本を追加
   - btn-catalog: 一覧
   - btn-split: 分割
   すべて同じサイズ・形状・色調で統一
   ======================================== */
.btn-add,
.btn-catalog,
.btn-split {
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    min-width: 150px;
    min-height: 48px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    /* 統一カラー: プライマリグラデーション */
    background: var(--gradient-brand);
    color: white;
}

.btn-add:hover,
.btn-catalog:hover,
.btn-split:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(168, 181, 245, 0.4);
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-primary) 100%);
}

.btn-add:active,
.btn-catalog:active,
.btn-split:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(168, 181, 245, 0.3);
}

/* 保存ボタン（別スタイル - グリーン系） */
.btn-save {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    min-width: 120px;
    min-height: 44px;
    transition: all 0.2s ease;
}

.btn-save {
    background-color: var(--color-success-dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-save:hover:not(:disabled) {
    background-color: #5ab885;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(107, 199, 153, 0.3);
}

.btn-save:disabled {
    background-color: var(--color-success-dark);
    color: white;
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: auto; /* ツールチップ表示のため有効化 */
}

.btn-warning {
    background-color: var(--color-success-dark) !important;
    color: white !important;
    opacity: 0.5 !important;
    border: 2px dashed var(--color-success) !important;
    box-shadow: none !important;
}

.btn-warning:hover {
    background-color: var(--color-success-dark) !important;
    opacity: 0.6 !important;
}

/* カスタムツールチップ */
.custom-tooltip {
    position: fixed;
    display: block;
    background-color: #2D3748;
    color: white;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 999999;
    white-space: normal;
    max-width: min(532px, calc(100vw - 40px));  /* パディング32px分を考慮 */
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    box-sizing: border-box;
}

.custom-tooltip.fade-out {
    animation: tooltip-disappear 0.3s ease-out forwards;
}

@keyframes tooltip-appear {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes tooltip-disappear {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
}

/* btn-catalog, btn-add は上部で統一定義済み */

/* btn-cancelはbtn-secondaryのエイリアス */
.btn-cancel {
    background-color: #718096;
    color: white;
    box-shadow: 0 2px 4px rgba(113, 128, 150, 0.2);
}

.btn-cancel:hover {
    background-color: #4a5568;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(113, 128, 150, 0.3);
}

/* btn-deleteはbtn-dangerのエイリアス */
.btn-delete {
    background-color: #e53e3e;
    color: white;
    box-shadow: 0 2px 4px rgba(229, 62, 62, 0.2);
}

.btn-delete:hover {
    background-color: #c53030;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(229, 62, 62, 0.3);
}

/* aria-disabled のボタンは hover エフェクトを無効化 */
.btn-add[aria-disabled="true"],
.btn-add[aria-disabled="true"]:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* ========================================
   セカンダリボタン (グレー系)
   ======================================== */
.btn-secondary {
    background-color: #718096;
    color: white;
    box-shadow: 0 2px 4px rgba(113, 128, 150, 0.2);
}

.btn-secondary:hover {
    background-color: #4a5568;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(113, 128, 150, 0.3);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(113, 128, 150, 0.2);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   デンジャーボタン (赤系 - 削除など)
   ======================================== */
.btn-danger {
    background-color: #e53e3e;
    color: white;
    box-shadow: 0 2px 4px rgba(229, 62, 62, 0.2);
}

.btn-danger:hover {
    background-color: #c53030;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(229, 62, 62, 0.3);
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(229, 62, 62, 0.2);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   サクセスボタン (緑系 - 保存など)
   ======================================== */
.btn-success {
    background-color: var(--color-success-dark);
    color: white;
    box-shadow: 0 2px 4px rgba(72, 187, 120, 0.2);
}

.btn-success:hover:not(:disabled) {
    background-color: #38a169;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(72, 187, 120, 0.3);
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(72, 187, 120, 0.2);
}

.btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   アウトラインボタン (枠線のみ)
   ======================================== */
.btn-outline {
    background-color: transparent;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-outline:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.btn-outline:active {
    transform: translateY(0);
    background-color: #edf2f7;
}

.btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   ライトボタン (白背景/透明系)
   ======================================== */
.btn-light {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-light:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.btn-light:active {
    transform: translateY(0);
}

/* btn-split は上部で統一定義済み */

/* btn-export-excel は削除済み（保存時にxlsx選択可能なため不要）*/

.btn-undo,
.btn-redo {
    background-color: #718096;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-undo:hover:not(:disabled),
.btn-redo:hover:not(:disabled) {
    background-color: #4a5568;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(113, 128, 150, 0.3);
}

.btn-undo:disabled,
.btn-redo:disabled {
    background-color: #cbd5e0;
    color: #a0aec0;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-edit {
    background-color: #7c8fc7;
    color: white;
}

.btn-search {
    background-color: var(--color-primary);
    color: white;
    padding: 6px 12px;
    font-size: 14px;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.btn-search:hover {
    background-color: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.3);
}

.btn-download {
    background-color: #805ad5;
    color: white;
    margin-top: 10px;
    margin-left: 10px;
}

.btn-edit-book {
    background-color: var(--color-info-dark);
    color: white;
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

/* 編集モード時のボタンスタイルの統一 */
.edit-row .button-container {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.edit-row .button-container .btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    width: 110px !important;  /* !importantを追加 */
    min-width: 110px !important;
    max-width: 110px !important;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
    box-sizing: border-box;
    flex-shrink: 0;
}

.edit-row .button-container .btn-save {
    background-color: var(--color-success-dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.edit-row .button-container .btn-save:hover {
    background-color: #5ab885;
    transform: translateY(-1px);
}

.edit-row .button-container .btn-cancel {
    background-color: #718096;
    color: white;
}

.edit-row .button-container .btn-cancel:hover {
    background-color: #4a5568;
    transform: translateY(-1px);
}

.edit-row .button-container .btn-delete {
    background-color: #f56565;
    color: white;
}

.edit-row .button-container .btn-delete:hover {
    background-color: var(--color-error-dark);
    transform: translateY(-1px);
}

/* ボタンがアクティブ状態（押された時）の効果 */
.edit-row .button-container .btn:active {
    transform: scale(0.95);
}

/* Modal Dialog */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background-color: var(--color-bg-white);
    margin: 10% auto;
    padding: 15px;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: visible;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

/* Export Result Modal */
.export-result-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.export-result-content {
    background-color: white;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    overflow-y: auto;
}

.export-result-content h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 20px;
    text-align: center;
}

.export-result-content .export-info {
    background-color: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.export-result-content .file-list {
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    margin: 15px 0;
}

.export-result-content .file-list-item {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
    color: #4a5568;
    font-family: monospace;
    font-size: 13px;
}

.export-result-content .file-list-item:last-child {
    border-bottom: none;
}

.export-result-content .note {
    color: #718096;
    font-size: 13px;
    line-height: 1.6;
    margin-top: 15px;
    padding: 12px;
    background-color: #fef5e7;
    border-left: 3px solid #f39c12;
    border-radius: 4px;
}

.export-result-content .btn-close {
    background-color: var(--color-info-dark);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    width: 100%;
    transition: background-color 0.2s;
}

.export-result-content .btn-close:hover {
    background-color: #3182ce;
}

/* Initial Actions Styles */
.initial-actions {
    margin: 20px auto;
    display: flex;
    flex-direction: row; 
    gap: 20px;
    justify-content: center;
    width: 100%;
    max-width: 600px;
}

.file-input-button,
.btn-create {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    max-width: 250px;
    padding: 10px 16px;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    min-height: 40px;
    white-space: nowrap;
}

.file-operations-section .file-actions .file-input-button,
.file-operations-section .file-actions .btn-create,
.file-operations-section .file-actions .btn-save,
.file-operations-section .file-actions .btn-drive-primary,
.file-operations-section .file-actions .btn-drive-save {
    width: 100%;
    max-width: 250px;
    padding: 10px 16px;
    font-size: 14px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

/* Google Driveボタンの色設定 */
.btn-drive-primary {
    background-color: var(--color-info-dark);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-drive-primary:hover {
    background-color: #3182ce;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(66, 153, 225, 0.3);
}

.btn-drive-save {
    background-color: var(--color-success-dark);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-drive-save:hover:not(:disabled) {
    background-color: #38a169;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(72, 187, 120, 0.3);
}

.btn-drive-save:disabled {
    background-color: var(--color-success-dark);
    color: white;
    cursor: not-allowed;
    opacity: 0.5;
}

.file-input-button {
    background-color: var(--color-info-dark);
}

.file-input-button:hover {
    background-color: #3182ce;
    transform: translateY(-1px);
}

.btn-create {
    background-color: var(--color-success-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-create:hover {
    background-color: #38a169;
    transform: translateY(-1px);
}

.file-input {
    display: none !important;
}

/* Search Results Styles */
.search-results {
    max-height: 400px;
    overflow-y: auto;
    margin: 1em 0;
}

.search-result-item {
    padding: 1em;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f7fafc;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item h4 {
    margin: 0;
    color: #2d3748;
}

.search-result-item p {
    margin: 0.5em 0 0;
    color: #4a5568;
}

.search-result-item:focus {
    outline: 2px solid var(--color-info-dark);
    background-color: #f7fafc;
}

.click-guidance {
    color: #718096;
    font-size: 0.85em;
    margin-top: 0.5em;
    display: block;
}

/* アクションボタンエリアのレイアウト改善 */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* アクションボタン内のすべてのボタンのサイズを統一 */
.action-buttons .btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    min-width: 180px;
    width: 180px;
    min-height: 44px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    .btn-save,
    .btn-catalog,
    .btn-add,
    .btn-split {
        padding: 10px 20px;
        font-size: 15px;
        min-width: 100px;
        min-height: 40px;
    }

    .action-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 20px auto;
    }

    .action-buttons .btn {
        width: 100%;
    }

    /* モバイル時の編集モードボタン */
    .edit-row .button-container {
        flex-wrap: wrap;
        gap: 6px;
    }

    .edit-row .button-container .btn {
        padding: 6px 12px;
        font-size: 13px;
        width: 90px;
        min-width: 90px;
        height: 32px;
    }

    /* カスタムツールチップ（タブレット対応） */
    .custom-tooltip {
        max-width: min(400px, calc(100vw - 40px));
    }
}

@media screen and (max-width: 480px) {
    /* カスタムツールチップ（スマホ対応） */
    .custom-tooltip {
        font-size: 13px;
        padding: 8px 12px;
        max-width: calc(100vw - 30px);
    }
}

@media screen and (max-width: 640px) {
    .btn-save,
    .btn-catalog,
    .btn-split {
        padding: 10px 20px;
        font-size: 15px;
        min-width: 100px;
        min-height: 40px;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 20px auto;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

/* ファイル操作セクションとセクションタイトルのスタイルはdrive-styles.cssで定義 */

/* file-actionsのレイアウト設定 */
.file-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ========================================
   検索メニュー（ドロップダウン）
   ======================================== */
.book-search-menus {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-menu-item {
    position: relative;
}

.search-menu-button {
    width: 100%;
    padding: 10px 15px;
    background: var(--gradient-brand);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-menu-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.search-menu-button:active {
    transform: translateY(0);
}

.menu-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.search-submenu.active + .search-menu-button .menu-arrow,
.search-menu-button:hover .menu-arrow {
    transform: rotate(180deg);
}

.search-submenu {
    display: none;
    flex-direction: column;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-top: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 100;
}

.search-submenu.active {
    display: flex;
}

.search-submenu a {
    padding: 12px 15px;
    color: #2d3748;
    text-decoration: none;
    border-bottom: 1px solid #f7fafc;
    transition: background-color 0.2s ease;
    font-size: 14px;
}

.search-submenu a:last-child {
    border-bottom: none;
}

.search-submenu a:hover {
    background-color: #edf2f7;
    color: var(--color-primary);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .search-menu-button {
        font-size: 13px;
        padding: 8px 12px;
    }

    .search-submenu a {
        font-size: 13px;
        padding: 10px 12px;
    }
}

/* ========================================
   最近使ったファイル (MRU)
   ======================================== */

.recent-files-section {
    margin-top: 16px;
    padding: 12px;
    background-color: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.recent-files-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mru-help-text {
    background-color: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #1e40af;
    display: flex;
    align-items: center;
    line-height: 1.5;
}

.mru-help-text i {
    flex-shrink: 0;
}

.mru-help-text span {
    flex: 1;
}

.recent-files-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 6px;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.recent-file-item:hover {
    background-color: #edf2f7;
    border-color: #cbd5e0;
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.recent-file-item:active {
    transform: translateX(2px);
}

.recent-file-info {
    flex: 1;
    min-width: 0;
}

.recent-file-name {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.recent-file-date {
    font-size: 12px;
    color: #718096;
}

.recent-file-remove {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.recent-file-remove:hover {
    background-color: #fed7d7;
    color: #e53e3e;
}

/* MRUフォルダヘッダー */
.mru-folder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 6px;
    margin-top: 12px;
}

.mru-folder-header:first-child {
    margin-top: 0;
}

.mru-folder-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.mru-folder-icon {
    font-size: 16px;
}

.mru-folder-name {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.mru-folder-count {
    font-size: 12px;
    color: #718096;
    background-color: #e2e8f0;
    padding: 2px 8px;
    border-radius: 12px;
}

.mru-folder-remove {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mru-folder-remove:hover {
    background-color: #fed7d7;
    color: #e53e3e;
}

/* ファイル選択モーダル */
.file-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.file-selection-window {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.file-selection-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.file-selection-header h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #2d3748;
}

.file-selection-header p {
    margin: 0;
    font-size: 14px;
    color: #718096;
}

.file-selection-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.file-selection-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-selection-item:hover {
    background-color: #edf2f7;
    border-color: #cbd5e0;
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.file-selection-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-selection-name {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
}

.file-selection-meta {
    font-size: 12px;
    color: #718096;
}

.file-selection-footer {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.btn-cancel {
    padding: 8px 16px;
    background-color: #e2e8f0;
    color: #2d3748;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background-color: #cbd5e0;
}

.btn-add-folder {
    padding: 8px 16px;
    background-color: var(--color-info-dark);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-add-folder:hover {
    background-color: #3182ce;
}

.btn-mru {
    padding: 8px 16px;
    background-color: var(--color-info-dark);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-mru:hover {
    background-color: #3182ce;
}

/* MRUモーダル */
.mru-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.mru-modal-window {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.mru-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mru-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #2d3748;
}

.mru-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #a0aec0;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mru-modal-close:hover {
    background-color: #edf2f7;
    color: #2d3748;
}

.mru-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.mru-file-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mru-file-item:hover {
    background-color: #edf2f7;
    border-color: #cbd5e0;
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mru-file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mru-file-name {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
}

.mru-file-date {
    font-size: 12px;
    color: #718096;
}

.mru-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
}

.btn-clear-all {
    padding: 8px 16px;
    background-color: #fed7d7;
    color: #e53e3e;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-clear-all:hover {
    background-color: #feb2b2;
}

.no-recent-files {
    padding: 12px;
    text-align: center;
    color: #a0aec0;
    font-size: 13px;
    font-style: italic;
}

.btn-clear-history {
    margin-top: 10px;
    width: 100%;
    padding: 8px 12px;
    background-color: #e2e8f0;
    color: #4a5568;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-clear-history:hover {
    background-color: #cbd5e0;
    border-color: #a0aec0;
}

/* File System Access API非対応時の注意書き */
.mru-fallback-notice {
    padding: 10px;
    background-color: #fef5e7;
    border: 1px solid #f9e79f;
    border-radius: 6px;
    font-size: 13px;
    color: #7d6608;
    margin-top: 8px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .recent-files-section {
        padding: 10px;
    }

    .recent-file-item {
        padding: 8px 10px;
    }

    .recent-file-name {
        font-size: 13px;
    }

    .recent-file-date {
        font-size: 11px;
    }
}

/* ========================================
   自照式ボタン（Illuminated Push Button）
   ======================================== */

/* 自照式ボタン - 基本スタイル */
.illuminated-button {
    position: relative;
    min-width: 80px;
    height: 80px;
    padding: 0 10px;
    background: linear-gradient(145deg, #999, #888);
    border-radius: 8px;
    box-shadow:
        inset 1px 1px 2px rgba(0, 0, 0, 0.3),
        inset -1px -1px 2px rgba(150, 150, 150, 0.3),
        2px 2px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

/* ボタン本体（押せる部分） */
.button-body {
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: linear-gradient(145deg, #aaa, #999);
    border-radius: 6px;
    box-shadow:
        1px 1px 2px rgba(0, 0, 0, 0.2),
        inset -1px -1px 1px rgba(0, 0, 0, 0.2),
        inset 1px 1px 1px rgba(180, 180, 180, 0.3);
    transition: all 0.1s ease;
}

/* 照明窓 */
.button-window {
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    background: #888;
    border-radius: 4px;
    box-shadow:
        inset 1px 1px 2px rgba(0, 0, 0, 0.3),
        inset -1px -1px 1px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* 照明部分 */
.button-light {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    opacity: 1;
    transition: all 0.3s ease;
}

/* ラベルテキスト */
.button-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: bold;
    color: #000;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
    pointer-events: none;
    z-index: 1;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

/* 点灯時のラベル - 青ボタン */
.illuminated-button.blue.on .button-label {
    color: #000;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

/* 白ボタンのラベル - OFF時 */
.illuminated-button.white .button-label {
    color: #000;
}

/* 点灯時のラベル - 白ボタン */
.illuminated-button.white.on .button-label {
    color: #000;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

/* 押下時 */
.illuminated-button:active .button-body {
    top: 3px;
    box-shadow:
        0px 1px 1px rgba(0, 0, 0, 0.2),
        inset -1px -1px 1px rgba(0, 0, 0, 0.2);
}

/* ホバー時に一時的にOn状態 */
.illuminated-button:hover .button-light {
    opacity: 0.7;
}

/* オン状態 */
.illuminated-button.on .button-light {
    opacity: 1;
}

/* オン状態でホバー時 */
.illuminated-button.on:hover .button-light {
    opacity: 1;
}

/* カラーバリエーション - 赤 */
.illuminated-button.red:hover .button-light,
.illuminated-button.red.on .button-light {
    background: radial-gradient(circle, #ff6666 0%, #ff3333 50%, #cc0000 100%);
    box-shadow:
        0 0 10px rgba(255, 51, 51, 0.8),
        0 0 20px rgba(255, 51, 51, 0.4),
        inset 0 0 10px rgba(255, 100, 100, 0.5);
}

/* カラーバリエーション - 緑（パステル調に変更） */
.illuminated-button.green:hover .button-light,
.illuminated-button.green.on .button-light {
    background: radial-gradient(circle, #99ff99 0%, #66ff66 50%, #33cc33 100%);
    box-shadow:
        0 0 10px rgba(102, 255, 102, 0.8),
        0 0 20px rgba(102, 255, 102, 0.4),
        inset 0 0 10px rgba(153, 255, 153, 0.5);
}

/* カラーバリエーション - 青（パステル調に変更） */
.illuminated-button.blue:hover .button-light,
.illuminated-button.blue.on .button-light {
    background: radial-gradient(circle, #9999ff 0%, #6666ff 50%, #3333cc 100%);
    box-shadow:
        0 0 10px rgba(102, 102, 255, 0.8),
        0 0 20px rgba(102, 102, 255, 0.4),
        inset 0 0 10px rgba(153, 153, 255, 0.5);
}

/* カラーバリエーション - 黄 */
.illuminated-button.yellow:hover .button-light,
.illuminated-button.yellow.on .button-light {
    background: radial-gradient(circle, #ffff66 0%, #ffff33 50%, #cccc00 100%);
    box-shadow:
        0 0 10px rgba(255, 255, 51, 0.8),
        0 0 20px rgba(255, 255, 51, 0.4),
        inset 0 0 10px rgba(255, 255, 100, 0.5);
}

/* カラーバリエーション - 白 */
.illuminated-button.white:hover .button-light,
.illuminated-button.white.on .button-light {
    background: radial-gradient(circle, #ffffff 0%, #f0f0f0 50%, #d0d0d0 100%);
    box-shadow:
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(255, 255, 255, 0.4),
        inset 0 0 10px rgba(255, 255, 255, 0.5);
    opacity: 1;
}

/* ドロップダウンメニュー内の自照式ボタン */
.illuminated-button.dropdown-item .button-label {
    color: #ccc !important;
}

.illuminated-button.blue.on.dropdown-item .button-label {
    color: #fff !important;
}

.illuminated-button.white.dropdown-item .button-label {
    color: #666 !important;
}

.illuminated-button.white.on.dropdown-item .button-label {
    color: #000 !important;
}

/* ========================================
   編集モーダルの自照式ボタン
   ======================================== */
#editRecordModal .illuminated-button {
    height: 60px;
    min-width: 100px;
    border: none !important;
    padding: 0 !important;
}

#editRecordModal .illuminated-button .button-label {
    font-size: 13px !important;
    white-space: nowrap;
}

/* ========================================
   本の情報編集時の自照式ボタン
   ======================================== */
.book-info-buttons .illuminated-button.edit-book-btn {
    height: 60px;
    min-width: 100px;
    border: none !important;
    padding: 0 !important;
}

.book-info-buttons .illuminated-button.edit-book-btn .button-label {
    font-size: 14px !important;
    white-space: nowrap;
}

/* ========================================
   検索ボタン（本のヘッダー）
   ======================================== */
.book-header-buttons .illuminated-button.search-book-btn {
    height: 50px;
    min-width: 90px;
    border: none !important;
    padding: 0 !important;
}

.book-header-buttons .illuminated-button.search-book-btn .button-label {
    font-size: 14px !important;
    white-space: nowrap;
}

/* ========================================
   新規作成時の自照式ボタン
   ======================================== */
.book-info-buttons .illuminated-button.new-book-btn {
    height: 60px;
    min-width: 100px;
    border: none !important;
    padding: 0 !important;
}

.book-info-buttons .illuminated-button.new-book-btn .button-label {
    font-size: 14px !important;
    white-space: nowrap;
}

/* ========================================
   ヘッダーの自照式ボタン（設定・ログアウト）
   ======================================== */
.illuminated-button.header-btn {
    height: 40px;
    width: 140px;
    min-width: 140px;
    border: none !important;
    padding: 0 !important;
}

.illuminated-button.header-btn .button-label {
    font-size: 14px !important;
    white-space: nowrap;
}

/* ========================================
   言語セレクタ
   ======================================== */
.lang-switch {
    position: absolute;
    top: 20px;
    right: 20px;
}

.lang-switch select {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-switch select:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lang-switch select option {
    background: #2d3748;
    color: white;
}