/**
 * Contact Buttons Plugin Styles
 * 
 * @package     Joomla.Plugin
 * @subpackage  System.contactbuttons
 * @copyright   Copyright (C) 2026 Tutto Bene. All rights reserved.
 * @license     GNU General Public License version 2 or later
 */

/* Main wrapper positioning */
.contact-buttons-wrapper {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.contact-buttons-wrapper.contact-buttons-bottom-right {
    bottom: 20px;
    right: 20px;
}

.contact-buttons-wrapper.contact-buttons-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Contact buttons list */
.contact-buttons-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.contact-buttons-list.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Individual contact button */
.contact-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.65);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: none;
    cursor: pointer;
}

.contact-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.contact-button svg {
    width: 28px;
    height: 28px;
}

/* Phone button - uses primary color or custom color */
.contact-button-phone svg {
    fill: var(--icon-color, var(--tm-primary-color, #1e87f0));
}

/* WhatsApp button */
.contact-button-whatsapp svg {
    fill: var(--icon-color, #25D366);
}

/* Telegram button */
.contact-button-telegram svg {
    fill: var(--icon-color, #0088cc);
}

/* MAX button - uses gradient */
.contact-button-max svg {
    /* Gradient is defined inside SVG */
}

/* Toggle button (main button) */
.contact-buttons-toggle,
.contact-buttons-close {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.contact-buttons-toggle:hover,
.contact-buttons-close:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.contact-buttons-toggle svg {
    stroke: var(--tm-primary-color, #1e87f0);
}

.contact-buttons-close svg {
    stroke: #666;
}

/* Pulse animation for toggle button */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.contact-buttons-wrapper[data-animation="1"] .contact-buttons-toggle {
    animation: pulse 2s infinite;
}

.contact-buttons-wrapper[data-animation="1"] .contact-buttons-toggle:hover {
    animation: none;
}

/* Staggered animation for buttons appearing */
.contact-buttons-list.active .contact-button {
    animation: slideIn 0.3s ease-out backwards;
}

.contact-buttons-list.active .contact-button:nth-child(1) {
    animation-delay: 0.05s;
}

.contact-buttons-list.active .contact-button:nth-child(2) {
    animation-delay: 0.1s;
}

.contact-buttons-list.active .contact-button:nth-child(3) {
    animation-delay: 0.15s;
}

.contact-buttons-list.active .contact-button:nth-child(4) {
    animation-delay: 0.2s;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .contact-buttons-wrapper.contact-buttons-bottom-right {
        bottom: 15px;
        right: 15px;
    }
    
    .contact-buttons-wrapper.contact-buttons-bottom-left {
        bottom: 15px;
        left: 15px;
    }
    
    .contact-button {
        width: 75px;
        height: 75px;
    }
    
    .contact-button svg {
        width: 36px;
        height: 36px;
    }
    
    .contact-buttons-toggle,
    .contact-buttons-close {
        width: 84px;
        height: 84px;
    }
}

/* Accessibility */
.contact-button:focus,
.contact-buttons-toggle:focus,
.contact-buttons-close:focus {
    outline: 2px solid var(--tm-primary-color, #1e87f0);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .contact-buttons-wrapper[data-animation="1"] .contact-buttons-toggle {
        animation: none;
    }
    
    .contact-buttons-list,
    .contact-button,
    .contact-buttons-toggle,
    .contact-buttons-close {
        transition: none;
        animation: none;
    }
}
