/*
 * mobile-controls.css - モバイル用フローティング+ボトムシートシステム
 * 作成日: 2025-07-06 12:10
 * 用途: モバイル環境でのサイドバー代替UI（汎用）
 * 使用ページ: 薬剤詳細、カテゴリ、検索結果、比較ページなど
 * 目標: モバイル 45%→90%コンテンツ表示領域確保
 */

/* フローティングアクションボタン */
.mobile-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #e74c3c;  /* 目立つ赤色に変更 */
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);  /* 赤色の影を強化 */
    cursor: pointer;
    transition: all var(--transition-base);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;  /* アイコンサイズを少し大きく */
    font-weight: bold;
}

/* フローティングボタンの上のmenuラベル */
.mobile-fab::before {
    content: 'menu';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 4px 12px;
    background: #e74c3c;  /* ボタンと同じ赤色 */
    color: white;
    font-size: 14px;
    font-weight: 600;
    border-radius: 16px;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
    pointer-events: none;  /* クリックイベントを透過 */
}

.mobile-fab:hover {
    background: #c0392b;  /* ホバー時は濃い赤 */
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(231, 76, 60, 0.5);
}

.mobile-fab:hover::before {
    background: #c0392b;  /* ラベルもホバー時は濃い赤 */
    box-shadow: 0 2px 12px rgba(192, 57, 43, 0.4);
}

.mobile-fab:active {
    transform: scale(0.95);
}

/* モバイルでのみ表示 */
@media (max-width: 767px) {
    .mobile-fab {
        display: flex;
        animation: pulse 2s ease-in-out 3;  /* 最初の6秒間パルスアニメーション */
    }
    
    .mobile-fab::before {
        animation: labelPulse 2s ease-in-out 3;  /* ラベルも同期してパルス */
    }
}

/* パルスアニメーション（注意を引くため） */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(231, 76, 60, 0.6);
    }
    100% {
        box-shadow: 0 4px 20px rgba(231, 76, 60, 0.4);
    }
}

/* ラベルのパルスアニメーション */
@keyframes labelPulse {
    0% {
        box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
    }
    50% {
        box-shadow: 0 2px 16px rgba(231, 76, 60, 0.5);
    }
    100% {
        box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
    }
}

/* ボトムシートオーバーレイ */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 1001;
    backdrop-filter: blur(2px);
}

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

/* ボトムシート本体 */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform var(--transition-base);
    z-index: 1002;
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid var(--border-light);
}

.bottom-sheet.active {
    transform: translateY(0);
}

/* ボトムシートハンドル */
.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin: 12px auto 20px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.bottom-sheet-handle:hover {
    background: var(--pharma-primary);
}

/* ボトムシート内コンテンツ */
.bottom-sheet-content {
    padding: 0 20px 32px;
}

/* ボトムシートセクション */
.bottom-sheet-section {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-light);
}

.bottom-sheet-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.bottom-sheet-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-base);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* ボトムシート内のボタンリスト */
.bottom-sheet-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.bottom-sheet-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-base);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    font-size: var(--font-size-base);
    cursor: pointer;
    min-height: 48px;
}

.bottom-sheet-btn:hover {
    background: var(--bg-accent);
    border-color: var(--pharma-primary-light);
    color: var(--pharma-primary);
    transform: translateY(-1px);
}

.bottom-sheet-btn.active {
    background: var(--pharma-primary);
    color: white;
    border-color: var(--pharma-primary-dark);
}

/* アイコン付きボタン */
.bottom-sheet-btn .icon {
    font-size: var(--font-size-lg);
    margin-right: var(--spacing-sm);
}

.bottom-sheet-btn .arrow {
    font-size: var(--font-size-sm);
    opacity: 0.6;
    transition: transform var(--transition-fast);
}

.bottom-sheet-btn:hover .arrow {
    transform: translateX(2px);
}

/* レベル選択ボタン特別スタイル */
.bottom-sheet-btn[data-level] {
    position: relative;
}

.bottom-sheet-btn[data-level]::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--pharma-primary);
    border-radius: 2px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.bottom-sheet-btn[data-level].active::before {
    opacity: 1;
}