/**
 * WhatsApp Chat Widget Frontend Styles
 */

/* Chatbox Widget */
.prestawhatsapp-chatbox {
    position: fixed;
    bottom: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.prestawhatsapp-chatbox[data-position="right"] {
    right: 20px;
}

.prestawhatsapp-chatbox[data-position="left"] {
    left: 20px;
}

/* Floating Button */
.prestawhatsapp-chatbox-button {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    color: white;
}

.prestawhatsapp-chatbox-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
}

/* Popup */
.prestawhatsapp-chatbox-popup {
    position: absolute;
    bottom: 80px;
    width: 350px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: none;
    animation: slideUp 0.3s ease;
}

.prestawhatsapp-chatbox[data-position="right"] .prestawhatsapp-chatbox-popup {
    right: 0;
}

.prestawhatsapp-chatbox[data-position="left"] .prestawhatsapp-chatbox-popup {
    left: 0;
}

.prestawhatsapp-chatbox-popup.show {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.prestawhatsapp-chatbox-header {
    background: #25D366;
    color: white;
    padding: 20px;
}

.prestawhatsapp-chatbox-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.prestawhatsapp-chatbox-header-content svg {
    width: 24px;
    height: 24px;
}

.prestawhatsapp-chatbox-subtitle {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
    font-weight: 400;
}

/* Accounts List */
.prestawhatsapp-chatbox-accounts {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    padding-bottom: 70px;
    position: relative;
    margin-bottom: 0;
    min-height: 100px;
}

.prestawhatsapp-account-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    background: #f8f9fa;
}

.prestawhatsapp-account-item:hover {
    background: #e9ecef;
}

.prestawhatsapp-account-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
}

.prestawhatsapp-account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prestawhatsapp-avatar-placeholder {
    width: 100%;
    height: 100%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.prestawhatsapp-account-info {
    flex: 1;
    min-width: 0;
}

.prestawhatsapp-account-name {
    font-weight: 600;
    font-size: 14px;
    color: #212529;
    margin-bottom: 2px;
}

.prestawhatsapp-account-title {
    font-size: 12px;
    color: #6c757d;
}

.prestawhatsapp-account-status {
    margin-left: auto;
}

.prestawhatsapp-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: lowercase;
}

.prestawhatsapp-status-badge.online {
    background: #25D366;
    color: white;
}

.prestawhatsapp-status-badge.offline {
    background: #6c757d;
    color: white;
}

/* Close Button */
.prestawhatsapp-chatbox-close {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin: 0;
}

.prestawhatsapp-chatbox-close:hover {
    background: #20ba5a;
    transform: scale(1.1);
}

.prestawhatsapp-chatbox-close svg {
    width: 20px;
    height: 20px;
}


/* Product Page Widget */
.prestawhatsapp-product-widget {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    clear: both;
    max-width: 400px;
    width: auto;
}

.prestawhatsapp-product-account {
    margin-bottom: 15px;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.prestawhatsapp-product-account-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
}

.prestawhatsapp-product-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid #e9ecef;
}

.prestawhatsapp-product-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prestawhatsapp-product-account-details {
    flex: 1;
    min-width: 0;
}

.prestawhatsapp-product-account-name {
    font-weight: 600;
    font-size: 14px;
    color: #212529;
    margin-bottom: 2px;
    line-height: 1.3;
}

.prestawhatsapp-product-account-title {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.3;
}

.prestawhatsapp-product-status {
    margin-left: auto;
    align-self: center;
}

.prestawhatsapp-product-offline-message {
    margin-bottom: 10px;
    padding: 8px 10px;
    background: #f8f9fa;
    border-left: 3px solid #6c757d;
    border-radius: 3px;
    font-size: 12px;
    color: #495057;
    line-height: 1.4;
}

.prestawhatsapp-product-button {
    display: inline-block;
    padding: 10px 20px;
    background: #25D366;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    margin-top: 8px;
}

.prestawhatsapp-product-button:hover {
    background: #20ba5a;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .prestawhatsapp-chatbox-popup {
        width: calc(100vw - 40px);
        max-width: 350px;
    }
    
    .prestawhatsapp-chatbox-button {
        width: 56px;
        height: 56px;
    }
}
