/* ===== BRANDED STYLES FOR FLOATING CONTACTIFY WIDGET ===== */
.contactify-container {
    position: fixed;
    bottom: 24px;
    z-index: 999999;
    direction: rtl;
    text-align: right;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 12px;
    transition: left 0.3s ease, right 0.3s ease;
}
.contactify-container.pos-left {
    left: 24px;
    right: auto;
}
.contactify-container.pos-right {
    right: 24px;
    left: auto;
}

.wpos-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--contactify-grad);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 3;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}
.wpos-toggle:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.wpos-toggle svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    position: absolute;
    transition: transform 0.3s ease, opacity 0.25s ease;
}
.wpos-toggle .wpos-ic-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

.wpos-online-indicator-dot {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 15px;
    height: 15px;
    background: #00e676;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.8);
    animation: wposIndicatorPulse 1.5s infinite alternate;
    z-index: 5;
    pointer-events: none;
}
@keyframes wposIndicatorPulse {
    0% { transform: scale(0.9); box-shadow: 0 0 4px rgba(0, 230, 118, 0.5); }
    100% { transform: scale(1.1); box-shadow: 0 0 12px rgba(0, 230, 118, 0.9); }
}
.wpos-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--contactify-primary);
    opacity: 0.35;
    animation: wposPulse 2.2s infinite ease-out;
    pointer-events: none;
}
@keyframes wposPulse {
    0% { transform: scale(1); opacity: 0.8; }
    70% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ===== PANEL AREA WITH HIGH RESPONSIVENESS ===== */
.contactify-panel {
    width: var(--contactify-width, 325px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16);
    overflow: hidden;
    position: absolute;
    bottom: 80px;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}
.contactify-container.pos-left .contactify-panel {
    left: 0;
    right: auto;
    transform-origin: bottom left;
    transform: scale(0.85) translateY(20px);
}
.contactify-container.pos-right .contactify-panel {
    right: 0;
    left: auto;
    transform-origin: bottom right;
    transform: scale(0.85) translateY(20px);
}
.contactify-container.open .contactify-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}
.contactify-container.open .wpos-toggle {
    background: #333333;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.contactify-container.open .wpos-toggle .wpos-ic-chat {
    opacity: 0;
    transform: rotate(90deg) scale(0.6);
}
.contactify-container.open .wpos-toggle .wpos-ic-close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

/* ===== CORE COMPONENTS ===== */
.contactify-header {
    background: var(--contactify-grad);
    padding: 20px 16px 16px;
    text-align: center;
    color: #ffffff;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}

/* Faint circle on the top left of the header - RESTORED */
.contactify-header::before {
    content: '';
    position: absolute;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    top: -55px;
    left: -45px;
    pointer-events: none;
}

.contactify-logo {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255,255,255,0.35);
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    z-index: 2;
}
.contactify-logo svg {
    width: 26px;
    height: 26px;
    fill: #ffffff;
}
.contactify-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.contactify-header h2 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px 0 !important;
    color: #ffffff !important;
    position: relative;
    z-index: 2;
}
.contactify-header p {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 !important;
    position: relative;
    z-index: 2;
}
.contactify-status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    position: relative;
    z-index: 2;
}
.contactify-dot {
    width: 8px;
    height: 8px;
    background: #69f0ae;
    border-radius: 50%;
    animation: contactifyBlink 1.8s infinite ease-in-out;
}
@keyframes contactifyBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.contactify-status-row span {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.9);
}

.contactify-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.contactify-tab {
    flex: 1;
    padding: 10px 2px 8px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #94a3b8;
    border-bottom: 3px solid transparent;
    transition: all 0.25s ease;
    font-family: inherit;
	border-radius: 0;
}
.contactify-tab svg {
    width: 18px;
    height: 18px;
    fill: #cbd5e1;
}
.contactify-tab.active,.contactify-tab:hover {
    color: var(--contactify-dark) !important;
    border-bottom-color: var(--contactify-dark) !important;
    background: #ffffff !important;
}
.contactify-tab.active svg,.contactify-tab:hover svg {
    fill: var(--contactify-dark) !important;
}

/* Scroll limitations for 3 items display and vertical scrolling */
.contactify-content {
    overflow-y: auto;
    flex: 1;
    height: 255px;
    max-height: 255px;
    background: #ffffff;
}
.contactify-pane {
    display: none;
    padding: 12px 10px;
}
.contactify-pane.active {
    display: block;
}

/* Contacts layout and timing states badges */
.wp-card-item {
    background: #fafafa;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 8px;
}
.wp-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.wp-card-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f1f5f9;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wp-card-avatar svg {
    width: 20px;
    height: 20px;
    fill: #94a3b8;
}
.wp-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wp-card-details strong {
    display: block;
    font-size: 12.5px;
    color: #1e293b;
    font-weight: 700;
}
.expert-status-dot {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 50px;
    color: #ffffff;
    font-weight: bold;
}
.expert-status-dot.online-badge {
    background-color: #10b981;
}
.expert-status-dot.offline-badge {
    background-color: #ef4444;
}
.hours-text {
    font-size: 10px;
    color: #64748b;
}

.wp-card-actions {
    display: flex;
    gap: 6px;
}
.wp-action-btn {
    flex: 1;
    padding: 6px;
    border-radius: 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none !important;
}
.contactify-btn-tel {
    background: var(--contactify-primary);
    color: #ffffff !important;
}
.contactify-btn-wa {
    background: #25d366;
    color: #ffffff !important;
}

/* Messengers layout */
.wpos-msg-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fafafa;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 8px 10px;
    margin-bottom: 8px;
    text-decoration: none !important;
    transition: transform 0.2s, background-color 0.2s;
}
.wpos-msg-card:hover {
    transform: translateX(-2px);
    background: #f8fafc;
}
.wpos-msg-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wpos-msg-icon svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
}
.wpos-msg-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}
.contactify-msg-whatsapp .wpos-msg-icon { background: #25d366; }
.contactify-msg-telegram .wpos-msg-icon { background: #0088cc; }
.contactify-msg-instagram .wpos-msg-icon { background: linear-gradient(135deg,#833ab4,#fd1d1d,#fcb045); }
.contactify-msg-custom .wpos-msg-icon { background: #64748b; }

.wpos-msg-meta {
    flex: 1;
}
.wpos-msg-meta strong {
    display: block;
    font-size: 12px;
    color: #1e293b;
}
.wpos-msg-meta span {
    font-size: 10px;
    color: #64748b;
}
.wpos-msg-arrow svg {
    width: 16px;
    height: 16px;
    fill: #94a3b8;
}

/* Location details */
.wpos-map-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
}
.wpos-map-btn {
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    text-decoration: none !important;
    color: #ffffff !important;
}
.wpos-map-btn.neshan { background: #1976d2; }
.wpos-map-btn.balad { background: #388e3c; }
.wpos-map-btn.google { background: #ea4335; }

.wpos-address-box {
    display: flex;
    gap: 8px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px;
    font-size: 11px;
    line-height: 1.8;
    color: #334155;
    margin-bottom: 8px;
}
.wpos-address-box svg {
    width: 16px;
    height: 16px;
    fill: var(--contactify-primary);
    flex-shrink: 0;
}
.wpos-workhours {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff8e1;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 11px;
    color: #b7791f;
}
.wpos-workhours svg {
    width: 14px;
    height: 14px;
    fill: #b7791f;
}

/* FAQ accordion styling */
.wpos-faq-item {
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    margin-bottom: 6px;
    overflow: hidden;
}
.wpos-faq-q {
    width: 100%;
    padding: 10px;
    background: #fafafa;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 11.5px;
    color: #1e293b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
}
.wpos-faq-q svg {
    width: 14px;
    height: 14px;
    fill: #94a3b8;
    transition: transform 0.25s ease;
}
.wpos-faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.2s ease;
    font-size: 11px;
    color: #475569;
    line-height: 1.8;
    background: #ffffff;
    padding: 0 10px;
}
.wpos-faq-item.open .wpos-faq-q {
    background: #fff5f5;
    color: var(--contactify-dark);
}
.wpos-faq-item.open .wpos-faq-q svg {
    transform: rotate(180deg);
    fill: var(--contactify-dark);
}
.wpos-faq-item.open .wpos-faq-a {
    max-height: 180px;
    padding: 8px 10px 10px;
    border-top: 1px solid #fff5f5;
}

.contactify-empty-msg {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    padding: 30px 10px;
}
.wpos-footer {
    text-align: center;
    padding: 8px;
    font-size: 9px;
    color: #cbd5e1;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
    flex-shrink: 0;
}

/* ===== NEW: INTERACTIVE GREETING BUBBLE ===== */
.contactify-bubble {
    position: absolute;
    bottom: 80px;
    background: #ffffff;
    color: #1e293b;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    border: 1px solid #cbd5e1;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
    user-select: none;
}
.contactify-container.pos-left .contactify-bubble {
    left: 0;
    transform-origin: bottom left;
}
.contactify-container.pos-right .contactify-bubble {
    right: 0;
    transform-origin: bottom right;
}
.contactify-bubble.show {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
    cursor: pointer;
}
.contactify-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-right: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
    transform: rotate(45deg);
}
.contactify-container.pos-left .contactify-bubble::after {
    left: 24px;
}
.contactify-container.pos-right .contactify-bubble::after {
    right: 24px;
}
.contactify-bubble-close {
    position: absolute !important;
    top: -6px;
    left: -6px;
    width: 18px;
    height: 18px;
    background: #ef4444 !important;
    color: #ffffff !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 10px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35) !important;
    border: none !important;
    box-sizing: border-box;
    min-height: unset !important;
    padding: 0 !important;
}

/* ===== NEW: OFFLINE LEAD FORM COMPONENT ===== */
.contactify-offline-box {
    padding: 12px 6px;
    text-align: center;
}
.contactify-offline-header {
    margin-bottom: 15px;
}
.contactify-offline-header .contactify-moon-icon {
    font-size: 30px;
    display: block;
    margin-bottom: 6px;
}
.contactify-offline-header strong {
    font-size: 13.5px;
    color: #1e293b;
    display: block;
    margin-bottom: 4px;
}
.contactify-offline-header p {
    font-size: 10.5px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 !important;
}
.contactify-lead-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.contactify-lead-field input,
.contactify-lead-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: inherit;
    background: #ffffff;
}
.contactify-lead-field input:focus,
.contactify-lead-field textarea:focus {
    border-color: var(--contactify-primary);
}
.contactify-lead-submit {
    background: var(--contactify-grad);
    color: #ffffff;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: opacity 0.2s;
    font-family: inherit;
}
.contactify-lead-submit:hover {
    opacity: 0.95;
}
.contactify-lead-status {
    font-size: 11px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    line-height: 1.6;
}
.contactify-lead-status.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.contactify-lead-status.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Spinner Loader */
.contactify-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: contactifySpin 0.8s infinite linear;
}
@keyframes contactifySpin {
    to { transform: rotate(360deg); }
}

/* ===== NEW: ENTRANCE & PERIODIC ATTENTION ANIMATIONS ===== */
@keyframes animBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) scale(1); }
    40% { transform: translateY(-12px) scale(1.04); }
    60% { transform: translateY(-6px) scale(1.01); }
}
.wpos-toggle.anim-bounce {
    animation: animBounce 1s ease;
}

@keyframes animFadeIn {
    from { opacity: 0; transform: scale(0.6) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.wpos-toggle.anim-fade-in {
    animation: animFadeIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes animWiggle {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(-8deg) scale(1.05); }
    30% { transform: rotate(8deg) scale(1.05); }
    45% { transform: rotate(-8deg) scale(1.05); }
    60% { transform: rotate(8deg) scale(1.05); }
    75% { transform: rotate(-4deg) scale(1.02); }
    90% { transform: rotate(4deg) scale(1.02); }
}
.wpos-toggle.anim-wiggle {
    animation: animWiggle 1.1s ease-in-out;
}

@keyframes animPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); box-shadow: 0 12px 28px rgba(0,0,0,0.32); }
    100% { transform: scale(1); }
}
.wpos-toggle.anim-pulse {
    animation: animPulse 1s infinite alternate ease-in-out;
}