/**
 * Back to Top Button Styles
 * ページトップ戻るボタンスタイル
 */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.back-to-top:active {
    transform: translateY(0);
}

/* アニメーション効果 */
.back-to-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0);
    transition: transform 0.3s ease;
}

.back-to-top:hover::before {
    transform: scale(1);
}

/* アイコン回転効果 */
.back-to-top i {
    transition: transform 0.3s ease;
}

.back-to-top:hover i {
    transform: translateY(-2px);
}

/* プログレスリング効果 */
.back-to-top-progress {
    position: absolute;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    border-radius: 50%;
    background: conic-gradient(
        var(--accent-color) var(--scroll-progress, 0%),
        transparent var(--scroll-progress, 0%)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.back-to-top.show .back-to-top-progress {
    opacity: 1;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}

/* アクセシビリティ対応 */
.back-to-top:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top,
    .back-to-top::before,
    .back-to-top i,
    .back-to-top-progress {
        transition: none !important;
        animation: none !important;
    }
}

/* 高コントラストモード対応 */
@media (prefers-contrast: high) {
    .back-to-top {
        border: 2px solid currentColor;
        background: var(--primary-color);
    }
    
    .back-to-top:hover {
        background: var(--accent-color);
        border-color: var(--accent-color);
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .back-to-top {
        background: #333;
        color: #fff;
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
    }
    
    .back-to-top:hover {
        background: var(--accent-color);
        box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
    }
}
