/* 
   Refined Floating Contact Widget - Brand Aligned
   Features: Online/Offline status, Pulse animations, CSS Variables
*/

:root {
    --goha-whatsapp: #25d366;
    --goha-online: #22c55e;
    --goha-offline: #94a3b8;
}

.goha-contact-widget {
    position: fixed;
    bottom: 30px;
    z-index: 9999;
    font-family: inherit;
    /* Inherit site font */
}

.goha-contact-widget.position-right {
    right: 30px;
}

.goha-contact-widget.position-left {
    left: 30px;
}

/* The Card */
.contact-card {
    width: 340px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    position: absolute;
    bottom: 85px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.goha-contact-widget.active .contact-card {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.position-right .contact-card {
    right: 0;
    transform-origin: bottom right;
}

.position-left .contact-card {
    left: 0;
    transform-origin: bottom left;
}

/* Header */
.contact-card .card-header {
    background: var(--color-primary);
    color: #fff;
    padding: 30px 25px;
    text-align: right;
    position: relative;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    margin-bottom: 12px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
    background: #fff;
}

.status-online .pulse-dot {
    background: var(--goha-online);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: goha-pulse-online 2s infinite;
}

.status-offline .pulse-dot {
    background: #e2e8f0;
}

@keyframes goha-pulse-online {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.contact-card .card-header h3 {
    margin: 0 0 5px;
    font-size: 20px;
    font-weight: 800;
}

.contact-card .card-header p {
    margin: 0;
    font-size: 13px;
    opacity: 0.85;
    line-height: 1.5;
}

/* Body */
.contact-card .card-body {
    padding: 15px 0;
}

.contact-row {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    text-decoration: none;
    color: var(--color-primary);
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--color-gray-100);
}

.contact-row:last-child {
    border-bottom: none;
}

.contact-row:hover {
    background: rgba(var(--color-primary-rgb), 0.05);
    color: var(--color-secondary);
}

.contact-row .icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-left: 18px;
    transition: transform 0.3s ease;
}

.contact-row:hover .icon-box {
    transform: scale(1.1);
}

.contact-row.phone .icon-box {
    background: var(--color-accent);
    color: var(--color-white);
}

.contact-row.whatsapp .icon-box {
    background: #f0fdf4;
    color: #22c55e;
}

.contact-row.email .icon-box {
    background: var(--color-primary);
    color: var(--color-white);
}

.contact-row.services .icon-box {
    background: var(--color-secondary);
    color: var(--color-white);
}

.contact-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.contact-info .label {
    font-weight: 700;
    font-size: 15px;
}

.contact-info .value {
    font-size: 12px;
    color: var(--color-soft-gray);
    margin-top: 3px;
}

/* Footer */
.contact-card .card-footer {
    background: var(--color-gray-50);
    padding: 15px 25px;
    text-align: center;
    border-top: 1px solid var(--color-gray-100);
}

.contact-card .card-footer p {
    margin: 0;
    font-size: 11px;
    color: var(--color-soft-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.contact-card .card-footer p i {
    color: #f59e0b;
}

/* Trigger Button */
.widget-trigger {
    height: 55px;
    padding: 0 25px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(var(--color-primary-rgb), 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: var(--font-primary, 'Alexandria', sans-serif);
    z-index: 10;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: transparent;
    border-radius: 30px;
    z-index: -1;
    pointer-events: none;
}

.pulse-ring::before,
.pulse-ring::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    opacity: 0.6;
    animation: goha-premium-pulse 3s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}

.pulse-ring::after {
    animation-delay: 1.5s;
}

@keyframes goha-premium-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.3, 1.6);
        opacity: 0;
    }
}

.active .pulse-ring {
    display: none;
    /* Hide pulse when active to keep it clean */
}

.trigger-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-direction: row-reverse;
    /* Icon then Text in RTL */
}

.trigger-text {
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    font-family: var(--font-primary, 'Alexandria', sans-serif);
}

.widget-trigger .chat-icon {
    font-size: 24px;
}

.widget-trigger:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.widget-trigger .close-icon {
    display: none;
}

.active .widget-trigger .chat-icon,
.active .widget-trigger .trigger-text {
    display: none;
}

.active .widget-trigger .close-icon {
    display: block;
    font-size: 24px;
}

.active .widget-trigger {
    width: 55px;
    height: 55px;
    padding: 0;
    background: var(--color-primary);
    transform: rotate(90deg);
}

.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #cbd5e1;
    border: 3px solid #fff;
    border-radius: 50%;
}

.notification-dot.online {
    background: var(--goha-online);
}

/* Mobile Adjustment */
@media (max-width: 480px) {
    .contact-card {
        width: 300px;
        right: -10px;
    }
}