/**
 * スマホ専用フローティングメニュー
 * 動画・書籍・勉強会へのクイックアクセス
 */

/* ========================================
   メインFABボタン（右下の王冠ボタン）
   ======================================== */

.fab-menu {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    display: none; /* デスクトップでは非表示 */
}

/* スマホでのみ表示 */
@media (max-width: 768px) {
    .fab-menu {
        display: block;
    }
}

/* メインボタン */
.fab-main-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B9D, #C77DFF);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: all 0.3s ease;
    position: relative;
    animation: pulse-fab 2s infinite;
}

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

.fab-main-button.active {
    background: linear-gradient(135deg, #E5577A, #9C27B0);
    transform: rotate(45deg);
}

/* パルスアニメーション */
@keyframes pulse-fab {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(255, 107, 157, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(255, 107, 157, 0.7);
    }
}

/* メインボタンのアイコン */
.fab-main-button i {
    transition: transform 0.3s ease;
}

.fab-main-button.active i {
    transform: rotate(-45deg);
}

/* ========================================
   サブメニュー（動画・書籍・勉強会ボタン）
   ======================================== */

.fab-submenu {
    position: absolute;
    bottom: 80px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.fab-submenu.active {
    opacity: 1;
    pointer-events: all;
}

/* サブメニューボタン */
.fab-submenu-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    transform: translateX(100px);
    transition: all 0.3s ease;
}

.fab-submenu.active .fab-submenu-item {
    transform: translateX(0);
}

/* 遅延アニメーション */
.fab-submenu.active .fab-submenu-item:nth-child(1) {
    transition-delay: 0.05s;
}

.fab-submenu.active .fab-submenu-item:nth-child(2) {
    transition-delay: 0.1s;
}

.fab-submenu.active .fab-submenu-item:nth-child(3) {
    transition-delay: 0.15s;
}

.fab-submenu.active .fab-submenu-item:nth-child(4) {
    transition-delay: 0.2s;
}

/* ラベル */
.fab-label {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* アイコンボタン */
.fab-icon-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    color: #333;
    border: none;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

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

/* 各ボタンのカラー */
.fab-icon-button.seminar {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.fab-icon-button.video {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.fab-icon-button.book {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
}

.fab-icon-button.slide {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
    color: white;
}

/* ========================================
   オーバーレイ（メニュー開いた時の背景）
   ======================================== */

.fab-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9997;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.fab-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ========================================
   ページトップボタンとの共存
   ======================================== */

/* ページトップボタンの位置調整 */
.scroll-top-button {
    bottom: 90px !important; /* FABメニューと重ならないように */
}

/* ========================================
   小型スマホ対応
   ======================================== */

@media (max-width: 375px) {
    .fab-main-button {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
    }
    
    .fab-icon-button {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .fab-label {
        font-size: 0.85rem;
        padding: 6px 14px;
    }
    
    .fab-submenu {
        bottom: 75px;
    }
}

/* ========================================
   アクセシビリティ
   ======================================== */

.fab-main-button:focus,
.fab-icon-button:focus {
    outline: 3px solid rgba(255, 107, 157, 0.5);
    outline-offset: 2px;
}

/* タッチデバイスでのタップハイライト */
.fab-main-button,
.fab-icon-button {
    -webkit-tap-highlight-color: transparent;
}

/* ========================================
   アニメーション強化
   ======================================== */

@keyframes bounce-in {
    0% {
        transform: scale(0) translateX(100px);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) translateX(0);
    }
    100% {
        transform: scale(1) translateX(0);
        opacity: 1;
    }
}

.fab-submenu.active .fab-submenu-item {
    animation: bounce-in 0.4s ease;
}

/* ========================================
   デスクトップでの非表示確認
   ======================================== */

@media (min-width: 769px) {
    .fab-menu,
    .fab-overlay {
        display: none !important;
    }
}
