/* ========================================
   Floating Contact Button Styles
   คณะวิทยาการจัดการ มหาวิทยาลัยสงขลานครินทร์
   Version: 1.0.0
   Date: 23 October 2025
   ======================================== */

/* ============================================
   ปุ่มหลักที่ลอยอยู่ (Main Floating Button)
   ============================================ */
.floating-contact-btn {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9998;
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
    border: none;
    outline: none;
}

.floating-contact-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.floating-contact-btn i {
    color: white;
    font-size: 28px;
    transition: transform 0.3s ease;
}

.floating-contact-btn:active {
    transform: scale(0.95);
}

/* Animation pulse effect */
@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(102, 126, 234, 0.6);
    }
    100% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
}

/* ============================================
   Container ของเมนูย่อย (Contact Menu)
   ============================================ */
.floating-contact-menu {
    position: fixed;
    bottom: 160px;
    right: 20px;
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform: translateY(20px);
}

.floating-contact-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ============================================
   แต่ละปุ่มในเมนู (Menu Items)
   ============================================ */
.contact-menu-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 15px;
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
}

/* Delay animation สำหรับแต่ละปุ่ม */
.contact-menu-item:nth-child(1) { animation-delay: 0.1s; }
.contact-menu-item:nth-child(2) { animation-delay: 0.15s; }
.contact-menu-item:nth-child(3) { animation-delay: 0.2s; }
.contact-menu-item:nth-child(4) { animation-delay: 0.25s; }
.contact-menu-item:nth-child(5) { animation-delay: 0.3s; }
.contact-menu-item:nth-child(6) { animation-delay: 0.35s; }
.contact-menu-item:nth-child(7) { animation-delay: 0.4s; }
.contact-menu-item:nth-child(8) { animation-delay: 0.45s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   Label ข้อความ (Contact Labels)
   ============================================ */
.contact-label {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    margin-right: 10px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.contact-menu-item:hover .contact-label {
    background: rgba(0, 0, 0, 0.95);
    transform: translateX(-3px);
}

/* ============================================
   ปุ่มไอคอน (Icon Buttons)
   ============================================ */
.contact-icon-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    border: none;
    outline: none;
}

.contact-icon-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.contact-icon-btn:active {
    transform: scale(1.05);
}

.contact-icon-btn i {
    color: white;
    font-size: 24px;
    transition: transform 0.3s ease;
}

.contact-icon-btn:hover i {
    transform: rotate(10deg);
}

/* ============================================
   สีของแต่ละปุ่ม (Button Colors)
   ============================================ */

/* โทรศัพท์ - สีส้ม/เหลือง */
.phone-btn {
    background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%);
}

.phone-btn:hover {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
}

/* อีเมล - สีแดง */
.email-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.email-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
}

/* LINE - สีเขียว */
.line-btn {
    background: linear-gradient(135deg, #00c300 0%, #00b300 100%);
}

.line-btn:hover {
    background: linear-gradient(135deg, #00b300 0%, #00c300 100%);
}

/* Facebook - สีน้ำเงิน */
.facebook-btn {
    background: linear-gradient(135deg, #3b5998 0%, #2d4373 100%);
}

.facebook-btn:hover {
    background: linear-gradient(135deg, #2d4373 0%, #3b5998 100%);
}

/* LinkedIn - สีน้ำเงินเข้ม */
.linkedin-btn {
    background: linear-gradient(135deg, #0077b5 0%, #005885 100%);
}

.linkedin-btn:hover {
    background: linear-gradient(135deg, #005885 0%, #0077b5 100%);
}

/* YouTube - สีแดง */
.youtube-btn {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
}

.youtube-btn:hover {
    background: linear-gradient(135deg, #cc0000 0%, #ff0000 100%);
}

/* Twitter/X - สีฟ้า */
.twitter-btn {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
}

.twitter-btn:hover {
    background: linear-gradient(135deg, #0d8bd9 0%, #1da1f2 100%);
}

/* WhatsApp - สีเขียว */
.whatsapp-btn {
    background: linear-gradient(135deg, #25d366 0%, #1ebe57 100%);
}

.whatsapp-btn:hover {
    background: linear-gradient(135deg, #1ebe57 0%, #25d366 100%);
}

/* Instagram - สีไล่ระดับ */
.instagram-btn {
    background: linear-gradient(135deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%);
}

.instagram-btn:hover {
    background: linear-gradient(135deg, #bc1888 0%,#cc2366 25%,#dc2743 50%,#e6683c 75%,#f09433 100%);
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet */
@media (max-width: 992px) {
    .floating-contact-btn {
        width: 58px;
        height: 58px;
        bottom: 85px;
        right: 18px;
    }
    
    .floating-contact-btn i {
        font-size: 26px;
    }
    
    .floating-contact-menu {
        bottom: 152px;
        right: 18px;
    }
    
    .contact-icon-btn {
        width: 48px;
        height: 48px;
    }
    
    .contact-icon-btn i {
        font-size: 22px;
    }
    
    .contact-label {
        font-size: 13px;
        padding: 7px 13px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .floating-contact-btn {
        width: 55px;
        height: 55px;
        bottom: 80px;
        right: 15px;
    }
    
    .floating-contact-btn i {
        font-size: 24px;
    }
    
    .floating-contact-menu {
        bottom: 145px;
        right: 15px;
    }
    
    .contact-icon-btn {
        width: 45px;
        height: 45px;
    }
    
    .contact-icon-btn i {
        font-size: 20px;
    }
    
    .contact-label {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .floating-contact-btn {
        width: 50px;
        height: 50px;
        bottom: 75px;
        right: 12px;
    }
    
    .floating-contact-btn i {
        font-size: 22px;
    }
    
    .floating-contact-menu {
        bottom: 135px;
        right: 12px;
    }
    
    .contact-icon-btn {
        width: 42px;
        height: 42px;
    }
    
    .contact-icon-btn i {
        font-size: 18px;
    }
    
    .contact-label {
        font-size: 11px;
        padding: 5px 10px;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .floating-contact-btn,
    .floating-contact-menu {
        display: none !important;
    }
}

/* ============================================
   Accessibility
   ============================================ */

/* Focus states for keyboard navigation */
.floating-contact-btn:focus,
.contact-icon-btn:focus {
    outline: 3px solid #667eea;
    outline-offset: 3px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .floating-contact-btn,
    .contact-icon-btn,
    .contact-label {
        animation: none !important;
        transition: none !important;
    }
    
    .floating-contact-btn:hover,
    .contact-icon-btn:hover {
        transform: none !important;
    }
}

/* ============================================
   High Contrast Mode Support
   ============================================ */
@media (prefers-contrast: high) {
    .floating-contact-btn,
    .contact-icon-btn {
        border: 2px solid white;
    }
    
    .contact-label {
        border: 1px solid white;
    }
}

/* ============================================
   End of Floating Contact Button Styles
   ============================================ */