/* MDUC フローティングメニュー CSS */

.floating-menu {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 180px; /* Increased width for full text visibility */
    height: auto; /* Auto height based on content */
    max-height: 70vh; /* Limit to 70% of viewport height */
    background: rgba(255, 255, 255, 0.95);
    border-right: 1px solid #E0E0E0;
    backdrop-filter: blur(10px);
    z-index: 998;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 0 10px 0;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    font-family: 'Noto Sans JP', sans-serif;
    border-radius: 8px; /* Rounded corners */
    overflow-y: auto; /* Added scroll for overflow content */
}

.floating-menu.show-after-hero {
    display: flex;
}

.floating-menu.expanded {
    width: 210px; /* Increased from 180px base width */
}

.menu-progress {
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: #E0E0E0;
    overflow: hidden;
}

.menu-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #F39800;
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease;
}

.floating-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 16px;
    margin: 2px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666666;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.floating-menu-item:hover {
    background-color: rgba(243, 152, 0, 0.08);
    color: #F39800;
}

.floating-menu-item.active {
    background-color: rgba(243, 152, 0, 0.15);
    color: #F39800;
    font-weight: 600;
}

.menu-icon {
    font-size: 20px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.menu-text {
    margin-left: 12px;
    font-size: 12px; /* Smaller font size */
    font-weight: 500;
    white-space: nowrap;
    opacity: 1; /* Always visible */
    transform: translateX(0); /* Always visible */
    transition: all 0.3s ease;
}

/* レスポンシブ対応 */
@media (max-width: 1023px) {
    .floating-menu.expansion-disabled {
        width: 160px; /* Adjusted for always visible text */
    }
}

@media (max-width: 767px) {
    .floating-menu {
        display: none !important;
        visibility: hidden !important;
    }
}

/* スクロールプログレスバー */
.floating-menu .menu-progress::after {
    transform: scaleY(var(--scroll-progress, 0));
}

/* アニメーション */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.floating-menu-item {
    animation: fadeInUp 0.5s ease forwards;
}

.floating-menu-item:nth-child(1) { animation-delay: 0.1s; }
.floating-menu-item:nth-child(2) { animation-delay: 0.2s; }
.floating-menu-item:nth-child(3) { animation-delay: 0.3s; }
.floating-menu-item:nth-child(4) { animation-delay: 0.4s; }
.floating-menu-item:nth-child(5) { animation-delay: 0.5s; }
.floating-menu-item:nth-child(6) { animation-delay: 0.6s; }
.floating-menu-item:nth-child(7) { animation-delay: 0.7s; }
.floating-menu-item:nth-child(8) { animation-delay: 0.8s; }

/* フォーカス対応 */
.floating-menu-item:focus {
    outline: 2px solid #F39800;
    outline-offset: 2px;
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .floating-menu {
        background: rgba(40, 40, 40, 0.95);
        border-right-color: #555;
    }
    
    .floating-menu-item {
        color: #ccc;
    }
    
    .floating-menu-item:hover {
        background-color: rgba(243, 152, 0, 0.2);
        color: #F39800;
    }
}

/* Opacity controlled by JavaScript based on scroll */

