/* =============================================
   Green Service Floating Contact - Styles
   Design: Dark Green (#0f2a1c) + Mint (#3dba78)
   Font: Cairo (matches site)
   ============================================= */

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

/* --- Backdrop --- */
.mdfc-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 42, 28, 0.5);
    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: 'Cairo', '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 #e0f5ea;
    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, 42, 28, 0.15),
        0 8px 24px rgba(61, 186, 120, 0.10);
}
.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 --- */
.mdfc-popup-header {
    background: linear-gradient(135deg, #0f2a1c 0%, #1a5c38 60%, #3dba78 140%);
    padding: 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(61,186,120,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(144,224,181,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;
    line-height: 1.4;
    border: none;
    background: none;
    font-family: 'Cairo', 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: 'Cairo', 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: #0f2a1c !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(61,186,120,0.08), rgba(61,186,120,0.02));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 14px;
}
.mdfc-option:hover::before { opacity: 1; }
.mdfc-option:hover { transform: translateX(-4px); color: #0f2a1c !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 #f0faf4 !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, #3dba78, #257a4a) !important;
    box-shadow: 0 6px 18px rgba(61,186,120,0.35);
}
.mdfc-email {
    background: linear-gradient(135deg, #5ecf92, #2f9a5e) !important;
    box-shadow: 0 6px 18px rgba(94,207,146,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: #0f2a1c; margin-bottom: 3px;
    line-height: 1.3; font-family: 'Cairo', sans-serif;
}
.mdfc-option-info .mdfc-number {
    font-size: 0.78rem; font-weight: 500;
    color: #3d6b53; direction: ltr;
    text-align: right; letter-spacing: 0.3px;
    line-height: 1.3; font-family: 'Cairo', sans-serif;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* --- Arrow --- */
.mdfc-arrow {
    color: #b0d8c0; transition: all 0.3s ease;
    flex-shrink: 0; display: flex; align-items: center;
    position: relative; z-index: 1;
}
.mdfc-option:hover .mdfc-arrow { color: #3dba78; transform: translateX(-4px); }

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

/* --- FAB Button --- */
.mdfc-fab {
    width: 62px !important; height: 62px !important;
    border-radius: 50% !important; border: none !important;
    cursor: pointer !important;
    background: linear-gradient(135deg, #3dba78 0%, #257a4a 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(61,186,120,0.50),
        0 2px 8px rgba(15,42,28,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(61,186,120,0.55), 0 4px 12px rgba(15,42,28,0.20) !important;
}
.mdfc-fab:active { transform: scale(0.95) !important; }
.mdfc-fab.mdfc-active {
    background: linear-gradient(135deg, #0f2a1c, #1a5c38) !important;
    box-shadow: 0 8px 28px rgba(15,42,28,0.40), 0 0 0 2px rgba(61,186,120,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 #3dba78;
    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: #0f2a1c; 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,42,28,0.25), 0 2px 8px rgba(15,42,28,0.12);
    border: 1px solid rgba(61,186,120,0.25);
    opacity: 0; transition: all 0.3s ease; pointer-events: none;
    animation: mdfc-tooltip-show 0.5s ease 2s forwards;
    font-family: 'Cairo', '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:#0f2a1c; border-right:1px solid rgba(61,186,120,0.25); border-top:1px solid rgba(61,186,120,0.25); }
.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:#0f2a1c; border-left:1px solid rgba(61,186,120,0.25); border-bottom:1px solid rgba(61,186,120,0.25); }
@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; }
}
