/**
 * Contact Widget Styling
 * Floating contact buttons (SMS, WhatsApp, Call)
 *
 * @package WeymanBusinessHub
 */

/* Widget Container */
.whdr-contact-widget {
    position: fixed;
    z-index: 999998;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.whdr-contact-widget.show {
    opacity: 1;
    transform: scale(1);
}

/* Position variants */
.whdr-contact-widget.bottom-right {
    bottom: 80px;
    right: 20px;
}

.whdr-contact-widget.bottom-left {
    bottom: 80px;
    left: 20px;
}

.whdr-contact-widget.top-right {
    top: 80px;
    right: 20px;
}

.whdr-contact-widget.top-left {
    top: 80px;
    left: 20px;
}

/* Toggle Button */
.whdr-cw-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d63638 0%, #a02b2d 100%);
    border: none;
    box-shadow: 0 4px 20px rgba(214, 54, 56, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.whdr-cw-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(214, 54, 56, 0.5);
}

.whdr-cw-toggle:active {
    transform: scale(0.95);
}

.whdr-cw-toggle-icon,
.whdr-cw-toggle-close {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.whdr-cw-toggle-icon {
    color: white;
    opacity: 1;
}

.whdr-cw-toggle-close {
    font-size: 32px;
    color: white;
    line-height: 1;
    opacity: 0;
    font-weight: 300;
}

.whdr-contact-widget.expanded .whdr-cw-toggle-icon {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg);
}

.whdr-contact-widget.expanded .whdr-cw-toggle-close {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg);
}

/* Buttons Container */
.whdr-cw-buttons {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 0;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    min-width: 280px;
    overflow: hidden;
}

.whdr-contact-widget.bottom-left .whdr-cw-buttons {
    right: auto;
    left: 0;
}

.whdr-contact-widget.expanded .whdr-cw-buttons {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.whdr-cw-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.whdr-cw-header h4 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 600;
    color: #000000;
}

.whdr-cw-header p {
    margin: 0;
    font-size: 13px;
    color: #666666;
}

/* Contact Buttons */
.whdr-cw-button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    text-decoration: none;
    color: #000000;
    transition: background 0.2s ease, transform 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.whdr-cw-button:last-child {
    border-bottom: none;
}

.whdr-cw-button:hover {
    background: #f8f9fa;
    transform: translateX(4px);
}

.whdr-cw-button:active {
    transform: translateX(2px);
}

/* Button Icon */
.whdr-cw-icon {
    font-size: 28px;
    line-height: 1;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f0f0f0;
}

/* Button Text */
.whdr-cw-label {
    font-size: 15px;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.whdr-cw-sublabel {
    font-size: 12px;
    color: #666666;
    display: block;
}

/* Button Color Variants */
.whdr-cw-call .whdr-cw-icon {
    background: #e3f2fd;
    color: #1976d2;
}

.whdr-cw-call:hover .whdr-cw-icon {
    background: #1976d2;
    color: white;
}

.whdr-cw-sms .whdr-cw-icon {
    background: #f3e5f5;
    color: #7b1fa2;
}

.whdr-cw-sms:hover .whdr-cw-icon {
    background: #7b1fa2;
    color: white;
}

.whdr-cw-whatsapp .whdr-cw-icon {
    background: #e8f5e9;
    color: #388e3c;
}

.whdr-cw-whatsapp:hover .whdr-cw-icon {
    background: #25d366;
    color: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .whdr-contact-widget.bottom-right,
    .whdr-contact-widget.bottom-left {
        bottom: 20px;
        right: 10px;
        left: auto;
    }

    .whdr-cw-toggle {
        width: 56px;
        height: 56px;
    }

    .whdr-cw-buttons {
        min-width: 260px;
        max-width: calc(100vw - 80px);
    }

    .whdr-cw-header h4 {
        font-size: 16px;
    }

    .whdr-cw-label {
        font-size: 14px;
    }
}

/* Pulse Animation for Toggle Button */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(214, 54, 56, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(214, 54, 56, 0.4), 0 0 0 10px rgba(214, 54, 56, 0.1);
    }
}

.whdr-cw-toggle {
    animation: pulse 2s infinite;
}

.whdr-contact-widget.expanded .whdr-cw-toggle {
    animation: none;
}

/* Entrance Animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.whdr-contact-widget.show .whdr-cw-toggle {
    animation: slideInUp 0.5s ease forwards;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .whdr-cw-buttons {
        background: #1a1a1a;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    }

    .whdr-cw-header {
        background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
        border-bottom-color: #333333;
    }

    .whdr-cw-header h4 {
        color: #ffffff;
    }

    .whdr-cw-header p {
        color: #aaaaaa;
    }

    .whdr-cw-button {
        color: #ffffff;
        border-bottom-color: #333333;
    }

    .whdr-cw-button:hover {
        background: #2a2a2a;
    }

    .whdr-cw-sublabel {
        color: #aaaaaa;
    }
}

/* Print - Hide widget */
@media print {
    .whdr-contact-widget {
        display: none !important;
    }
}
