/**
 * Cart Bell Widget Styles - Modern Design
 * Clean, minimal, and professional
 */

:root {
    --cbw-primary: #25D366;
    --cbw-primary-dark: #128C7E;
    --cbw-primary-light: #dcfce7;
    --cbw-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    --cbw-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --cbw-radius: 16px;
    --cbw-radius-lg: 24px;
    --cbw-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ===== Widget Container ===== */
.cart-bell-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: var(--cbw-font);
}

.cart-bell-widget.position-left {
    right: auto;
    left: 24px;
}

/* ===== Launcher Button ===== */
.cart-bell-launcher {
    width: 60px;
    height: 60px;
    background: var(--cbw-primary);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: none;
}

.cart-bell-launcher::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--cbw-primary);
    opacity: 0.3;
    animation: cbw-pulse 2s ease-in-out infinite;
}

@keyframes cbw-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.15);
        opacity: 0;
    }
}

.cart-bell-launcher:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.5);
}

.cart-bell-launcher:hover::before {
    animation: none;
    opacity: 0;
}

.cart-bell-launcher svg,
.cart-bell-launcher .dashicons {
    color: #fff;
    font-size: 28px;
    width: 28px;
    height: 28px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

/* Active state */
.cart-bell-widget.active .cart-bell-launcher {
    background: #1a1a2e;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: rotate(0);
}

.cart-bell-widget.active .cart-bell-launcher::before {
    display: none;
}

.cart-bell-widget.active .cart-bell-launcher svg,
.cart-bell-widget.active .cart-bell-launcher .dashicons {
    transform: rotate(45deg);
}

/* WhatsApp Icon SVG */
.cart-bell-launcher-icon {
    fill: #fff;
    width: 28px;
    height: 28px;
}

/* ===== Popup ===== */
.cart-bell-popup {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 48px);
    background: #fff;
    border-radius: var(--cbw-radius-lg);
    box-shadow: var(--cbw-shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
}

.cart-bell-widget.position-left .cart-bell-popup {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.cart-bell-popup.active {
    display: flex;
    animation: cbw-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cbw-slide-up {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== Header ===== */
.cart-bell-header {
    background: linear-gradient(135deg, var(--cbw-primary) 0%, var(--cbw-primary-dark) 100%);
    padding: 24px;
    color: #fff;
}

.cart-bell-header h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.cart-bell-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.cart-bell-close {
    display: none;
}

/* ===== Chat History ===== */
.cart-bell-chat-history {
    padding: 20px;
    background: #f8fafc;
}

.cart-bell-message {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.cart-bell-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--cbw-primary-light) 0%, #d1fae5 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cbw-primary-dark);
    flex-shrink: 0;
}

.cart-bell-avatar svg {
    width: 18px;
    height: 18px;
}

.cart-bell-text {
    background: #fff;
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    color: #1e293b;
    line-height: 1.5;
    max-width: calc(100% - 48px);
}

/* ===== Department Selector ===== */
.cart-bell-department-selector {
    padding: 0 20px 16px;
    background: #f8fafc;
}

.cart-bell-department-selector label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-bell-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cart-bell-chip {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.cart-bell-chip:hover {
    border-color: var(--cbw-primary);
    color: var(--cbw-primary-dark);
    background: var(--cbw-primary-light);
}

.cart-bell-chip.active {
    background: var(--cbw-primary);
    color: #fff;
    border-color: var(--cbw-primary);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.25);
}

/* ===== Input Area ===== */
.cart-bell-input-area {
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-bell-input-area textarea {
    flex: 1;
    border: none;
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    height: 44px;
    max-height: 88px;
    transition: all 0.2s ease;
    color: #1e293b;
}

.cart-bell-input-area textarea::placeholder {
    color: #94a3b8;
}

.cart-bell-input-area textarea:focus {
    outline: none;
    background: #fff;
    box-shadow: inset 0 0 0 2px var(--cbw-primary);
}

.cart-bell-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--cbw-primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.cart-bell-send-btn:hover {
    background: var(--cbw-primary-dark);
    transform: scale(1.05);
}

.cart-bell-send-btn:active {
    transform: scale(0.95);
}

.cart-bell-send-btn svg,
.cart-bell-send-btn .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

/* ===== Footer ===== */
.cart-bell-footer {
    padding: 8px 20px;
    text-align: center;
    background: #f8fafc;
    font-size: 11px;
    color: #94a3b8;
    border-top: 1px solid #f1f5f9;
}

.cart-bell-footer a {
    color: inherit;
    text-decoration: none;
}

.cart-bell-footer a:hover {
    color: var(--cbw-primary);
}

/* ===== Mobile Responsive ===== */
@media (max-width: 480px) {
    .cart-bell-widget {
        bottom: 16px;
        right: 16px;
    }

    .cart-bell-widget.position-left {
        left: 16px;
    }

    .cart-bell-popup {
        width: calc(100vw - 32px);
        max-height: calc(100vh - 120px);
        border-radius: var(--cbw-radius);
    }

    .cart-bell-launcher {
        width: 56px;
        height: 56px;
    }

    .cart-bell-launcher svg,
    .cart-bell-launcher .dashicons {
        width: 24px;
        height: 24px;
        font-size: 24px;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .cart-bell-launcher::before {
        animation: none;
    }

    .cart-bell-popup.active {
        animation: none;
    }

    .cart-bell-launcher,
    .cart-bell-chip,
    .cart-bell-send-btn {
        transition: none;
    }
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
    .cart-bell-popup {
        background: #1e293b;
    }

    .cart-bell-chat-history,
    .cart-bell-department-selector {
        background: #0f172a;
    }

    .cart-bell-text {
        background: #334155;
        color: #f1f5f9;
    }

    .cart-bell-chip {
        background: #334155;
        border-color: #475569;
        color: #e2e8f0;
    }

    .cart-bell-chip:hover {
        background: var(--cbw-primary-dark);
    }

    .cart-bell-input-area {
        background: #1e293b;
        border-top-color: #334155;
    }

    .cart-bell-input-area textarea {
        background: #0f172a;
        color: #f1f5f9;
    }

    .cart-bell-input-area textarea:focus {
        background: #1e293b;
    }

    .cart-bell-footer {
        background: #0f172a;
        border-top-color: #334155;
    }
}
