/* BarçaCab WhatsApp Integration Styles */

/* Floating Widget */
.barcacab-whatsapp-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.barcacab-whatsapp-bottom-right {
    bottom: 20px;
    right: 20px;
}

.barcacab-whatsapp-bottom-left {
    bottom: 20px;
    left: 20px;
}

.barcacab-whatsapp-top-right {
    top: 20px;
    right: 20px;
}

.barcacab-whatsapp-top-left {
    top: 20px;
    left: 20px;
}

/* Toggle Button */
.barcacab-whatsapp-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: barcacab-whatsapp-bounce 2s infinite;
}

.barcacab-whatsapp-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
}

.barcacab-whatsapp-icon {
    width: 32px;
    height: 32px;
    color: white;
}

.barcacab-whatsapp-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.3);
    animation: barcacab-whatsapp-pulse 2s infinite;
}

@keyframes barcacab-whatsapp-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes barcacab-whatsapp-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Chat Box */
.barcacab-whatsapp-chat-box {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s ease;
    overflow: hidden;
}

.barcacab-whatsapp-chat-box.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.barcacab-whatsapp-bottom-left .barcacab-whatsapp-chat-box {
    right: auto;
    left: 0;
}

.barcacab-whatsapp-top-right .barcacab-whatsapp-chat-box,
.barcacab-whatsapp-top-left .barcacab-whatsapp-chat-box {
    bottom: auto;
    top: 80px;
}

/* Chat Header */
.barcacab-whatsapp-header {
    background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.barcacab-whatsapp-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.barcacab-whatsapp-avatar svg {
    width: 24px;
    height: 24px;
    color: white;
}

.barcacab-whatsapp-info h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.barcacab-whatsapp-status {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.barcacab-whatsapp-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.barcacab-whatsapp-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Body */
.barcacab-whatsapp-body {
    padding: 20px;
}

.barcacab-whatsapp-message {
    background: #F3F4F6;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    position: relative;
}

.barcacab-whatsapp-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 8px 8px 0;
    border-color: transparent #F3F4F6 transparent transparent;
}

.barcacab-whatsapp-message p {
    margin: 0;
    color: #374151;
    font-size: 14px;
    line-height: 1.4;
}

.barcacab-whatsapp-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.barcacab-whatsapp-chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
    text-decoration: none;
    color: white;
}

.barcacab-whatsapp-chat-btn svg {
    width: 18px;
    height: 18px;
}

/* Shortcode Styles */
.barcacab-whatsapp-shortcode-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.2);
}

.barcacab-whatsapp-shortcode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    text-decoration: none;
    color: white;
}

.barcacab-whatsapp-shortcode-btn svg {
    width: 20px;
    height: 20px;
}

.barcacab-whatsapp-shortcode-link,
.barcacab-whatsapp-text-link {
    color: #25D366;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.barcacab-whatsapp-shortcode-link:hover,
.barcacab-whatsapp-text-link:hover {
    color: #128C7E;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .barcacab-whatsapp-hide-mobile {
        display: none !important;
    }
    
    .barcacab-whatsapp-chat-box {
        width: 280px;
        bottom: 70px;
    }
    
    .barcacab-whatsapp-bottom-right {
        right: 15px;
        bottom: 15px;
    }
    
    .barcacab-whatsapp-bottom-left {
        left: 15px;
        bottom: 15px;
    }
    
    .barcacab-whatsapp-toggle {
        width: 55px;
        height: 55px;
    }
    
    .barcacab-whatsapp-icon {
        width: 28px;
        height: 28px;
    }
}

@media (min-width: 769px) {
    .barcacab-whatsapp-hide-desktop {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .barcacab-whatsapp-chat-box {
        width: calc(100vw - 40px);
        max-width: 300px;
    }
    
    .barcacab-whatsapp-shortcode-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Animation for entrance */
.barcacab-whatsapp-widget {
    animation: barcacab-whatsapp-slide-in 0.5s ease-out;
}

@keyframes barcacab-whatsapp-slide-in {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility */
.barcacab-whatsapp-toggle:focus,
.barcacab-whatsapp-chat-btn:focus,
.barcacab-whatsapp-shortcode-btn:focus {
    outline: 2px solid #25D366;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .barcacab-whatsapp-widget {
        display: none !important;
    }
}