/**
 * LiveSupport - Main Stylesheet
 */

/* ============================================
   CHAT BUTTON - BASE STYLES
   ============================================ */

/* Wrapper for chat button */
.vtowp-livesupport-wrapper {
    position: relative;
    display: inline-block;
}

/* Main WhatsApp chat button */
.vtowp-livesupport-button {
    display: block;
    text-decoration: none;
    position: fixed !important;
    z-index: 99999 !important;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ============================================
   WHATSAPP ICON IMAGE STYLES
   ============================================ */

/* Icon container */
.vtowp-livesupport-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* WhatsApp icon image */
.vtowp-livesupport-icon img {
    width: 95% !important;
    height: 95% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
    display: block;
    margin: auto !important;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4) !important;
    transition: transform 0.3s ease !important;
    max-width: none !important;
}

/* Icon hover effect - scale up */
.vtowp-livesupport-button:hover .vtowp-livesupport-icon img {
    transform: scale(1.1) !important;
}

/* ============================================
   HOVER MESSAGE STYLES
   ============================================ */

/* Hover tooltip message */
.vtowp-livesupport-hover-message {
    position: absolute;
    white-space: nowrap;
    background-color: #25D366;
    color: white;
    font-size: 14px;
    padding: 10px;
    border-radius: 5px;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 500;
}

/* Show hover message on button hover */
.vtowp-livesupport-button:hover .vtowp-livesupport-hover-message {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   HOVER MESSAGE POSITIONS
   ============================================ */

/* Position: Top (above button) */
.vtowp-livesupport-hover-message[data-position="top"] {
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 10px;
}

/* Position: Bottom (below button) */
.vtowp-livesupport-hover-message[data-position="bottom"] {
    top: 100%;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
}

/* Position: Left (to the left of button) */
.vtowp-livesupport-hover-message[data-position="left"] {
    right: 100%;
    left: auto;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 10px;
}

/* Position: Right (to the right of button) */
.vtowp-livesupport-hover-message[data-position="right"] {
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
}

/* ============================================
   HOVER ANIMATIONS
   ============================================ */

/* Fade in from top */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Fade in from bottom */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Fade in from left */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translate(10px, -50%);
    }
    to {
        opacity: 1;
        transform: translate(0, -50%);
    }
}

/* Fade in from right */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translate(-10px, -50%);
    }
    to {
        opacity: 1;
        transform: translate(0, -50%);
    }
}

/* Base animation properties for hover message */
.vtowp-livesupport-hover-message {
    animation-duration: 0.3s;
    animation-fill-mode: both;
}

/* Apply animations based on position */
.vtowp-livesupport-button:hover .vtowp-livesupport-hover-message[data-position="top"] {
    animation-name: fadeInDown;
}

.vtowp-livesupport-button:hover .vtowp-livesupport-hover-message[data-position="bottom"] {
    animation-name: fadeInUp;
}

.vtowp-livesupport-button:hover .vtowp-livesupport-hover-message[data-position="left"] {
    animation-name: fadeInLeft;
}

.vtowp-livesupport-button:hover .vtowp-livesupport-hover-message[data-position="right"] {
    animation-name: fadeInRight;
}

/* ============================================
   RESPONSIVE DESIGN - MOBILE ADJUSTMENTS
   ============================================ */

/* Tablet styles (max-width: 768px) */
@media screen and (max-width: 768px) {
    .vtowp-livesupport-button {
        bottom: auto !important;
        top: auto !important;
    }
}

#visual-pointer {
    transform: translate(-50%, -50%) !important;
}

/* Force canvas height for mobile preview */
#visual-canvas {
    height: 238px !important;
    min-height: 238px !important;
}

/* ✅ FIX: Keep pointer centered */
#visual-pointer {
    transform: translate(-50%, -50%) !important;
}

/* Mobile styles (max-width: 480px) */
@media screen and (max-width: 480px) {
    .vtowp-livesupport-icon {
        width: 45px;
        height: 45px;
    }
    
    /* Hide hover message on very small screens */
    .vtowp-livesupport-hover-message {
        display: none;
    }
}

/* ============================================
   UTILITY STYLES
   ============================================ */

/* Preview container for admin panel */
.vtowp-livesupport-preview-container {
    position: relative;
    min-height: 200px;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 8px;
    margin-top: 20px;
    padding: 20px;
}

/* Preview button positioning */
.vtowp-livesupport-preview-container .vtowp-livesupport-button {
    position: relative !important;
}

/* Hide chat button when printing */
@media print {
    .vtowp-livesupport-wrapper {
        display: none;
    }
}

/* Focus state for accessibility */
.vtowp-livesupport-button:focus {
    outline: 2px solid #25D366;
    outline-offset: 2px;
}

/* Remove focus outline for mouse users (accessibility) */
.vtowp-livesupport-button:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   LOADING STATE
   ============================================ */

/* Loading state - dimmed icon */
.vtowp-livesupport-wrapper.loading .vtowp-livesupport-icon {
    opacity: 0.7;
    pointer-events: none;
}

/* Loading spinner overlay */
.vtowp-livesupport-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #25D366;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Spin animation for loading spinner */
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}