@charset "utf-8";
/* CSS Document */

/* 基本設定 */
html {
    overflow-y: scroll;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* スクロールバーのスタイル */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 基本要素のスタイル */
a {
    color: #0B0B0B;
    text-decoration: none;
}

a:hover {
    color: #333;
}

/* ユーティリティクラス */
.hidden {
    display: none;
}

.error {
    color: red;
    font-size: -1;
}

.hover-background:hover {
    background: #f5f5f5;
}

.background-discontinued {
    background: #d6d6d6;
}

.text-underline {
    text-decoration: underline;
}

.hover-underline:hover {
    text-decoration: underline;
}

.small-font {
    padding: 5px 0;
    font-size: 8px;
}

/* レイアウト要素 */
#scrollTopButton {
    position: fixed;
    bottom: 15%;
    right: 5%;
    cursor: pointer;
    max-width: 40px;
    min-width: 10px;
}

.fixed-bottom {
    position: fixed;
    right: 0;
    left: 0;
    z-index: 1030;
}

/* フッター関連 */
.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 30px;
    background-color: #f5f5f5;
}

.footer-contents {
    position: absolute;
    bottom: 0;
    padding: 10%;
    width: 100%;
    height: 120px;
}

/* ロゴ関連 */
#dsjpLogo img {
    max-width: 150px;
    min-width: 100px;
}

#supporter-logo {
    bottom: 30px;
    height: 55px;
    background-color: #ffffff;
}

/* 検索関連 */
.search-button {
    display: inline-flex;
    align-items: center;
    padding: 5px;
    border: 2px solid black;
    border-radius: 10px;
    background-color: white;
    cursor: pointer;
    font-size: 16px;
}

.search-button:hover {
    border: 2px solid black;
    background-color: #f5f5f5;
}

/* フォーム関連 */
.centered-form {
    min-width: 320px;
    max-width: 60%;
    margin: 50px auto;
}

.form-check-label {
    text-align: left;
}

/* 結果表示関連 */
.results-container {
    max-width: 1400px;
    margin: 0 auto;
}

.result-list {
    margin: 0 0 80px 0;
}

.result-space {
    width: 1%;
    white-space: nowrap;
}

.result-space-product_name {
    width: 100%;
    white-space: nowrap;
}

/* アイコン関連 */
.icon-sort {
    width: 18px;
    height: 18px;
}

.icon-substitute,
.icon-package,
.icon-remarks,
.icon-search,
.icon-standard,
.icon-bookmark,
.icon-blank,
.icon-file {
    width: 22px;
    height: 22px;
}

.icon-standard {
    margin: 0 5px 0 0;
}

.icon-menu {
    max-width: 30px;
    height: auto;
}

.icon-menu img {
    width: 100%;
}

.company-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin-bottom: 5px;
}

/* カード関連 */
.hover-card {
    transition: all 0.3s ease;
    border-color: #e9ecef;
    margin: 0.5rem 0.25rem;
}

.hover-card:hover {
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.1)!important;
    border-color: #dee2e6;
}

/* 製品情報 */
.product-title {
    font-size: 1.25rem;
    font-weight: 500;
}

/* 製品リンク */
.product-link {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-link:hover {
    color: #34495e;
    text-decoration: underline;
}

/* ステータス表示 */
.normal,
.limited,
.stop,
.discontinued,
.transfer,
.unannounced,
.state-blank {
    text-wrap: nowrap;
    padding: 0.25rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
    color: white;
}

.normal { background-color: #8cc580!important; }
.limited { background-color: #f7c36f!important; }
.stop { background-color: #f07171!important; }
.discontinued { background-color: #333333!important; }
.transfer { background-color: #7399c9!important; }
.unannounced {
    background-color: #ffffff!important;
    border: 1px solid black;
    color: black;
}

/* 日付表示 */
.date-item {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
}

.date-label {
    font-size: 0.875rem;
    white-space: nowrap;
}

.date-value {
    font-weight: 500;
    white-space: nowrap;
}

/* 分類ボックス */
.classification-box {
    padding: 0.25rem 0.5rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    width: fit-content;
    max-width: 200px;
    height: fit-content;
}

/* レスポンシブ設定 */
@media (max-width: 1280px) {
    .responsive-size-text,
    .responsive-size-text .product-title,
    .responsive-size-text .date-label,
    .responsive-size-text .date-value,
    .responsive-size-text .price-info,
    .responsive-size-text .company-info,
    .responsive-size-text .badge,
    .responsive-size-text .price-info .text-muted,
    .responsive-size-text .price-info .fw-medium,
    .responsive-size-text .badge.bg-info,
    .responsive-size-text .badge.bg-secondary,
    .date-label,
    .date-value {
        font-size: 0.8rem;
    }

    .normal,
    .limited,
    .stop,
    .discontinued,
    .transfer,
    .unannounced,
    .classification-box {
        font-size: 0.7rem;
        font-weight: 400;
    }
    .badge.bg-info {
        font-weight: 400;
    }
    .badge.bg-secondary {
        font-weight: 400;
    }   

    /* 薬価のフォントサイズ調整 */
    .responsive-size-text .price-info .fw-medium {
        font-size: 0.8rem;
    }

    /* バッジのサイズ調整 */
    .responsive-size-text .badge {
        padding: 0.25em 0.5em;
    }
}

/* さらに小さい画面サイズの場合 */
@media (max-width: 768px) {
    .responsive-size-text,
    .responsive-size-text .product-title,
    .responsive-size-text .price-info,
    .responsive-size-text .price-info .text-muted,
    .responsive-size-text .price-info .fw-medium,
    .responsive-size-text .badge.bg-info,
    .responsive-size-text .badge.bg-secondary {
        font-size: 0.75rem;
    }
}

/* 製品種別バッジのスタイル */
/* 先発品用 */
.badge.bg-info[data-bs-title*="先発品"] {
    background-color: #4a6fa5!important;  /* 深みのある青 */
}

/* 準先発品用 */
.badge.bg-info[data-bs-title*="準先発品"] {
    background-color: #4789a0!important;  /* 青とターコイズの中間色 */
}

/* 後発品用 */
.badge.bg-info[data-bs-title*="後発品"] {
    background-color: #45b7af!important;  /* ターコイズブルー */
}

/* AG用 */
.badge.bg-secondary[data-bs-title*="AG"] {
    background-color: #9b59b6!important;  /* 紫系 */
}

/* 選定療養用 */
.badge.bg-secondary[data-bs-title*="選定療養品"] {
    background-color: #cd853f!important;  /* ペルー色（茶系） */
}

/* 参考：既存のステータス色
.normal { background-color: #8cc580!important; }  // 緑
.limited { background-color: #f7c36f!important; } // オレンジ
.stop { background-color: #f07171!important; }    // 赤
.discontinued { background-color: #333333!important; } // 黒
.transfer { background-color: #7399c9!important; }    // 青
*/

/* バッジのホバー効果 */
.badge {
    transition: opacity 0.2s ease;
}

.badge:hover {
    opacity: 0.9;
}

/* バッジ共通スタイル */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-right: 0.25rem;
}

/* マークボタンのスタイル */
.bookmark-button {
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.bookmark-button:hover {
    transform: scale(1.2);
}

.bookmark-button:focus {
    outline: none;
}

/* 薬価表示のスタイル */
.price-info {
    color: #2c3e50;
    display: flex;
    align-items: center;
    white-space: nowrap;
    padding-right: 1rem;
    border-right: 1px solid #dee2e6;
    margin-right: 1rem;
}

.price-info .fw-medium {
    color: #2c3e50;
    font-size: 0.9rem;
    font-weight: 500;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .d-flex.align-items-center.gap-3 {
        flex-wrap: wrap;
        gap: 0.5rem!important;
    }

    .price-info {
        border-right: none;
        padding-right: 0;
        margin-right: 0;
        width: 100%;
    }
    
    .price-info .fw-medium {
        font-size: 0.85rem;
    }
}

/* カードフッターのスタイル */
.card-footer {
    background-color: #fff;
    border-top: 1px solid #dee2e6;
    padding: 0.75rem 1.25rem;
    margin-top: 0;
}

.card-footer .d-flex {
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.icon-standard {
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease;
    vertical-align: middle;
    display: inline-block;
    margin: 0;
}

.card-footer a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin: 0;
}

.icon-standard:hover {
    transform: scale(1.1);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .card-footer {
        padding: 0.5rem 1rem;
        margin-top: 0.5rem;
    }
    
    .card-footer .d-flex {
        justify-content: flex-start!important;
        gap: 0.75rem;
    }
}

/* 会社情報のスタイル調整 */
.company-info {
    margin-bottom: 0;  /* 下部マージンを削除 */
}

.company-info.small {
    line-height: 1.2;  /* 行間を少し詰める */
}

/* カードボディのスタイル調整 */
.card-body {
    padding-bottom: 0.5rem;  /* カードボディの下部パディングを少し詰める */
}

/* カードフッターのスタイル */
.card-footer {
    background-color: #fff;
    border-top: 1px solid #dee2e6;
    padding: 0.75rem 1.25rem;
    margin-top: 0;  /* 上部マージンを削除 */
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    /* 日付情報のレイアウト */
    .d-flex.gap-2.align-items-center {
        flex-direction: column;
        align-items: flex-start!important;
        gap: 0.5rem!important;
    }

    .date-item {
        width: 100%;
        padding: 0.25rem 0;
    }

    /* 会社情報のレイアウト */
    .company-info.small.d-flex {
        flex-direction: column;
        gap: 0.5rem!important;
    }

    .company-info .d-flex.align-items-center {
        width: 100%;
    }

    /* 薬価とバッジのレイアウト - 横並びを維持 */
    .d-flex.align-items-center.gap-3 {
        flex-wrap: nowrap;  /* 折り返しを防止 */
        overflow-x: auto;   /* 横スクロール可能に */
        gap: 0.5rem!important;
        padding-bottom: 0.25rem;  /* スクロールバー用の余白 */
        -webkit-overflow-scrolling: touch;  /* スムーズスクロール */
        scrollbar-width: none;  /* Firefoxのスクロールバーを非表示 */
    }

    /* Chromeのスクロールバーを非表示 */
    .d-flex.align-items-center.gap-3::-webkit-scrollbar {
        display: none;
    }

    /* 薬価情報 */
    .price-info {
        flex-shrink: 0;  /* 縮小を防止 */
        white-space: nowrap;
        border-right: none;  /* 区切り線を非表示 */
        padding-right: 0.5rem;
        margin-right: 0.5rem;
    }

    /* バッジグループ */
    .d-flex.align-items-center.gap-2 {
        flex-shrink: 0;  /* 縮小を防止 */
        white-space: nowrap;
    }

    /* バッジのスタイル調整 */
    .badge {
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* カードフッター */
    .card-footer {
        padding: 0.5rem 1rem;
    }

    .card-footer .d-flex {
        gap: 0.75rem;
    }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    /* 日付情報のレイアウト */
    .d-flex.gap-2.align-items-center {
        flex-direction: column;
        align-items: flex-start!important;
        gap: 0.5rem!important;
    }

    .date-item {
        width: 100%;
        padding: 0.25rem 0;
    }

    /* ステータス表示は横並びを維持 */
    .d-flex.align-items-center.gap-2.mb-3 {
        flex-wrap: wrap;
        gap: 0.5rem!important;
        margin-bottom: 0.5rem!important;  /* マージンを調整 */
    }

    /* 会社情報のレイアウト */
    .company-info.small.d-flex {
        flex-direction: column;
        gap: 0.5rem!important;
    }

    .company-info .d-flex.align-items-center {
        width: 100%;
    }

    /* 薬価とバッジのレイアト */
    .d-flex.align-items-center.gap-3 {
        display: flex!important;
        flex-wrap: wrap;
        gap: 0.5rem!important;
        margin-bottom: 0.5rem!important;  /* マージンを調整 */
    }

    /* 薬価情報 */
    .price-info {
        border-right: none;
        padding-right: 0.5rem;
        margin-right: 0;
        width: auto;  /* 幅を自動に */
    }

    /* バッジグループ */
    .d-flex.align-items-center.gap-2 {
        display: flex!important;
        flex-wrap: wrap;
        gap: 0.25rem!important;
    }

    /* バッジのスタイル調整 */
    .badge {
        display: inline-block;
        margin-right: 0.25rem;
        margin-bottom: 0.25rem;
    }

    /* カードフタ */
    .card-footer {
        padding: 0.5rem 1rem;
        margin-top: 0;  /* 上部マージンを削除 */
    }

    .card-footer .d-flex {
        gap: 0.75rem;
    }

    /* カードボディのパディング調整 */
    .card-body {
        padding: 0.75rem 1rem;  /* パディングを調整 */
    }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    /* カードヘッダーのレイアウト */
    .card-header .d-flex.gap-2.align-items-center {
        flex-direction: row;  /* 横並びを維持 */
        align-items: center!important;
        gap: 1rem!important;
    }

    /* ブックマークボタン */
    .bookmark-button {
        flex-shrink: 0;  /* サイズ維持 */
    }

    /* 日付情報コンテナ */
    .date-container {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    /* 日付アイテム */
    .date-item {
        padding: 0;
        width: auto;
    }

    /* 会社情報のレイアウト */
    .company-info.small.d-flex {
        flex-direction: column;
        gap: 0.5rem!important;
    }

    .company-info .d-flex.align-items-center {
        width: 100%;
    }

    /* カードフッター */
    .card-footer {
        padding: 0.5rem 1rem;
        margin-top: 0;
    }

    .card-footer .d-flex {
        gap: 0.75rem;
    }

    /* カードボディのパディング調整 */
    .card-body {
        padding: 0.75rem 1rem;
    }
}

/* 販売中止済みの包装形態アイテムのスタイル */
.package-form-item.discontinued {
    opacity: 0.75;  /* 透明度を調整 */
    filter: saturate(60%) brightness(90%);  /* 彩度と明度を調整 */
}

/* 包装形態内のリンクスタイル */
.package-form-item .text-white a {
    text-decoration: none;
    color: white;
}

.package-form-item .text-white a:hover {
    text-decoration: underline;
}

/* 表示切替スイッチのスタイル */
.form-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 0.25rem 0.75rem;  /* パディングを縮小 */
    border-radius: 1.5rem;     /* 角丸を調整 */
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.form-switch .form-check-input {
    position: relative;
    width: 2.75em;            /* 幅を縮小 */
    height: 1.25em;           /* 高さを縮小 */
    margin: 0;
    background-image: none;
    background-color: #e9ecef;
    border: none;
    border-radius: 1.5em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* スイッチのつまみ部分 */
.form-switch .form-check-input:before {
    content: '';
    position: absolute;
    width: 1em;              /* まみのサイを縮小 */
    height: 1em;             /* つまみのサイズを縮小 */
    border-radius: 50%;
    background-color: #6c757d;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);  /* 影を軽く */
    top: 0.125em;
    left: 0.125em;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-switch .form-check-input:checked:before {
    transform: translateX(1.5em);  /* 移動距離を調整 */
}

/* ベルのスタイル */
.form-switch .form-check-label {
    cursor: pointer;
    font-size: 0.75rem;      /* フォントサイズを縮小 */
    color: #6c757d;
    transition: color 0.2s ease;
}

/* アクティブなラベルのスタイル */
.form-switch .form-check-input:not(:checked) ~ .form-check-label:first-of-type,
.form-switch .form-check-input:checked ~ .form-check-label:last-of-type {
    color: #212529;
    font-weight: 500;
}

/* ホバー効果 */
.form-switch:hover {
    background: #e9ecef;
}

.form-switch:hover .form-check-input:before {
    background-color: #495057;
}

/* フォーカス時のスタイル */
.form-switch .form-check-input:focus {
    box-shadow: none;
    border: none;
}

.form-switch .form-check-input:focus:before {
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.25);
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .form-switch {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .form-switch .form-check-input {
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .form-switch .form-check-input:before {
        background-color: #adb5bd;
    }
    
    .form-switch .form-check-label {
        color: rgba(255, 255, 255, 0.6);
    }
    
    .form-switch .form-check-input:not(:checked) ~ .form-check-label:first-of-type,
    .form-switch .form-check-input:checked ~ .form-check-label:last-of-type {
        color: rgba(255, 255, 255, 0.9);
    }
}

/* 表示切替と件数選択のレスポンシブ対応 */
@media (max-width: 768px) {
    .form-check.form-switch {
        justify-content: flex-start;
        margin-bottom: 0.5rem;
    }

    #perPageForm {
        width: 100%;
    }

    #perPageForm .input-group {
        width: 100%;
        max-width: 200px;
    }

    .input-group-text {
        font-size: 0.875rem;
    }

    #perPageSelect {
        font-size: 0.875rem;
    }
}

/* スイッチのマージン調整 */
.form-check-input.mx-2 {
    margin-left: 0.75rem !important;
    margin-right: 0.75rem !important;
}

/* 表示件数セレクトのスタイル */
.input-group-sm {
    min-width: 140px;
}

/* 情報アイコンのスタイル */
.info-icon-wrapper {
    display: flex;
    align-items: center;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.package-form-item:hover .info-icon-wrapper {
    opacity: 1;
}

/* パッケージテキストのスタイル調整 */
.package-text {
    margin-right: 1rem;  /* 右側のアイコングループとの間隔を確保 */
}

/* ブックマークバッジの位置調整 */
.bookmark-badge {
    display: flex;
    align-items: center;
    padding: 2px;
    flex-shrink: 0;  /* サイズを固定 */
}

.bookmark-badge img {
    width: 16px;
    height: 16px;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.bookmark-badge img[src*="blank"] {
    opacity: 0.5;
}

/* 包装形態アイテム内の間隔調整 */
.package-form-item .d-flex {
    gap: 0.5rem;  /* アイコン間の間隔を調整 */
}

/* 右側のアイコングループの調整 */
.package-form-item .d-flex .d-flex.align-items-center {
    margin-left: auto;  /* 右寄せ */
    gap: 0.5rem;  /* アイコン間の間隔 */
}

/* 包装形態アイテムのスタイル */
.package-form-item {
    min-width: 150px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
    cursor: pointer;
    z-index: 1;
    overflow: hidden;
}

/* 未告知状態の包装形態アイテムのスタイル */
.package-form-item.unannounced { 
    border: 1px solid #333; /* 黒枠を追加 */
}

/* ホバー時のスタイル */
.package-form-item.unannounced:hover { 
    background-color: #e6e6e6; 
    border: 1px solid #333; /* ホバー時も黒枠を維持 */
}

/* 未告知状態の場合の情報アイコン背景色調整 */
.package-form-item.unannounced:hover .info-icon-wrapper {
    background: rgba(230, 230, 230, 0.9);
}

/* 包装形態コンテナのスタイル */
.package-forms-container {
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

/* ポップオーバーのカスタマイズ */
.popover {
    --bs-popover-max-width: 280px;
    --bs-popover-border-color: #dee2e6;
    --bs-popover-border-radius: 0.5rem;
    --bs-popover-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    font-size: 0.875rem;
}

.popover-body {
    padding: 0.75rem;
    color: #333;
    background-color: #fff;
}

.package-info-popover {
    font-size: 0.875rem;
    line-height: 1.4;
}

.package-info-popover div {
    margin-bottom: 0.5rem;
    color: #333;
}

.package-info-popover div:last-child {
    margin-bottom: 0;
}

.package-info-popover .text-muted {
    color: #6c757d !important;
    font-weight: 500;
    min-width: 4em;
    display: inline-block;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .package-form-item {
        min-width: 150px;
    }
    
    .info-icon-wrapper {
        padding: 3px;
    }
}

/* モーダル関連のスタイル */
.package-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998;
}

.package-overlay.active {
    opacity: 1;
    visibility: visible;
}

.package-form-item.expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 85%;  /* デフォルトの幅を85%に */
    max-width: 500px;  /* 最大幅を設定 */
    max-height: 90vh;
    background: white !important;
    z-index: 9999;
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    padding: 32px;
    opacity: 0;
    visibility: hidden;
    cursor: default;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* モバイル用の調整 */
@media (max-width: 768px) {
    .package-form-item.expanded {
        width: 85%;  /* モバイルでも85%を維持 */
        max-width: 400px;  /* モバイル用の最大幅を設定 */
        padding: 24px 20px;
    }
}

/* さらに小さい画面用 */
@media (max-width: 375px) {
    .package-form-item.expanded {
        width: 90%;  /* より小さい画面では少し広めに */
        max-width: 350px;  /* さらに小さい画面用の最大幅 */
        padding: 20px 16px;
    }
}

/* スクロールバーのスタイリング */
.package-form-item.expanded::-webkit-scrollbar {
    width: 8px;
}

.package-form-item.expanded::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.package-form-item.expanded::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.package-form-item.expanded::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* 小さ画面用の調整 */
@media (max-height: 600px) {
    .package-form-item.expanded {
        top: 5vh;
        max-height: 85vh;
        margin-bottom: 60px;
    }
}

.package-form-item.expanded.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* モーダルコンテンツのスタイル */
.package-expanded-content {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.package-expanded-content.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.package-expanded-content .product-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.package-expanded-content .general-name {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.package-expanded-content .package-info {
    font-size: 1.1rem;
    color: #1a1a1a;
    margin-bottom: 2rem;
}

/* 情報グリッド */
.info-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.info-item {
    display: flex;
    align-items: baseline;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.info-label {
    min-width: 100px;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.info-value {
    color: #333;
    flex: 1;
}

/* 詳細リンク */
.detail-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: #f0f7ff;
    color: #2563eb;
    border-radius: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.detail-link:hover {
    background: #e0f0ff;
    transform: translateY(-1px);
}

.detail-link::after {
    content: '→';
    font-size: 1.1em;
}

/* 閉じるボタン */
.package-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}

.package-close-btn::before,
.package-close-btn::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background: #666;
    left: 8px;
    top: 15px;
}

.package-close-btn::before {
    transform: rotate(45deg);
}

.package-close-btn::after {
    transform: rotate(-45deg);
}

.package-close-btn:hover {
    background: #eeeeee;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .package-form-item.expanded {
        padding: 24px 20px;  /* 左右のパディングを少縮小 */
        width: 95%;
    }

    .package-expanded-content {
        padding-top: 20px;  /* 閉じるボタンのためのスペース確保 */
    }

    .package-expanded-content .product-title {
        font-size: 1.1rem;  /* さらに少し小さく */
        line-height: 1.3;
        padding-right: 40px;  /* 閉じるボタンのためのスペース */
        margin-bottom: 0.75rem;
    }

    .package-expanded-content .general-name {
        font-size: 0.875rem;
    }

    .package-expanded-content .package-info {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .package-close-btn {
        top: 16px;  /* 上部の位置を調整 */
        right: 16px;
        width: 28px;  /* サイズを少し小さく */
        height: 28px;
    }

    .info-item {
        flex-direction: column;
        gap: 0.25rem;
    }

    .info-label {
        min-width: auto;
        font-size: 0.85rem;
    }

    .info-value {
        font-size: 0.95rem;
    }

    .detail-link {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
}

/* さらに小さい画面サイズ用 */
@media (max-width: 375px) {
    .package-form-item.expanded {
        padding: 20px 16px;
    }

    .package-expanded-content .product-title {
        font-size: 1rem;
        padding-right: 32px;
    }

    .package-close-btn {
        top: 12px;
        right: 12px;
    }
}

/* ステースバッジのスタイル */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
}

.status-badge.normal { background-color: #8cc580; }
.status-badge.limited { background-color: #f7c36f; }
.status-badge.stop { background-color: #f07171; }
.status-badge.discontinued { background-color: #333333; }
.status-badge.transfer { background-color: #7399c9; }
.status-badge.unannounced {
    background-color: #ffffff;
    border: 1px solid black;
    color: black;
}

/* アイコンの基本サイズ */
.icon-standard {
    width: 22px;  /* 標準サイズを22pxに固定 */
    height: 22px;
    object-fit: contain;
}

.icon-small {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* 情報アイコンのスタイル */
.info-icon-wrapper {
    position: absolute;
    top: 50%;
    left: -24px;
    transform: translateY(-50%);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    padding: 4px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
}

/* 包装形態内の情報アイコン */
.package-form-item .info-icon {
    width: 16px;  /* 包装形態内のみ小さいサイズを使用 */
    height: 16px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

/* その他の場所での情報アイコン */
.info-icon:not(.package-form-item .info-icon) {
    width: 22px;
    height: 22px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

/* 包装形態アイテムのスタイル */
.package-form-item {
    min-width: 150px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
    cursor: pointer;
    z-index: 1;
    overflow: hidden;
}

/* 未告知状態の包装形態アイテムのスタイル */
.package-form-item.unannounced { 
    border: 1px solid #333; /* 黒枠を追加 */
}

/* ホバー時のスタイル */
.package-form-item.unannounced:hover { 
    background-color: #e6e6e6; 
    border: 1px solid #333; /* ホバー時も黒枠を維持 */
}

/* 未告知状態の場合の情報アイコン背景色調整 */
.package-form-item.unannounced:hover .info-icon-wrapper {
    background: rgba(230, 230, 230, 0.9);
}

/* 包装形態アイテムのスタイル */
.package-form-item {
    min-width: 150px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
    cursor: pointer;
    z-index: 1;
    overflow: hidden;
}

/* レスポンシブ対応 - モバイル表示用 */
@media (max-width: 768px) {
    .package-form-item {
        min-width: 90%;  /* 幅を100%に設定 */
        width: 90%;      /* 幅を100%に設定 */
        margin-bottom: 0.5rem;  /* 項目間の余白 */
    }

    /* 包装形態コンテナのスタイル調整 */
    .package-forms-container {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding: 0;  /* 余分なパディングを削除 */
    }

    /* パッケージテキストのスタイル調整 */
    .package-text {
        width: 100%;  /* テキスト幅も100%に */
        text-align: left;  /* テキストを左寄せに */
    }
}

/* ブックマークボタンのスタイル */
.bookmark-button {
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.bookmark-button:hover {
    transform: scale(1.2);
}

.bookmark-button:focus {
    outline: none;
}

/* drugdataブックマークボタンのスタイル */
.bookmark-button-drugdata {
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.bookmark-button-drugdata:hover {
    transform: scale(1.2);
}

.bookmark-button-drugdata:focus {
    outline: none;
}
.icon-bookmark {
    width: 22px;
    height: 22px;
}

/* カードの選択関連のスタイル */
.selectable-card {
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.card.mb-3 {
    margin: 0.5rem 0.25rem;
}

/* チェックされたカードのスタイル */
.selectable-card.selected {
    background-color: rgba(13, 110, 253, 0.05);
    border-color: rgba(13, 110, 253, 0.3);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1) !important;
    transform: scale(1.005);
    z-index: 1;
}

/* アニメーション効果 */
.selectable-card {
    transform-origin: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1);
}

/* チェックボックスのスタイル */
.card-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.card-checkbox .form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.25);
}

.card-checkbox .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* hover-cardクラスの調整 */
.hover-card {
    transition: all 0.3s ease;
    border-color: #e9ecef;
    margin: 0.5rem 0.25rem;
}

/* 簡易表示のカードがチェックされたときのスタイル */
.hover-card.selected {
    background-color: rgba(13, 110, 253, 0.05);
    border-color: rgba(13, 110, 253, 0.3);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1) !important;
}

/* 変更点表示のスタイル */
.update-badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

.changes-timeline {
    position: relative;
    padding-left: 20px;
    margin-left: 10px;
}

.change-item {
    position: relative;
    padding: 10px 0;
    border-left: 2px solid #dee2e6;
    margin-left: 10px;
}

.change-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 15px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #0d6efd;
}

.change-content {
    background: #fff;
    padding: 12px 15px;
    border-radius: 4px;
    margin-left: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-size: 0.9rem;
}

/* 変更点ボタンのスタイル */
.btn-outline-primary {
    border-width: 1px;
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    transition: all 0.2s ease;
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.1);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .change-content {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
    
    .btn-outline-primary {
        font-size: 0.8rem;
        padding: 0.2rem 0.5rem;
    }
}

/* ブックマークバッジボタンのスタイル */
.bookmark-badge-button {
    display: flex;
    align-items: center;
    padding: 2px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.bookmark-badge-button:hover {
    transform: scale(1.1);
}

.bookmark-badge-button img {
    width: 16px;
    height: 16px;
    opacity: 1;
    transition: opacity 0.2s ease;
}
/* ソート関連*/
/* ソート・フィルターコンテナ */
.sort-filter-container {
    background-color: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

/* ソートコントロール */
.sort-control {
    max-width: 300px;
}

/* フィルターグループ */
.filter-group {
    margin-bottom: 1rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

/* フィルターラベル */
.filter-group .form-label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* チェックボックスグループ */
.filter-group .btn-group {
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* フィルターバッジ */
#filterBadges .badge {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: #6c757d;
    display: inline-flex;
    align-items: center;
}

#filterBadges .badge .btn-close {
    margin-left: 0.5rem;
    font-size: 0.75em;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .sort-control,
    .filter-group input,
    .filter-group select {
        width: 100%;
        max-width: none;
    }

    .filter-group .btn-group {
        width: 100%;
        justify-content: start;
    }
}

/* ソート・フィルターモーダル */
/* モーダル基本スタイル */
.modal-content {
    border-radius: 1rem;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    background-color: #fff;
    border-radius: 1rem 1rem 0 0;
}

.modal-header .modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f0f0f0;
    background-color: #fff;
    border-radius: 0 0 1rem 1rem;
}

/* フィルターグループのスタイル */
.filter-group {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.filter-group:last-child {
    margin-bottom: 0;
}

/* セクションタイトル */
.form-label.fw-bold {
    font-size: 0.95rem;
    color: #1a1a1a;
    margin-bottom: 1rem;
    display: block;
}

/* チェックボックス・ラジオボタンのスタイル */
.form-check {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.75rem;
}

.form-check:last-child {
    margin-bottom: 0;
}

.form-check-input {
    margin-top: 0.25rem;
    border-color: #d1d5db;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}

.form-check-label {
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.5;
    user-select: none;
}

/* 数値入力フィールド */
.input-group {
    border-radius: 0.5rem;
    overflow: hidden;
}

.input-group-text {
    background-color: #f9fafb;
    border-color: #e5e7eb;
    color: #6b7280;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}

.form-control {
    border-color: #e5e7eb;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* ボタンスタイル */
.btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #2563eb;
    border-color: #2563eb;
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #f3f4f6;
    border-color: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
    border-color: #d1d5db;
    color: #1f2937;
}

/* フィルターバッジ */
.filter-badge {
    display: inline-flex;
    align-items: center;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 2rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
    color: #374151;
    margin: 0.25rem;
    transition: all 0.2s ease;
}

.filter-badge:hover {
    background-color: #e5e7eb;
}

.badge-remove {
    margin-left: 0.5rem;
    color: #6b7280;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.badge-remove:hover {
    opacity: 1;
}

/* リスト表示のスタイル改善 */
.list-group-item {
    padding: 0.75rem 1rem;
    border-color: #e5e7eb;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: #f9fafb;
}

.list-group-item .form-check-input {
    margin-right: 0.75rem;
}

/* モーダルのアニメーション */
.modal.fade .modal-dialog {
    transform: scale(0.95);
    opacity: 0;
    transition: all 0.2s ease-out;
}

.modal.show .modal-dialog {
    transform: scale(1);
    opacity: 1;
}

/* セクション間の区切り */
.mb-4 {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.mb-4:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .modal-body {
        padding: 1.25rem;
    }
    
    .filter-group {
        padding: 1.25rem;
    }
    
    .form-label.fw-bold {
        font-size: 0.9rem;
    }
    
    .form-check-label {
        font-size: 0.9rem;
    }

    /* モバイルでのタッチターゲットサイズの最適化 */
    .form-check {
        padding-left: 2rem;
        margin-bottom: 0.75rem;
    }

    .btn {
        padding: 0.4rem 0.75rem;
    }
}

/* アクセシビリティの改善 */
.form-check-input:focus {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* ツールチップのスタイル */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    padding: 0.5rem 0.75rem;
    background-color: rgba(0, 0, 0, 0.8);
}

/* 小数点以下のフォントサイズを小さく */
.decimal {
    font-size: 0.8em; /* 小数点以下のフォントサイズを小さく */
    /* vertical-align: super; 少し上にずらす */
}


/* パスワードトグルボタンのスタイル */
.password-toggle {
    border-left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.password-field {
    border-right: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* モバイル表示制御 */
.mobile-show {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-hidden {
        display: none !important;
    }
    
    .mobile-show {
        display: block !important;
    }
    
    .mobile-show.d-flex {
        display: flex !important;
    }
}