/**
 * Prime Chat - Frontend Styles
 * Modern, responsive styling for the floating WhatsApp widget
 */

.prime-chat-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

/* Position Variations */
.prime-chat-bottom-right {
    bottom: 20px;
    right: 20px;
}

.prime-chat-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Floating Button */
.prime-chat-button {
    position: relative;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    outline: none;
}

.prime-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.prime-chat-button:active {
    transform: scale(0.95);
}

/* Pulse Animation */
.prime-chat-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0.6;
    animation: prime-chat-pulse 2s infinite;
}

@keyframes prime-chat-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Popup */
.prime-chat-popup {
    position: absolute;
    bottom: 80px;
    width: 340px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.prime-chat-bottom-right .prime-chat-popup {
    right: 0;
}

.prime-chat-bottom-left .prime-chat-popup {
    left: 0;
}

.prime-chat-widget.active .prime-chat-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Popup Header */
.prime-chat-popup-header {
    padding: 20px;
    border-radius: 12px 12px 0 0;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.prime-chat-popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.prime-chat-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.prime-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Popup Body */
.prime-chat-popup-body {
    padding: 20px;
}

.prime-chat-popup-intro {
    margin: 0 0 16px 0;
    color: #646970;
    font-size: 14px;
    line-height: 1.5;
}

/* Contacts */
.prime-chat-contacts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prime-chat-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f6f7f7;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.prime-chat-contact:hover {
    background: #e8f5e9;
    border-color: #25D366;
    transform: translateX(4px);
}

.prime-chat-contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.prime-chat-contact-info {
    flex: 1;
}

.prime-chat-contact-name {
    font-weight: 600;
    font-size: 15px;
    color: #1d2327;
    margin-bottom: 4px;
}

.prime-chat-contact-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #646970;
}

.prime-chat-online-indicator {
    width: 8px;
    height: 8px;
    background: #25D366;
    border-radius: 50%;
    display: inline-block;
    animation: prime-chat-blink 2s infinite;
}

@keyframes prime-chat-blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.prime-chat-contact-arrow {
    color: #8c8f94;
    display: flex;
    align-items: center;
}

.prime-chat-contact:hover .prime-chat-contact-arrow {
    color: #25D366;
}

/* Popup Footer */
.prime-chat-popup-footer {
    padding: 16px 20px;
    background: #f6f7f7;
    border-radius: 0 0 12px 12px;
    text-align: center;
}

.prime-chat-popup-footer p {
    margin: 0;
    font-size: 12px;
    color: #646970;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .prime-chat-bottom-right,
    .prime-chat-bottom-left {
        bottom: 16px;
        right: 16px;
        left: auto;
    }
    
    .prime-chat-popup {
        width: calc(100vw - 32px);
        max-width: 340px;
    }
    
    .prime-chat-bottom-left .prime-chat-popup {
        left: auto;
        right: 0;
    }
}

@media (max-width: 360px) {
    .prime-chat-popup {
        bottom: 70px;
    }
    
    .prime-chat-popup-header {
        padding: 16px;
    }
    
    .prime-chat-popup-body {
        padding: 16px;
    }
    
    .prime-chat-contact {
        padding: 10px;
    }
    
    .prime-chat-contact-avatar {
        width: 40px;
        height: 40px;
    }
}

/* Tablet Adjustments */
@media (min-width: 481px) and (max-width: 768px) {
    .prime-chat-bottom-right,
    .prime-chat-bottom-left {
        bottom: 24px;
    }
    
    .prime-chat-bottom-right {
        right: 24px;
    }
    
    .prime-chat-bottom-left {
        left: 24px;
    }
}

/* Hide on Print */
@media print {
    .prime-chat-widget {
        display: none !important;
    }
}

/* Smooth Transitions */
* {
    -webkit-tap-highlight-color: transparent;
}

.prime-chat-contact,
.prime-chat-button,
.prime-chat-close {
    -webkit-touch-callout: none;
    user-select: none;
}

/* Accessibility */
.prime-chat-button:focus,
.prime-chat-close:focus,
.prime-chat-contact:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .prime-chat-popup {
        background: #1e1e1e;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }
    
    .prime-chat-popup-intro {
        color: #b4b4b4;
    }
    
    .prime-chat-contact {
        background: #2a2a2a;
    }
    
    .prime-chat-contact:hover {
        background: #1a3a1a;
    }
    
    .prime-chat-contact-name {
        color: #ffffff;
    }
    
    .prime-chat-contact-status {
        color: #b4b4b4;
    }
    
    .prime-chat-popup-footer {
        background: #2a2a2a;
    }
    
    .prime-chat-popup-footer p {
        color: #b4b4b4;
    }
}
