/* ==========================================================================
   Floating Contact Buttons & Lead Capture Popup Styles
   Project: Hindustan Digital Services PHP Website
   Namespace: .fc-*
   ========================================================================== */

/* Container for Floating Buttons */
.fc-floating-container {
    position: fixed;
    right: 20px;
    right: calc(20px + env(safe-area-inset-right, 0px));
    bottom: 195px;
    bottom: calc(195px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 99990;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

/* Circular Floating Button Base */
.fc-btn {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    min-width: 54px;
    min-height: 54px;
    border-radius: 50% !important;
    color: #ffffff !important;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    border: none;
    outline: none;
    padding: 0;
}

/* WhatsApp Button: Green (#25D366) */
.fc-btn-whatsapp {
    background-color: #25D366 !important;
}

.fc-btn-whatsapp:hover,
.fc-btn-whatsapp:focus {
    background-color: #20bd5a !important;
    color: #ffffff !important;
}

/* Call Button: Blue (#2563EB) */
.fc-btn-call {
    background-color: #2563EB !important;
}

.fc-btn-call:hover,
.fc-btn-call:focus {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
}

/* Hover and Active Micro-interactions */
.fc-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.26), 0 4px 10px rgba(0, 0, 0, 0.16);
    color: #ffffff !important;
    text-decoration: none !important;
}

.fc-btn:active {
    transform: scale(0.96) translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Keyboard Focus Accessibility */
.fc-btn:focus-visible {
    outline: 3px solid #0f172a;
    outline-offset: 3px;
}

/* Icon Styles */
.fc-btn .fc-icon {
    font-size: 26px !important;
    line-height: 1 !important;
    color: #ffffff !important;
    display: inline-block;
    transition: transform 0.25s ease;
}

.fc-btn:hover .fc-icon {
    transform: scale(1.05);
}

/* Accessible Tooltips */
.fc-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background-color: rgba(17, 24, 39, 0.94);
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.2s;
}

.fc-tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    border-width: 5px 0 5px 6px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(17, 24, 39, 0.94);
}

@media (hover: hover) and (pointer: fine) {
    .fc-btn:hover .fc-tooltip,
    .fc-btn:focus-visible .fc-tooltip {
        opacity: 1;
        visibility: visible;
        transform: translateY(-50%) translateX(0);
    }
}

@media (hover: none) or (max-width: 767px) {
    .fc-tooltip {
        display: none !important;
    }
}

/* ==========================================================================
   Popup Backdrop & Modal Card
   ========================================================================== */
.fc-popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 99994;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
}

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

/* Popup Card */
.fc-popup-card {
    position: fixed;
    right: 20px;
    right: calc(20px + env(safe-area-inset-right, 0px));
    bottom: 195px;
    bottom: calc(195px + env(safe-area-inset-bottom, 0px));
    width: 350px;
    max-width: calc(100vw - 32px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22), 0 4px 12px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.9);
    z-index: 99996;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.25s;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    text-align: left;
    box-sizing: border-box;
}

.fc-popup-card.fc-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Header */
.fc-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.fc-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fc-header-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    flex-shrink: 0;
}

.fc-badge-whatsapp {
    background-color: #25D366;
}

.fc-badge-contact {
    background-color: #2563EB;
}

.fc-header-titles h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.fc-header-titles p {
    margin: 3px 0 0 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.2;
}

.fc-popup-close {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #64748b;
    transition: background 0.2s ease, color 0.2s ease;
    padding: 0;
    line-height: 1;
}

.fc-popup-close:hover,
.fc-popup-close:focus {
    background: #e2e8f0;
    color: #0f172a;
    outline: none;
}

/* Popup Body & Form */
.fc-popup-body {
    padding: 18px 20px 20px 20px;
    box-sizing: border-box;
}

.fc-form-group {
    margin-bottom: 14px;
}

.fc-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.fc-form-group label .fc-req {
    color: #ef4444;
}

.fc-input {
    width: 100%;
    box-sizing: border-box;
    height: 42px;
    padding: 8px 12px;
    font-size: 14px;
    color: #0f172a;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    font-family: inherit;
}

.fc-input:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.fc-mode-whatsapp .fc-input:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
}

.fc-input.fc-input-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
}

/* Inline Alert Box */
.fc-alert-box {
    display: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.4;
    margin-bottom: 14px;
}

.fc-alert-error {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.fc-alert-success {
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

/* Submit Button */
.fc-submit-btn {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
}

.fc-mode-whatsapp .fc-submit-btn {
    background-color: #25D366;
}

.fc-mode-whatsapp .fc-submit-btn:hover {
    background-color: #20bd5a;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
}

.fc-mode-contact .fc-submit-btn {
    background-color: #2563EB;
}

.fc-mode-contact .fc-submit-btn:hover {
    background-color: #1d4ed8;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.fc-submit-btn:active {
    transform: scale(0.98);
}

.fc-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading Spinner */
.fc-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: fc-spin 0.8s linear infinite;
}

@keyframes fc-spin {
    to { transform: rotate(360deg); }
}

/* Privacy Notice */
.fc-privacy-notice {
    margin-top: 12px;
    font-size: 11.5px;
    color: #64748b;
    text-align: center;
    line-height: 1.35;
}

.fc-privacy-notice i {
    font-size: 11px;
    margin-right: 3px;
    color: #94a3b8;
}

/* Success / Continuation View */
.fc-success-view {
    display: none;
    text-align: center;
    padding: 10px 0;
}

.fc-success-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    margin: 0 auto 12px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
}

.fc-mode-whatsapp .fc-success-icon {
    background-color: #25D366;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.3);
}

.fc-mode-contact .fc-success-icon {
    background-color: #2563EB;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.fc-success-view h4 {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.fc-success-view p {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.4;
}

.fc-continue-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff !important;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease, opacity 0.2s ease;
}

.fc-mode-whatsapp .fc-continue-btn {
    background-color: #25D366;
}

.fc-mode-contact .fc-continue-btn {
    background-color: #2563EB;
}

.fc-continue-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

/* Tablet & Medium Screens: When scroll-to-top is hidden, dock buttons to bottom */
@media (max-width: 991px) {
    .fc-floating-container {
        bottom: 20px;
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }

    .fc-popup-card {
        bottom: 84px;
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    }
}

/* Mobile Screens */
@media (max-width: 480px) {
    .fc-floating-container {
        right: 16px;
        right: calc(16px + env(safe-area-inset-right, 0px));
        bottom: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        gap: 10px;
    }

    .fc-btn {
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
    }

    .fc-btn .fc-icon {
        font-size: 24px !important;
    }

    .fc-popup-card {
        right: 12px;
        left: 12px;
        bottom: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        width: auto;
        max-width: none;
        border-radius: 14px;
    }
}

/* Hide widget when website mobile navigation drawer is active */
body.mobile-menu-visible .fc-floating-container,
body.mobile-menu-visible .fc-popup-card,
body.mobile-menu-visible .fc-popup-backdrop {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
