/**
 * WordPress Chat Buttons Plugin - Core Styles
 * Version: 2.0.0
 * 
 * This file contains only the core/base styles for the chat buttons.
 * Animation effects are loaded separately via CSS Manager based on usage.
 */

/* Base Container Styles */
.wp-chat-buttons-container {
    position: fixed !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    z-index: 999999 !important;
    pointer-events: none !important;
}

.wp-chat-buttons-container > * {
    pointer-events: auto !important;
}

/* Position Styles */
.wp-chat-buttons-right {
    right: 20px !important;
    bottom: 20px !important;
}

.wp-chat-buttons-left {
    left: 20px !important;
    bottom: 20px !important;
}

.wp-chat-buttons-center {
    left: 50% !important;
    bottom: 20px !important;
    transform: translateX(-50%) !important;
}

.wp-chat-buttons-inline {
    position: static !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 15px !important;
    margin: 20px 0 !important;
}

/* Base Button Styles */
.wp-chat-button-item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Default circle button style */
.wp-chat-buttons-container .wp-chat-button-item {
    border-radius: 50% !important;
    width: 50px !important;
    height: 50px !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Button Size Variations */
.wp-chat-buttons-size-small .wp-chat-button-item {
    width: 40px !important;
    height: 40px !important;
}

.wp-chat-buttons-size-large .wp-chat-button-item {
    width: 60px !important;
    height: 60px !important;
}

/* Button Style Variations */
.wp-chat-buttons-style-rounded .wp-chat-button-item {
    border-radius: 10px !important;
}

.wp-chat-buttons-style-rounded-with-text .wp-chat-button-item {
    border-radius: 25px !important;
    padding-right: 20px !important;
    padding-left: 15px !important;
    width: auto !important;
    min-width: 50px !important;
    justify-content: flex-start !important;
}

.wp-chat-buttons-style-circle-with-text .wp-chat-button-item {
    border-radius: 50% !important;
    padding-right: 20px !important; 
    padding-left: 15px !important;
    width: auto !important;
    min-width: 50px !important;
    justify-content: flex-start !important;
}

/* Button Text Styles */
.wp-chat-button-text {
    margin-left: 10px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: white !important;
    white-space: nowrap !important;
}

/* Button Type Colors */
.wp-chat-button-phone {
    background-color: #f89414 !important;
}

.wp-chat-button-zalo {
    background-color: #0068ff !important;
}

.wp-chat-button-messenger {
    background-color: #0084ff !important;
}

.wp-chat-button-whatsapp {
    background-color: #25d366 !important;
}

.wp-chat-button-telegram {
    background-color: #0088cc !important;
}

.wp-chat-button-viber {
    background-color: #665cac !important;
}

.wp-chat-button-skype {
    background-color: #00aff0 !important;
}

.wp-chat-button-email {
    background-color: #34495e !important;
}

/* Icon Styles */
.wp-chat-button-item .dashicons {
    color: white !important;
    font-size: 24px !important;
    width: 24px !important;
    height: 24px !important;
    display: inline-block !important;
    max-width: 24px !important;
    max-height: 24px !important;
    line-height: 24px !important;
}

.wp-chat-button-item img {
    max-width: 60% !important;
    max-height: 60% !important;
    object-fit: contain !important;
}

/* Size-specific icon adjustments */
.wp-chat-buttons-size-small .wp-chat-button-item .dashicons {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
}

.wp-chat-buttons-size-large .wp-chat-button-item .dashicons {
    font-size: 28px !important;
    width: 28px !important;
    height: 28px !important;
}

/* Hover Effects */
.wp-chat-button-item:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2) !important;
}

.wp-chat-buttons-inline .wp-chat-button-item:hover {
    transform: translateY(-3px) scale(1.05) !important;
}

/* Admin Preview Styles */
.wp-chat-buttons-preview-container {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    background: #f9f9f9 !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
    margin: 15px 0 !important;
}

.wp-chat-buttons-preview-buttons {
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
}

.wp-chat-buttons-preview-button {
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15) !important;
    margin: 0 !important;
    cursor: default !important;
}

.wp-chat-buttons-preview-button img {
    max-width: 60% !important;
    max-height: 60% !important;
}

.wp-chat-buttons-preview-button .dashicons {
    color: white !important;
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
}

/* Admin preview style variations */
.wp-chat-buttons-preview-buttons.wp-chat-buttons-style-rounded .wp-chat-buttons-preview-button {
    border-radius: 10px !important;
}

.wp-chat-buttons-preview-buttons.wp-chat-buttons-style-rounded-with-text .wp-chat-buttons-preview-button {
    border-radius: 25px !important;
    width: auto !important;
    min-width: 40px !important;
    padding-right: 15px !important;
}

.wp-chat-buttons-preview-buttons.wp-chat-buttons-style-circle-with-text .wp-chat-buttons-preview-button {
    width: auto !important;
    min-width: 40px !important;
    padding-right: 15px !important;
}

/* Container Styles for Multi-layer Animations */
.wp-chat-ripple-container,
.wp-chat-shake-container,
.wp-chat-ringing-container,
.wp-chat-phone-ring-container {
    position: relative !important;
    display: inline-block !important;
}

/* Base Button Styles - Extended for all animation templates */
.wp-chat-button-item,
.whp-contact-icon,
.wp-chat-ripple-classic-button,
.wp-chat-ripple-button,
.wp-chat-pulse-button,
.wp-chat-shake-button,
.wp-chat-ringing-button,
.wp-chat-phone-ring-button {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    color: white !important;
    font-size: 20px !important;
    font-weight: bold !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    overflow: visible !important;
    position: relative !important;
}

/* Hover Effects for all button types */
.wp-chat-button-item:hover,
.whp-contact-icon:hover,
.wp-chat-ripple-classic-button:hover,
.wp-chat-ripple-button:hover,
.wp-chat-pulse-button:hover,
.wp-chat-shake-button:hover,
.wp-chat-ringing-button:hover,
.wp-chat-phone-ring-button:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
}

/* Animation Priority Fix - button-level animations take precedence */
.wp-chat-buttons-container .wp-chat-button-pulse {
    animation: wp-chat-pulse 1.5s ease-in-out infinite !important;
}

.wp-chat-buttons-container .wp-chat-button-shake {
    animation: wp-chat-shake 1s ease-in-out infinite !important;
}

.wp-chat-buttons-container .wp-chat-button-ringing {
    animation: wp-chat-ringing 1s ease-in-out infinite !important;
}

.wp-chat-buttons-container .wp-chat-button-phone-ring {
    animation: wp-chat-phone-ring 1.5s ease-in-out infinite !important;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .wp-chat-buttons-container {
        gap: 10px !important;
    }
    
    .wp-chat-buttons-right {
        right: 15px !important;
        bottom: 15px !important;
    }
    
    .wp-chat-buttons-left {
        left: 15px !important;
        bottom: 15px !important;
    }
    
    .wp-chat-buttons-center {
        bottom: 15px !important;
    }
    
    .wp-chat-buttons-inline {
        flex-wrap: wrap !important;
    }
    
    .wp-chat-button-item {
        width: 45px !important;
        height: 45px !important;
    }
    
    .wp-chat-buttons-size-large .wp-chat-button-item {
        width: 50px !important;
        height: 50px !important;
    }
    
    .wp-chat-buttons-size-small .wp-chat-button-item {
        width: 35px !important;
        height: 35px !important;
    }
    
    .wp-chat-button-text {
        font-size: 12px !important;
    }
}

@media screen and (max-width: 480px) {
    .wp-chat-buttons-container {
        gap: 8px !important;
    }
    
    .wp-chat-button-item {
        width: 40px !important;
        height: 40px !important;
    }
    
    .wp-chat-buttons-size-large .wp-chat-button-item {
        width: 45px !important;
        height: 45px !important;
    }
    
    .wp-chat-buttons-size-small .wp-chat-button-item {
        width: 32px !important;
        height: 32px !important;
    }
}

/* Print Styles */
@media print {
    .wp-chat-buttons-container {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-high-contrast: active) {
    .wp-chat-button-item {
        border: 2px solid !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wp-chat-buttons-preview-container {
        background: #2c2c2c !important;
        border-color: #555 !important;
        color: #fff !important;
    }
}
