/**
 * Floating Contact Menu - Frontend Styles
 */

/* คอนเทนเนอร์หลัก */
.fcm-floating-menu {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ไอคอนหลัก */
.fcm-main-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    z-index: 10;
}

.fcm-main-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.fcm-main-icon:active {
    transform: scale(0.95);
}

.fcm-main-icon svg {
    width: 28px;
    height: 28px;
    fill: white;
    transition: all 0.3s ease;
}

/* สลับไอคอนเปิด/ปิด */
.fcm-icon-close {
    display: none;
    position: absolute;
}

.fcm-floating-menu.active .fcm-icon-open {
    display: none;
}

.fcm-floating-menu.active .fcm-icon-close {
    display: block;
}

.fcm-floating-menu.active .fcm-main-icon {
    transform: rotate(90deg);
}

.fcm-floating-menu.active .fcm-main-icon:hover {
    transform: rotate(90deg) scale(1.1);
}

/* คอนเทนเนอร์ไอคอนย่อย */
.fcm-sub-icons {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.fcm-floating-menu.active .fcm-sub-icons {
    pointer-events: auto;
}

/* ไอคอนย่อย */
.fcm-sub-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
    transform: translateY(20px) scale(0);
    position: relative;
}

.fcm-floating-menu.active .fcm-sub-icon {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* แอนิเมชันแบบ staggered */
.fcm-floating-menu.active .fcm-sub-icon:nth-child(1) {
    transition-delay: 0.05s;
}

.fcm-floating-menu.active .fcm-sub-icon:nth-child(2) {
    transition-delay: 0.1s;
}

.fcm-floating-menu.active .fcm-sub-icon:nth-child(3) {
    transition-delay: 0.15s;
}

.fcm-floating-menu.active .fcm-sub-icon:nth-child(4) {
    transition-delay: 0.2s;
}

.fcm-sub-icon:hover {
    transform: translateY(0) scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.fcm-sub-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* สีของแต่ละไอคอน */
.fcm-messenger {
    background: linear-gradient(135deg, #00B2FF 0%, #006AFF 100%);
}

.fcm-gmail {
    background: linear-gradient(135deg, #EA4335 0%, #C5221F 100%);
}

.fcm-chat {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.fcm-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Tooltip */
.fcm-tooltip {
    position: absolute;
    right: 60px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.fcm-sub-icon:hover .fcm-tooltip {
    opacity: 1;
}

.fcm-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 6px solid rgba(0, 0, 0, 0.8);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

/* Responsive */
@media (max-width: 768px) {
    .fcm-main-icon {
        width: 55px;
        height: 55px;
    }
    
    .fcm-main-icon svg {
        width: 26px;
        height: 26px;
    }
    
    .fcm-sub-icon {
        width: 45px;
        height: 45px;
    }
    
    .fcm-sub-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .fcm-tooltip {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* แอนิเมชันเพิ่มเติม - Bounce effect */
@keyframes fcm-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.fcm-main-icon.bounce {
    animation: fcm-bounce 0.6s ease;
}

/* ซ่อนไอคอนที่ไม่มีลิงค์ */
.fcm-sub-icon[href=""],
.fcm-sub-icon:not([href]) {
    display: none;
}
