/* ===========================================
   FLOATING BUTTONS - CONSULTATION & BACK TO TOP
   =========================================== */

/* ===========================================
   CONSULTATION BUTTONS
   =========================================== */

.rise-theme-floating-consultation {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 998; /* Lower than to-top button */
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* Form Consultation Button */
.rise-theme-floating-form {
    opacity: 0;
    transform: translateX(50px);
    animation: riseSlideIn 0.6s ease-out 0.3s forwards;
}

.rise-theme-form-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: #ffffff;
    border: 2px solid #54847A; /* 品牌綠色 */
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(84, 132, 122, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    overflow: hidden;
}

.rise-theme-form-button:hover {
    background-color: #54847A; /* 品牌綠色 */
    border-color: #54847A;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(84, 132, 122, 0.4);
    text-decoration: none;
}

.rise-theme-form-button:active {
    transform: translateY(-1px) scale(1.02);
}

.rise-theme-form-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
}

.rise-theme-form-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #54847A; /* 品牌綠色 */
    font-weight: 600;
    line-height: 1.1;
    transition: color 0.3s ease;
}

.rise-theme-form-button:hover .rise-theme-form-text {
    color: white;
}

.rise-theme-form-action {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.rise-theme-form-service {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2px;
    opacity: 0.95;
}

/* LINE Consultation Button */
.rise-theme-floating-line {
    opacity: 0;
    transform: translateX(50px);
    animation: riseSlideIn 0.6s ease-out 0.6s forwards;
}

.rise-theme-line-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: #1CBB16; /* LINE綠色 */
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(28, 187, 22, 0.4);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.rise-theme-line-button:hover {
    background-color: #19A513;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(28, 187, 22, 0.6);
    text-decoration: none;
}

.rise-theme-line-button:active {
    transform: translateY(-1px) scale(1.02);
}

.rise-theme-line-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 10px;
    box-sizing: border-box;
}

.rise-theme-line-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    font-weight: 600;
    line-height: 1.1;
}

.rise-theme-line-brand {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.rise-theme-line-service {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2px;
    opacity: 0.95;
}

/* ===========================================
   ANIMATIONS
   =========================================== */

/* Slide in animation */
@keyframes riseSlideIn {
    0% {
        opacity: 0;
        transform: translateX(50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Floating animation for consultation buttons */
@keyframes riseFloating {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-6px);
    }
    100% {
        transform: translateY(0px);
    }
}

.rise-theme-form-button,
.rise-theme-line-button {
    animation: riseFloating 3s ease-in-out infinite;
}

.rise-theme-form-button:hover,
.rise-theme-line-button:hover {
    animation: none; /* Stop floating on hover */
}

/* Staggered floating animation */
.rise-theme-form-button {
    animation: riseFloating 3s ease-in-out infinite;
    animation-delay: 0.5s;
}

.rise-theme-line-button {
    animation: riseFloating 3s ease-in-out infinite;
    animation-delay: 1s;
}

/* Pulse effect for LINE button only */
.rise-theme-line-button::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background-color: #1CBB16;
    border-radius: 50%;
    opacity: 0;
    transform: scale(1);
    animation: risePulseRing 4s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
    animation-delay: 2s;
}

@keyframes risePulseRing {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    80% {
        transform: scale(1.3);
        opacity: 0;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* ===========================================
   BACK TO TOP BUTTON
   =========================================== */

.rise-theme-floating-buttons {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    pointer-events: none; /* 讓容器不阻擋點擊 */
}

.rise-theme-back-to-top {
    width: 50px;
    height: 50px;
    background-color: #54847A;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    pointer-events: auto; /* 按鈕本身可點擊 */
    box-shadow: 0 4px 20px rgba(84, 132, 122, 0.3);
}

/* 顯示狀態 */
.rise-theme-back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Hover效果 */
.rise-theme-back-to-top:hover {
    background-color: #456B61;
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(84, 132, 122, 0.4);
}

/* 按下效果 */
.rise-theme-back-to-top:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 15px rgba(84, 132, 122, 0.3);
}

/* SVG箭頭樣式 */
.rise-theme-back-to-top svg {
    transition: transform 0.2s ease;
}

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

/* 脈動動畫 - 首次出現時 */
.rise-theme-back-to-top.show {
    animation: pulseOnce 0.6s ease-out;
}

@keyframes pulseOnce {
    0% {
        transform: translateY(20px) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateY(-5px) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    /* 諮詢按鈕響應式 */
    .rise-theme-floating-consultation {
        bottom: 100px; /* 避免與手機底部導航衝突 */
        right: 20px;
        gap: 12px;
    }
    
    .rise-theme-form-button,
    .rise-theme-line-button {
        width: 70px;
        height: 70px;
    }
    
    .rise-theme-form-action,
    .rise-theme-line-brand {
        font-size: 12px;
    }
    
    .rise-theme-form-service,
    .rise-theme-line-service {
        font-size: 10px;
    }
    
    /* Back to Top 按鈕響應式 */
    .rise-theme-floating-buttons {
        bottom: 20px;
    }
    
    .rise-theme-back-to-top {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    /* 諮詢按鈕小螢幕 */
    .rise-theme-floating-consultation {
        bottom: 90px;
        right: 15px;
        gap: 10px;
    }
    
    .rise-theme-form-button,
    .rise-theme-line-button {
        width: 65px;
        height: 65px;
    }
    
    .rise-theme-form-action {
        font-size: 11px;
    }
    
    .rise-theme-form-service,
    .rise-theme-line-service {
        font-size: 9px;
    }
    
    .rise-theme-line-brand {
        font-size: 11px;
    }
    
    /* Back to Top 按鈕保持居中 */
    .rise-theme-floating-buttons {
        bottom: 15px;
    }
    
    .rise-theme-back-to-top {
        width: 40px;
        height: 40px;
    }
}

/* 無障礙支援 */
@media (prefers-reduced-motion: reduce) {
    .rise-theme-back-to-top {
        transition: opacity 0.2s ease;
    }
    
    .rise-theme-back-to-top.show {
        animation: none;
    }
    
    .rise-theme-back-to-top:hover {
        transform: none;
    }
}

/* Focus樣式（鍵盤導航） */
.rise-theme-back-to-top:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* 確保不與其他浮動元素衝突 */
.rise-theme-back-to-top {
    position: relative;
    isolation: isolate;
}