/* ========================================
   div.fixed-cta-footer 用CSS
   全ての関連スタイルをリファクタリング
   ======================================== */

/* ========================================
   1. CSS変数定義
   ======================================== */
:root {
    --cta-green: #00c300;
    --cta-green-dark: #00a000;
    --cta-green-darker: #008000;
    --cta-green-light: #00d400;
    --cta-green-lighter: #00b000;
    --white: #ffffff;
    --shadow-light: rgba(0, 195, 0, 0.4);
    --shadow-medium: rgba(0, 195, 0, 0.5);
    --shadow-dark: rgba(0, 0, 0, 0.2);
    --transition-fast: 0.3s ease;
    --transition-medium: 0.4s ease;
    --z-index-cta: 996;
}

/* ========================================
   2. 固定CTAフッターコンテナ
   ======================================== */
.fixed-cta-footer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: var(--z-index-cta);
    animation: slideInUp 0.5s ease;
}

/* ========================================
   3. スライドインアニメーション
   ======================================== */
@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ========================================
   4. 診断ボタンの基本スタイル
   ======================================== */
.fixed-diagnosis-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--cta-green), var(--cta-green-dark));
    color: var(--white) !important;
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 20px var(--shadow-light);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

/* ========================================
   5. フッター内の診断ボタン特別スタイル
   ======================================== */
.fixed-cta-footer .fixed-diagnosis-btn {
    box-shadow: 0 -4px 20px var(--shadow-light);
}

/* ========================================
   6. ホバーエフェクト
   ======================================== */
.fixed-diagnosis-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 30px var(--shadow-medium);
}

/* ========================================
   7. ホバー時の波紋エフェクト
   ======================================== */
.fixed-diagnosis-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width var(--transition-medium), height var(--transition-medium);
}

.fixed-diagnosis-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* ========================================
   8. アイコンスタイル
   ======================================== */
.fixed-diagnosis-btn i {
    font-size: 1.3rem;
    color: var(--white) !important;
}

/* ========================================
   9. テキストスタイル
   ======================================== */
.fixed-diagnosis-btn span {
    color: var(--white) !important;
}

/* ========================================
   10. 点滅エフェクト要素
   ======================================== */
.fixed-diagnosis-btn .blink {
    animation: blink 1.5s infinite;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 5px;
    color: var(--white) !important;
}

@keyframes blink {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.3; 
    }
}

/* ========================================
   11. フッター内の全要素の文字色強制
   ======================================== */
.fixed-cta-footer .fixed-diagnosis-btn,
.fixed-cta-footer .fixed-diagnosis-btn *,
.fixed-cta-footer a,
.fixed-cta-footer span,
.fixed-cta-footer i {
    color: var(--white) !important;
}

/* ========================================
   12. フラットデザイン対応
   ======================================== */
.flat-design .fixed-diagnosis-btn {
    background: var(--cta-green) !important;
    border: 2px solid var(--cta-green-dark) !important;
    box-shadow: 0 2px 8px var(--shadow-dark) !important;
}

.flat-design .fixed-diagnosis-btn:hover {
    background: var(--cta-green-dark) !important;
    border-color: var(--cta-green-darker) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

/* ========================================
   13. 他の固定要素を非表示
   ======================================== */
.fixed-cta-header,
.fixed-cta-banner,
.line-consultation-banner,
[class*="fixed"][class*="btn"]:not(.fixed-cta-footer):not(.fixed-diagnosis-btn),
[class*="fixed"][class*="cta"]:not(.fixed-cta-footer),
[class*="fixed"][class*="header"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
}

/* ========================================
   14. タブレット対応
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .fixed-cta-footer {
        bottom: 15px;
        right: 15px;
    }
    
    .fixed-diagnosis-btn {
        font-size: 0.95rem;
        padding: 11px 22px;
    }
}

/* ========================================
   15. モバイル対応
   ======================================== */
@media (max-width: 768px) {
    .fixed-cta-header {
        display: none !important;
    }
    
    .fixed-cta-footer {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    .fixed-cta-footer .fixed-diagnosis-btn {
        width: 100%;
        justify-content: center;
    }
    
    .fixed-diagnosis-btn {
        font-size: 0.95rem;
        padding: 10px 20px;
    }
    
    .fixed-diagnosis-btn .blink {
        display: none;
    }
}

/* ========================================
   16. 小画面対応
   ======================================== */
@media (max-width: 480px) {
    .fixed-cta-footer {
        bottom: 8px;
        right: 8px;
        left: 8px;
    }
    
    .fixed-diagnosis-btn {
        font-size: 0.9rem;
        padding: 8px 16px;
        gap: 8px;
    }
    
    .fixed-diagnosis-btn i {
        font-size: 1.1rem;
    }
}

/* ========================================
   17. アクセシビリティ対応
   ======================================== */
.fixed-diagnosis-btn:focus {
    outline: 3px solid rgba(0, 195, 0, 0.5);
    outline-offset: 2px;
}

.fixed-diagnosis-btn:focus:not(:focus-visible) {
    outline: none;
}

/* ========================================
   18. 高コントラストモード対応
   ======================================== */
@media (prefers-contrast: high) {
    .fixed-diagnosis-btn {
        border: 2px solid var(--white);
        background: var(--cta-green-dark);
    }
    
    .fixed-diagnosis-btn:hover {
        background: var(--cta-green-darker);
        border-color: var(--white);
    }
}

/* ========================================
   19. アニメーション無効化対応
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .fixed-cta-footer {
        animation: none;
    }
    
    .fixed-diagnosis-btn {
        transition: none;
    }
    
    .fixed-diagnosis-btn::before {
        transition: none;
    }
    
    .fixed-diagnosis-btn .blink {
        animation: none;
    }
}

/* ========================================
   20. 印刷時の調整
   ======================================== */
@media print {
    .fixed-cta-footer {
        display: none !important;
    }
}

/* ========================================
   21. ダークモード対応
   ======================================== */
@media (prefers-color-scheme: dark) {
    .fixed-diagnosis-btn {
        box-shadow: 0 4px 20px rgba(0, 195, 0, 0.6);
    }
    
    .fixed-cta-footer .fixed-diagnosis-btn {
        box-shadow: 0 -4px 20px rgba(0, 195, 0, 0.6);
    }
    
    .fixed-diagnosis-btn:hover {
        box-shadow: 0 6px 30px rgba(0, 195, 0, 0.8);
    }
}

/* ========================================
   22. ユーティリティクラス
   ======================================== */
.cta-hidden {
    display: none !important;
}

.cta-visible {
    display: inline-flex !important;
}

.cta-pulse {
    animation: ctaPulse 2s ease-in-out infinite;
}

@keyframes ctaPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ========================================
   23. 状態管理クラス
   ======================================== */
.fixed-cta-footer.is-loading .fixed-diagnosis-btn {
    pointer-events: none;
    opacity: 0.7;
}

.fixed-cta-footer.is-loading .fixed-diagnosis-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}