/* =============================================
   Mudarar Floating Contact - Styles
   Design system: Navy (#0F1A35) + Orange (#E85D24) + Gold (#C9A961)
   Font: IBM Plex Sans Arabic (matches site)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700;800&display=swap');

/* --- Backdrop --- */
.mdfc-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 26, 53, 0.55); /* Mudarar Navy */
    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: 'IBM Plex Sans Arabic', '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(15, 26, 53, 0.18),
        0 8px 24px rgba(15, 26, 53, 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, #0F1A35 0%, #1B2A4E 60%, #E85D24 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(232, 93, 36, 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(201, 169, 97, 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: 'IBM Plex Sans Arabic', 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: 'IBM Plex Sans Arabic', 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: #0F1A35 !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(232, 93, 36, 0.06), rgba(232, 93, 36, 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: #0F1A35 !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, #E85D24, #C44A1A) !important;
    box-shadow: 0 6px 18px rgba(232, 93, 36, 0.32);
}

.mdfc-email {
    background: linear-gradient(135deg, #C9A961, #A88B45) !important;
    box-shadow: 0 6px 18px rgba(201, 169, 97, 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: #0F1A35;
    margin-bottom: 3px;
    line-height: 1.3;
    font-family: 'IBM Plex Sans Arabic', 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: 'IBM Plex Sans Arabic', 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: #E85D24;
    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: 'IBM Plex Sans Arabic', 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, #E85D24 0%, #C44A1A 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(232, 93, 36, 0.45),
        0 2px 8px rgba(15, 26, 53, 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(232, 93, 36, 0.50),
        0 4px 12px rgba(15, 26, 53, 0.20) !important;
}
.mdfc-fab:active { transform: scale(0.95) !important; }

.mdfc-fab.mdfc-active {
    background: linear-gradient(135deg, #0F1A35, #1B2A4E) !important;
    box-shadow:
        0 8px 28px rgba(15, 26, 53, 0.40),
        0 0 0 2px rgba(232, 93, 36, 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 #E85D24;
    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: #0F1A35;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow:
        0 8px 24px rgba(15, 26, 53, 0.25),
        0 2px 8px rgba(15, 26, 53, 0.12);
    border: 1px solid rgba(232, 93, 36, 0.20);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    animation: mdfc-tooltip-show 0.5s ease 2s forwards;
    font-family: 'IBM Plex Sans Arabic', '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: #0F1A35; border-right: 1px solid rgba(232, 93, 36, 0.20); border-top: 1px solid rgba(232, 93, 36, 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: #0F1A35; border-left: 1px solid rgba(232, 93, 36, 0.20); border-bottom: 1px solid rgba(232, 93, 36, 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-option:nth-child(1) { animation: mdfc-slide-in 0.4s ease 0.1s both; }
.mdfc-popup.mdfc-active .mdfc-option:nth-child(2) { animation: mdfc-slide-in 0.4s ease 0.2s both; }
.mdfc-popup.mdfc-active .mdfc-option:nth-child(3) { animation: mdfc-slide-in 0.4s ease 0.3s 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; }
}