/* ==========================================================================
   📦 TM BUTTONS
   ========================================================================= */

.tm-floating-multi-chat-buttons-container {
    position: fixed !important;
    z-index: 999999 !important;
    width: var(--tm-btn-size) !important;
    height: var(--tm-btn-size) !important;
    pointer-events: none !important;
}

.tm-floating-multi-chat-buttons-container .tm-trigger-btn {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9999 !important;
    overflow: visible !important;
}

/* Common base styles for ALL round buttons (main and sub-buttons) */
.tm-floating-multi-chat-buttons-container .tm-btn {
    width: var(--tm-btn-size) !important;
    height: var(--tm-btn-size) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.3s ease !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

/* Enlarge buttons on hover */
.tm-floating-multi-chat-buttons-container .tm-btn:hover {
    transform: scale(1.08) !important;
}

/* ==========================================================================
   🖼️ ICON SCALING AND SQUARE GEOMETRY SUPPORT
   ========================================================================= */

/* Basic positioning for images and SVG */
.tm-floating-multi-chat-buttons-container .tm-btn img,
.tm-floating-multi-chat-buttons-container .tm-btn svg {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: contain !important;
}

/* ==========================================================================
   🖼️ ISOLATION OF CUSTOM ICONS (WITHOUT SHADOWS AND FRAMEWORK)
   ========================================================================= */

/* If the user has uploaded ANY custom icon (PNG, WEBP, SVG via img tag) */
.tm-floating-multi-chat-buttons-container .tm-sub-buttons .tm-btn:has(img) {
    background-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* The icon is displayed in its original, clean form without forced shadows */
.tm-floating-multi-chat-buttons-container .tm-sub-buttons .tm-btn img {
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* ==========================================================================
   🚀 LOGIC OF DISCLOSURE OF COMMUNICATION SUB-BUTTONS (STRICTLY UP)
   ========================================================================= */

/* Hard-position the sub-button container above our main chat button */
.tm-sub-buttons {
    position: absolute !important;
    bottom: calc(100% + 14px) !important; 
    left: 0 !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column-reverse !important; /* Strictly from bottom to top */
    gap: 12px !important;
    pointer-events: none !important;
}

.tm-floating-multi-chat-buttons-container.tm-active .tm-sub-buttons {
    pointer-events: auto !important;
}

/* When closed, the sub-buttons are completely hidden, compressed, and transparent */
.tm-sub-buttons .tm-btn {
    opacity: 0 !important;
    transform: scale(0) translateY(20px) !important;
    transition: opacity 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* When opened, the buttons are launched one by one based on their individual delay --tm-delay */
.tm-floating-multi-chat-buttons-container.tm-active .tm-sub-buttons .tm-btn {
    opacity: 1 !important;
    transform: scale(1) translateY(0) !important;
    transition-delay: calc(var(--tm-delay) * 0.07s) !important;
}

/* ==========================================================================
   💬 COMMUNICATION CHANNEL TIPS (TOOLTIPS)
   ========================================================================= */

.tm-btn .tm-tooltip {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) scale(0.8) !important;
    background-color: rgba(30, 30, 30, 0.95) !important;
    color: #ffffff !important;
    padding: 5px 12px !important;
    font-size: 12px !important;
    line-height: 16px !important;
    border-radius: 4px !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2) !important;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-weight: 500 !important;
}

/* Align tooltips depending on which side of the screen the plugin is on */
.tm-side-right .tm-btn .tm-tooltip {
    right: calc(100% + 12px) !important;
}

.tm-side-left .tm-btn .tm-tooltip {
    left: calc(100% + 12px) !important;
}

/* Smoothly display the tooltip when hovering the mouse over the messenger icon */
.tm-btn:hover .tm-tooltip {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(-50%) scale(1) !important;
}

/* ==========================================================================
   📱 ADAPTABILITY MANAGEMENT (MOBILE/PC)
   ========================================================================= */
@media (max-width: 768px) {
    .tm-hide_mobile { display: none !important; }
}
@media (min-width: 769px) {
    .tm-hide_desktop { display: none !important; }
}
