/* =============================================
   فني صحي (Fani Sahy) - Floating Contact Styles
   Design system: Emerald green (deep #064E3B / bright #10B981)
   + Teal accent (#0D9488) + WhatsApp green (#25d366)
   Font: Tajawal (clean modern Arabic)
   Brand: fanisahy.com
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

/* --- Backdrop --- */
.mdfc-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 78, 59, 0.55); /* Emerald overlay */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999998;
    pointer-events: none;
}

.mdfc-backdrop.mdfc-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* --- Container --- */
.mdfc-floating-container {
    position: fixed;
    bottom: 30px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    direction: rtl;
}

.mdfc-position-left { left: 30px; }
.mdfc-position-right { right: 30px; align-items: flex-end; }

/* --- Popup --- */
.mdfc-popup {
    position: absolute;
    bottom: 80px;
    width: 320px;
    background: #ffffff;
    border: 1px solid #EAEAEE;
    border-radius: 20px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 20px 60px rgba(6, 78, 59, 0.18),
        0 8px 24px rgba(6, 78, 59, 0.08);
}

.mdfc-position-left .mdfc-popup { left: 0; transform-origin: bottom left; }
.mdfc-position-right .mdfc-popup { right: 0; transform-origin: bottom right; }

.mdfc-popup.mdfc-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* --- Popup Header (Navy to Orange gradient) --- */
.mdfc-popup-header {
    background: linear-gradient(135deg, #064E3B 0%, #065F46 55%, #10B981 140%);
    padding: 22px 22px;
    position: relative;
    overflow: hidden;
}

.mdfc-popup-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(5, 150, 105, 0.25) 0%, transparent 70%);
    border-radius: 50%;
}

.mdfc-popup-header::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.mdfc-popup-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 4px 0;
    padding: 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
    border: none;
    background: none;
    font-family: 'Tajawal', sans-serif;
}

.mdfc-popup-header p {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 0;
    line-height: 1.4;
    font-family: 'Tajawal', sans-serif;
}

/* --- Popup Body --- */
.mdfc-popup-body { padding: 12px; }

/* --- Contact Option --- */
.mdfc-option {
    display: flex !important;
    align-items: center !important;
    gap: 14px;
    padding: 14px 16px !important;
    border-radius: 14px !important;
    text-decoration: none !important;
    color: #064E3B !important;
    transition: all 0.3s ease !important;
    position: relative;
    overflow: hidden;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.mdfc-option::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.06), rgba(5, 150, 105, 0.01));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 14px;
}

.mdfc-option:hover::before { opacity: 1; }
.mdfc-option:hover { transform: translateX(-4px); color: #064E3B !important; }
.mdfc-option:hover .mdfc-option-icon { transform: scale(1.08); }
.mdfc-option:focus { outline: none !important; box-shadow: none !important; }

.mdfc-option + .mdfc-option {
    margin-top: 4px !important;
    border-top: 1px solid #F5F5F7 !important;
    padding-top: 14px !important;
    border-radius: 0 !important;
}

.mdfc-option + .mdfc-option:hover { border-radius: 14px !important; }

/* --- Option Icon --- */
.mdfc-option-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.mdfc-option-icon svg { width: 26px; height: 26px; }

.mdfc-whatsapp {
    background: linear-gradient(135deg, #25d366, #16a34a) !important;
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.35);
}

.mdfc-phone {
    background: linear-gradient(135deg, #059669, #047857) !important;
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.32);
}

.mdfc-email {
    background: linear-gradient(135deg, #0D9488, #0F766E) !important;
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.30);
}

/* --- Option Info --- */
.mdfc-option-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.mdfc-option-info .mdfc-label {
    font-size: 0.92rem;
    font-weight: 700;
    color: #064E3B;
    margin-bottom: 3px;
    line-height: 1.3;
    font-family: 'Tajawal', sans-serif;
}
.mdfc-option-info .mdfc-number {
    font-size: 0.78rem;
    font-weight: 500;
    color: #4A5578;
    direction: ltr;
    text-align: right;
    letter-spacing: 0.3px;
    line-height: 1.3;
    font-family: 'Tajawal', sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Arrow --- */
.mdfc-arrow {
    color: #D5D5DC;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.mdfc-option:hover .mdfc-arrow {
    color: #059669;
    transform: translateX(-4px);
}

/* --- Popup Footer --- */
.mdfc-popup-footer {
    padding: 10px 16px 14px;
    text-align: center;
    border-top: 1px solid #F5F5F7;
}
.mdfc-popup-footer span {
    font-size: 0.72rem;
    color: #8B8B97;
    font-weight: 500;
    font-family: 'Tajawal', sans-serif;
}

/* --- FAB Button (Orange Gradient) --- */
.mdfc-fab {
    width: 62px !important;
    height: 62px !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    background: linear-gradient(135deg, #10B981 0%, #047857 100%) !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    box-shadow:
        0 8px 28px rgba(5, 150, 105, 0.45),
        0 2px 8px rgba(6, 78, 59, 0.15) !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    min-width: unset !important;
    min-height: unset !important;
}

.mdfc-fab:hover {
    transform: scale(1.08) !important;
    box-shadow:
        0 12px 36px rgba(5, 150, 105, 0.50),
        0 4px 12px rgba(6, 78, 59, 0.20) !important;
}
.mdfc-fab:active { transform: scale(0.95) !important; }

.mdfc-fab.mdfc-active {
    background: linear-gradient(135deg, #064E3B, #065F46) !important;
    box-shadow:
        0 8px 28px rgba(6, 78, 59, 0.40),
        0 0 0 2px rgba(5, 150, 105, 0.35) !important;
}

/* --- FAB Icons --- */
.mdfc-fab-icon {
    position: absolute;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.mdfc-icon-contact { opacity: 1; transform: rotate(0deg) scale(1); }
.mdfc-icon-close { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.mdfc-fab.mdfc-active .mdfc-icon-contact { opacity: 0; transform: rotate(90deg) scale(0.5); }
.mdfc-fab.mdfc-active .mdfc-icon-close { opacity: 1; transform: rotate(0deg) scale(1); }

/* --- Pulse Ring --- */
.mdfc-pulse-ring {
    position: absolute;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 2px solid #059669;
    animation: mdfc-pulse 2.5s ease-out infinite;
    pointer-events: none;
    bottom: 0;
}
.mdfc-position-left .mdfc-pulse-ring { left: 0; }
.mdfc-position-right .mdfc-pulse-ring { right: 0; }
.mdfc-pulse-delay { animation-delay: 0.8s; }
.mdfc-fab.mdfc-active ~ .mdfc-pulse-ring { animation: none; opacity: 0; }

@keyframes mdfc-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* --- Online Dot --- */
.mdfc-online-dot {
    position: absolute;
    top: 2px;
    width: 14px;
    height: 14px;
    background: #22c55e;
    border-radius: 50%;
    border: 2.5px solid #ffffff;
    z-index: 11;
    animation: mdfc-online-pulse 2s ease infinite;
    pointer-events: none;
}
.mdfc-position-left .mdfc-online-dot { right: 2px; }
.mdfc-position-right .mdfc-online-dot { left: 2px; }
.mdfc-fab.mdfc-active ~ .mdfc-online-dot { opacity: 0; transition: opacity 0.2s ease; }

@keyframes mdfc-online-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* --- Tooltip --- */
.mdfc-tooltip {
    position: absolute;
    bottom: 16px;
    background: #064E3B;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow:
        0 8px 24px rgba(6, 78, 59, 0.25),
        0 2px 8px rgba(6, 78, 59, 0.12);
    border: 1px solid rgba(5, 150, 105, 0.20);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    animation: mdfc-tooltip-show 0.5s ease 2s forwards;
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    z-index: 10;
}

.mdfc-position-left .mdfc-tooltip { left: 76px; transform: translateX(-10px); }
.mdfc-position-left .mdfc-tooltip::before {
    content: ''; position: absolute; right: -6px; top: 50%; transform: translateY(-50%) rotate(45deg); width: 10px; height: 10px; background: #064E3B; border-right: 1px solid rgba(5, 150, 105, 0.20); border-top: 1px solid rgba(5, 150, 105, 0.20);
}
.mdfc-position-right .mdfc-tooltip { right: 76px; transform: translateX(10px); }
.mdfc-position-right .mdfc-tooltip::before {
    content: ''; position: absolute; left: -6px; top: 50%; transform: translateY(-50%) rotate(45deg); width: 10px; height: 10px; background: #064E3B; border-left: 1px solid rgba(5, 150, 105, 0.20); border-bottom: 1px solid rgba(5, 150, 105, 0.20);
}

@keyframes mdfc-tooltip-show { 0% { opacity: 0; } 100% { opacity: 1; transform: translateX(0); } }
.mdfc-fab.mdfc-active ~ .mdfc-tooltip { opacity: 0 !important; }

/* --- Stagger Animations --- */
.mdfc-popup.mdfc-active .mdfc-booking-cta { animation: mdfc-slide-in 0.4s ease 0.05s both; }
.mdfc-popup.mdfc-active .mdfc-divider { animation: mdfc-slide-in 0.4s ease 0.12s both; }
.mdfc-popup.mdfc-active .mdfc-option:nth-child(3) { animation: mdfc-slide-in 0.4s ease 0.2s both; }
.mdfc-popup.mdfc-active .mdfc-option:nth-child(4) { animation: mdfc-slide-in 0.4s ease 0.3s both; }
.mdfc-popup.mdfc-active .mdfc-option:nth-child(5) { animation: mdfc-slide-in 0.4s ease 0.4s both; }

@keyframes mdfc-slide-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* --- Responsive --- */
@media (max-width: 480px) {
    .mdfc-floating-container { bottom: 20px; }
    .mdfc-position-left { left: 20px; }
    .mdfc-position-right { right: 20px; }
    .mdfc-popup { width: 290px; }
    .mdfc-tooltip { display: none !important; }
    .mdfc-fab { width: 56px !important; height: 56px !important; }
    .mdfc-pulse-ring { width: 56px; height: 56px; }
}
/* =============================================
   إضافات: زر الحجز + الفاصل + زر الواتساب السريع
   ============================================= */

/* --- زر الحجز (CTA رئيسي داخل النافذة) --- */
.mdfc-booking-cta {
    display: flex !important;
    align-items: center !important;
    gap: 12px;
    padding: 14px 16px !important;
    margin: 4px 0 6px !important;
    border-radius: 14px !important;
    text-decoration: none !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #10B981 0%, #047857 100%) !important;
    box-shadow: 0 8px 22px rgba(5, 150, 105, 0.35);
    border: none !important;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease !important;
}

.mdfc-booking-cta::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-20deg);
    transition: none;
}

.mdfc-booking-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(5, 150, 105, 0.45);
    color: #ffffff !important;
}

.mdfc-booking-cta:hover::after {
    animation: mdfc-shine 0.9s ease;
}

@keyframes mdfc-shine {
    0% { left: -120%; }
    100% { left: 130%; }
}

.mdfc-booking-cta-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.mdfc-booking-cta-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.mdfc-booking-cta-title {
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.3;
    color: #ffffff;
    font-family: 'Tajawal', sans-serif;
}

.mdfc-booking-cta-sub {
    font-size: 0.74rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.3;
    margin-top: 2px;
    font-family: 'Tajawal', sans-serif;
}

.mdfc-booking-cta-arrow {
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.mdfc-booking-cta:hover .mdfc-booking-cta-arrow {
    transform: translateX(-4px);
}

/* --- الفاصل بين الحجز وخيارات التواصل --- */
.mdfc-divider {
    display: flex;
    align-items: center;
    text-align: center;
    gap: 10px;
    margin: 8px 4px 4px;
}

.mdfc-divider::before,
.mdfc-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #EAEAEE;
}

.mdfc-divider span {
    font-size: 0.7rem;
    font-weight: 600;
    color: #8B8B97;
    white-space: nowrap;
    font-family: 'Tajawal', sans-serif;
}

/* =============================================
   زر الواتساب السريع المستقل (يمين الشاشة)
   ============================================= */
.mdfc-wa-quick {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #25d366 0%, #16a34a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow:
        0 8px 26px rgba(34, 197, 94, 0.45),
        0 2px 8px rgba(6, 78, 59, 0.15);
    z-index: 999997;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
}

/* عند وضع زر التواصل الرئيسي على اليمين أيضاً، نرفع زر الواتساب فوقه */
.mdfc-wa-quick.mdfc-wa-stacked {
    bottom: 104px;
}

.mdfc-wa-quick:hover {
    transform: scale(1.08);
    box-shadow:
        0 12px 32px rgba(34, 197, 94, 0.55),
        0 4px 12px rgba(6, 78, 59, 0.20);
}

.mdfc-wa-quick:active { transform: scale(0.95); }

.mdfc-wa-quick-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.mdfc-wa-quick-icon svg { width: 32px; height: 32px; }

/* نبضات الواتساب */
.mdfc-wa-quick-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #25d366;
    animation: mdfc-wa-pulse 2.5s ease-out infinite;
    pointer-events: none;
    z-index: 1;
}

.mdfc-wa-quick-pulse-delay { animation-delay: 1s; }

@keyframes mdfc-wa-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.7); opacity: 0; }
}

/* تلميح الواتساب */
.mdfc-wa-quick-tooltip {
    position: absolute;
    right: 74px;
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    background: #064E3B;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(6, 78, 59, 0.25);
    border: 1px solid rgba(37, 211, 102, 0.25);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 3;
}

.mdfc-wa-quick-tooltip::after {
    content: '';
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: #064E3B;
    border-left: 1px solid rgba(37, 211, 102, 0.25);
    border-bottom: 1px solid rgba(37, 211, 102, 0.25);
}

.mdfc-wa-quick:hover .mdfc-wa-quick-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* ظهور أولي تلقائي للتلميح ثم اختفاؤه */
.mdfc-wa-quick-tooltip.mdfc-wa-hint {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* استجابة الجوال */
@media (max-width: 480px) {
    .mdfc-wa-quick {
        bottom: 20px;
        right: 20px;
        width: 54px;
        height: 54px;
    }
    .mdfc-wa-quick.mdfc-wa-stacked { bottom: 88px; }
    .mdfc-wa-quick-icon svg { width: 28px; height: 28px; }
    .mdfc-wa-quick-tooltip { display: none !important; }
}
