/* CSS Variables */
:root {
    --cb-primary: #00bcd4;
    --cb-primary-rgb: 0, 188, 212;
}

/* Floating Container */
.cb-floating {
    position: fixed;
    bottom: 50px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.cb-floating[data-position="right"] {
    right: 80px;
    align-items: flex-end;
}

/* Items List */
.cb-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    transform-origin: bottom center;
}

/* Always visible when no toggle button */
.cb-items-list.cb-always-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.cb-floating.active .cb-items-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    max-height: 1000px;
}

/* Staggered animation for items */
.cb-floating.active .cb-items-list .cb-item {
    animation: slideIn 0.4s ease forwards;
    /* transition: all 0.3s ease; */
    /* opacity: 0; */
}

/* .cb-floating.active .cb-items-list .cb-item:nth-child(1) {
    animation-delay: 0.05s;
}

.cb-floating.active .cb-items-list .cb-item:nth-child(2) {
    animation-delay: 0.1s;
}

.cb-floating.active .cb-items-list .cb-item:nth-child(3) {
    animation-delay: 0.15s;
}

.cb-floating.active .cb-items-list .cb-item:nth-child(4) {
    animation-delay: 0.2s;
}

.cb-floating.active .cb-items-list .cb-item:nth-child(5) {
    animation-delay: 0.25s;
}

.cb-floating.active .cb-items-list .cb-item:nth-child(6) {
    animation-delay: 0.3s;
}

.cb-floating.active .cb-items-list .cb-item:nth-child(7) {
    animation-delay: 0.35s;
}

.cb-floating.active .cb-items-list .cb-item:nth-child(8) {
    animation-delay: 0.4s;
}

.cb-floating.active .cb-items-list .cb-item:nth-child(9) {
    animation-delay: 0.45s;
}

.cb-floating.active .cb-items-list .cb-item:nth-child(10) {
    animation-delay: 0.5s;
} */

@keyframes slideIn {
    from {
        /* opacity: 0; */
        transform: translateY(20px);
    }
    to {
        /* opacity: 1; */
        transform: translateY(0);
    }
}

/* Contact Item Button */
.cb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--cb-primary);
    color: #fff;
    border-radius: 30px;
    padding: 10px 16px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(var(--cb-primary-rgb), 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cb-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--cb-primary-rgb), 0.4);
    color: #fff;
    text-decoration: none;
}

.cb-item:active {
    transform: translateY(0);
}

/* Icon */
.cb-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    object-fit: contain;
}

/* Label */
.cb-label {
    white-space: nowrap;
    line-height: 1;
}

/* Main Button */
.cb-main-button .cb-item {
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    animation: pulse 2s infinite;
}

.cb-main-button .cb-icon {
    border-radius: 99px;
    gap: unset;
    padding: 8px;
    width: 42px;
    height: 42px;
}

/* Main Toggle Button */
.cb-main-toggle {
    position: relative;
}

.cb-toggle-btn {
    display: flex;
    align-items: center;
    gap: unset;
    background: var(--cb-primary);
    color: #fff;
    border: none;
    border-radius: 99px;
    padding: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(var(--cb-primary-rgb), 0.3);
    transition: all 0.3s ease;
    animation: pulse 2s infinite;
}

.cb-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--cb-primary-rgb), 0.4);
}

.cb-toggle-btn:active {
    transform: translateY(0);
}

.cb-toggle-icon {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.cb-toggle-label {
    white-space: nowrap;
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--cb-primary-rgb), 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(var(--cb-primary-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--cb-primary-rgb), 0);
    }
}

/* Stop pulse animation when active */
.cb-floating.active .cb-main-button .cb-item {
    animation: none;
}
/* Stop pulse animation when active */
.cb-floating.active .cb-toggle-btn {
    animation: none;
}

/* Rotate main button icon when active */
.cb-floating.active .cb-main-button .cb-icon {
    transform: rotate(360deg);
    transition: transform 0.3s ease;
}

/* Specific Contact Type Styles */
.cb-whatsapp {
    background: #25d366 !important;
    --cb-primary-rgb: 37, 211, 102;
}

.cb-messenger {
    background: #0084ff !important;
    --cb-primary-rgb: 0, 132, 255;
}

.cb-telegram {
    background: #0088cc !important;
    --cb-primary-rgb: 0, 136, 204;
}

.cb-zalo {
    background: #0068ff !important;
    --cb-primary-rgb: 0, 104, 255;
}

.cb-viber {
    background: #7360f2 !important;
    --cb-primary-rgb: 115, 96, 242;
}

.cb-line {
    background: #00b900 !important;
    --cb-primary-rgb: 0, 185, 0;
}

.cb-kakao {
    background: #fee500 !important;
    --cb-primary-rgb: 254, 229, 0;
    color: #3c1e1e !important;
}

.cb-kakao .cb-icon {
    filter: none;
}

.cb-email {
    background: #ea4335 !important;
    --cb-primary-rgb: 234, 67, 53;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .cb-floating {
        bottom: 15px;
    }
    
    .cb-floating[data-position="left"] {
        left: 15px;
    }
    
    .cb-floating[data-position="right"] {
        right: 15px;
    }
    
    .cb-item {
        font-size: 13px;
        padding: 8px 14px;
    }
    
    .cb-icon {
        width: 20px;
        height: 20px;
    }
    
    .cb-toggle-btn {
        padding: 6px;
    }
    
    /* Hide labels on very small screens */
    @media (max-width: 360px) {
        .cb-label,
        .cb-toggle-label {
            display: none;
        }
        
        .cb-item {
            padding: 10px;
            border-radius: 50%;
        }
        
        .cb-toggle-btn {
            padding: 12px;
            border-radius: 50%;
        }
    }
}

/* Ripple effect on click */
.cb-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cb-item:active::after {
    width: 300px;
    height: 300px;
}

/* Accessibility */
.cb-item:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Print - Hide floating buttons */
@media print {
    .cb-floating {
        display: none !important;
    }
}