/* 
 * File: contact-bar.css
 * Mục đích: Định dạng giao diện cho thanh liên hệ Facebook, Zalo và nút toggle
 * Tính năng: Thiết kế hiện đại, hiệu ứng hover, responsive design, chức năng đóng/mở
 * Tác giả: AI Assistant
 */

/* Reset CSS cho thanh liên hệ */
.giuseart-pc-contact-bar,
.giuseart-pc-contact-bar *,
.giuseart-pc-contact-bar *::before,
.giuseart-pc-contact-bar *::after {
    box-sizing: border-box;
}

/* Wrapper chứa thanh liên hệ và nút toggle */
.contact-bar-wrapper {
    position: fixed;
    right: 20px;
    top: 45%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
}

/* Thanh liên hệ chính */
.giuseart-pc-contact-bar {
    position: relative;
    right: 0;
    top: 0;
    transform: none;
    z-index: 9999;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 20px 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Đảm bảo hiển thị trên mọi trình duyệt */
    -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -moz-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -o-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hiệu ứng hover cho toàn bộ thanh - đã xóa để tránh nhảy */
.giuseart-pc-contact-bar:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.98);
}

/* Các item liên hệ */
.giuseart-pc-contact-bar li {
    position: relative;
    margin: 0;
    padding: 0;
}

/* Link liên hệ */
.giuseart-pc-contact-bar li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    text-decoration: none;
    color: #ffffff;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    /* Đảm bảo hiển thị trên mọi trình duyệt */
    -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -moz-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -o-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hiệu ứng ripple cho link */
.giuseart-pc-contact-bar li a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    transition: all 0.6s ease;
    -webkit-transition: all 0.6s ease;
    -moz-transition: all 0.6s ease;
    -o-transition: all 0.6s ease;
}

.giuseart-pc-contact-bar li a:hover::before {
    width: 100%;
    height: 100%;
}

/* Style cho Facebook */
.giuseart-pc-contact-bar li.facebook a {
    background: #1877f2;
}

.giuseart-pc-contact-bar li.facebook a:hover {
    background: #166fe5;
    transform: scale(1.1);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -ms-transform: scale(1.1);
}

/* Style cho Zalo */
.giuseart-pc-contact-bar li.zalo a {
    background: #0068ff;
}

.giuseart-pc-contact-bar li.zalo a:hover {
    background: #0056d6;
    transform: scale(1.1);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -ms-transform: scale(1.1);
}

/* Style cho nút đóng (nằm dưới Zalo) */
.giuseart-pc-contact-bar li.toggle-close a {
    background: #dc3545 !important;
    cursor: pointer;
}

.giuseart-pc-contact-bar li.toggle-close a:hover {
    background: #c82333 !important;
    transform: scale(1.1);
    -webkit-transform: scale(1.1);
    -moz-transform: scale(1.1);
    -ms-transform: scale(1.1);
}

.giuseart-pc-contact-bar li.toggle-close a i {
    color: #ffffff;
    font-size: 14px;
    transition: all 0.3s ease;
}

.giuseart-pc-contact-bar li.toggle-close a:hover i {
    color: #ffffff;
}

/* Nút toggle để đóng/mở thanh liên hệ */
.contact-bar-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
}

.contact-bar-toggle:hover {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: scale(1.1);
}

.contact-bar-toggle i {
    color: #666;
    font-size: 14px;
    transition: all 0.3s ease;
}

.contact-bar-toggle:hover i {
    color: #333;
}

/* Icon trong các link */
.giuseart-pc-contact-bar li a i {
    animation: iconPulse 2s ease-in-out infinite;
    -webkit-animation: iconPulse 2s ease-in-out infinite;
}

/* Tắt animation khi hover */
.giuseart-pc-contact-bar li a:hover i {
    animation: none;
    -webkit-animation: none;
}

/* Hiệu ứng focus cho accessibility */
.giuseart-pc-contact-bar li a:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Tooltip cho các item */
.giuseart-pc-contact-bar li[data-tooltip] {
    position: relative;
}

.giuseart-pc-contact-bar li[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10000;
    /* Đảm bảo hiển thị trên mọi trình duyệt */
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
}

.giuseart-pc-contact-bar li[data-tooltip]::before {
    content: '';
    position: absolute;
    right: 55px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10000;
    /* Đảm bảo hiển thị trên mọi trình duyệt */
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
}

.giuseart-pc-contact-bar li[data-tooltip]:hover::after,
.giuseart-pc-contact-bar li[data-tooltip]:hover::before {
    opacity: 1;
}

/* Animation cho icon pulse */
@keyframes iconPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@-webkit-keyframes iconPulse {
    0% {
        -webkit-transform: scale(1);
    }
    50% {
        -webkit-transform: scale(1.1);
    }
    100% {
        -webkit-transform: scale(1);
    }
}

/* Trạng thái đóng của thanh liên hệ */
.giuseart-pc-contact-bar.closed {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

/* Ẩn nút đóng khi thanh liên hệ đã đóng */
.giuseart-pc-contact-bar.closed .toggle-close {
    display: none;
}

/* Ẩn nút mở khi thanh liên hệ đang mở */
.giuseart-pc-contact-bar:not(.closed) + .contact-bar-toggle {
    display: none;
}

/* Hiệu ứng transition cho việc đóng/mở */
.giuseart-pc-contact-bar {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

/* Responsive design cho mobile */
@media (max-width: 768px) {
    .contact-bar-wrapper {
        right: 10px;
        top: 60%;
    }
    
    .giuseart-pc-contact-bar {
        padding: 15px 12px;
    }
    
    .giuseart-pc-contact-bar li a {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .contact-bar-toggle {
        width: 35px;
        height: 35px;
        margin-left: 8px;
    }
    
    .contact-bar-toggle i {
        font-size: 12px;
    }
}

/* Responsive design cho tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .contact-bar-wrapper {
        right: 15px;
    }
    
    .contact-bar-toggle {
        width: 38px;
        height: 38px;
    }
    
    .contact-bar-toggle i {
        font-size: 13px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .giuseart-pc-contact-bar {
        background: rgba(30, 30, 30, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .giuseart-pc-contact-bar:hover {
        background: rgba(30, 30, 30, 0.98);
    }
    
    .contact-bar-toggle {
        background: rgba(30, 30, 30, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .contact-bar-toggle:hover {
        background: rgba(30, 30, 30, 0.98);
    }
    
    .contact-bar-toggle i {
        color: #ccc;
    }
    
    .contact-bar-toggle:hover i {
        color: #fff;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .giuseart-pc-contact-bar li a {
        border: 2px solid #ffffff;
    }
    
    .giuseart-pc-contact-bar li[data-tooltip]::after {
        background: #000000;
        border: 2px solid #ffffff;
    }
    
    .contact-bar-toggle {
        border: 2px solid #ffffff;
        background: #000000;
    }
    
    .contact-bar-toggle i {
        color: #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .giuseart-pc-contact-bar,
    .giuseart-pc-contact-bar li a,
    .giuseart-pc-contact-bar li a i,
    .giuseart-pc-contact-bar li[data-tooltip]::after,
    .giuseart-pc-contact-bar li[data-tooltip]::before,
    .contact-bar-toggle,
    .contact-bar-toggle i {
        transition: none;
        -webkit-transition: none;
        -moz-transition: none;
        -o-transition: none;
        animation: none;
        -webkit-animation: none;
    }
    
    .giuseart-pc-contact-bar:hover {
        transform: scale(1.05);
        -webkit-transform: scale(1.05);
        -moz-transform: scale(1.05);
        -ms-transform: scale(1.05);
    }
    
    .giuseart-pc-contact-bar li a:hover {
        transform: none;
        -webkit-transform: none;
        -moz-transform: none;
        -ms-transform: none;
    }
    
    .contact-bar-toggle:hover {
        transform: none;
    }
}

/* Fallback cho trình duyệt không hỗ trợ backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
    .giuseart-pc-contact-bar {
        background: rgba(255, 255, 255, 0.98);
    }
}

/* Fallback cho trình duyệt không hỗ trợ CSS Grid */
@supports not (display: flex) {
    .contact-bar-wrapper {
        display: block;
    }
    
    .giuseart-pc-contact-bar {
        display: block;
    }
    
    .giuseart-pc-contact-bar li {
        display: block;
        margin-bottom: 15px;
    }
    
    .contact-bar-toggle {
        display: block;
        margin-top: 10px;
    }
}

/* Đảm bảo hiển thị trên IE */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .giuseart-pc-contact-bar {
        background: #ffffff;
        border: 1px solid #e0e0e0;
    }
    
    .giuseart-pc-contact-bar li a {
        background: #007bff;
    }
    
    .contact-bar-toggle {
        background: #ffffff;
        border: 1px solid #e0e0e0;
    }
}

/* Tooltip cho các item - hiện ngay khi hover */
.giuseart-pc-contact-bar li[data-tooltip]::after {
    transition: opacity 0.2s ease;
}

.giuseart-pc-contact-bar li[data-tooltip]:hover::after {
    opacity: 1;
    transition-delay: 0s;
}
