/**
 * FDDI Website - Consent Manager & Floating Quick Connect Stylesheet
 * Digital Personal Data Protection Act (DPDPA 2023)
 * Color Theme: FDDI Navy (#142a40), Maroon (#9e1717), Gold (#f7b927)
 * Layout: Positioned on Bottom-Left with perfectly stacked WhatsApp Quick Connect
 */

/* -------------------------------------------------------------
 * 1. Native WhatsApp Floating Quick Connect
 * ------------------------------------------------------------- */
.fddi-whatsapp-btn {
    position: fixed;
    bottom: 85px;
    left: 22px;
    right: auto;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    text-decoration: none !important;
    box-shadow: 0 4px 18px rgba(18, 140, 126, 0.42), 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 999970;
    transition: transform 0.25s ease, box-shadow 0.25s ease, bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.fddi-whatsapp-btn:hover {
    transform: translateY(-2px) scale(1.06);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.55), 0 3px 10px rgba(0, 0, 0, 0.2);
    color: #ffffff !important;
}

.fddi-whatsapp-btn:focus {
    outline: none;
}

.fddi-wa-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.fddi-wa-svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Tooltip / Speech Bubble ("Message us") */
.fddi-wa-tooltip {
    position: absolute;
    left: 64px;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    color: #1e293b;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    pointer-events: none;
    z-index: 3;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
}

.fddi-wa-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    margin-top: -5px;
    border-width: 5px 6px 5px 0;
    border-style: solid;
    border-color: transparent #ffffff transparent transparent;
}

/* Soft pulse ring animation */
.fddi-wa-pulse {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(37, 211, 102, 0.65);
    opacity: 0;
    pointer-events: none;
    animation: fddiWaPulseRing 2.6s infinite ease-out;
}

@keyframes fddiWaPulseRing {
    0% {
        transform: scale(0.92);
        opacity: 0.8;
    }
    50% {
        opacity: 0.35;
    }
    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

/* When Privacy Consent Banner is Active, elevate WhatsApp button above the banner */
body.fddi-consent-active .fddi-whatsapp-btn {
    bottom: 305px;
}


/* -------------------------------------------------------------
 * 2. Floating Privacy Consent Trigger Button (Bottom-Left)
 * ------------------------------------------------------------- */
.fddi-consent-trigger {
    position: fixed;
    bottom: 22px;
    left: 22px;
    right: auto;
    z-index: 999980;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #142a40;
    color: #ffffff !important;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    padding: 7px 13px;
    border-radius: 50px;
    border: 1.5px solid #f7b927;
    box-shadow: 0 4px 16px rgba(20, 42, 64, 0.22);
    cursor: pointer;
    transition: all 0.25s ease-in-out;
    text-decoration: none !important;
    line-height: 1;
}

.fddi-consent-trigger:hover {
    background: #1e3a58;
    color: #f7b927 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 42, 64, 0.3);
}

.fddi-consent-trigger i {
    color: #f7b927;
    font-size: 13px;
}


/* -------------------------------------------------------------
 * 3. Consent Banner Overlay & Container (Compact Left Corner Card)
 * ------------------------------------------------------------- */
.fddi-consent-backdrop {
    display: none !important; /* Non-intrusive: does not block or dim website content */
}

.fddi-consent-banner {
    position: fixed;
    bottom: 22px;
    left: 22px;
    right: auto;
    max-width: 370px;
    width: calc(100vw - 36px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(20, 42, 64, 0.22), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    border-top: 3.5px solid #142a40;
    z-index: 999995;
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1e293b;
    display: none;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    overflow: hidden;
}

.fddi-consent-banner.show {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

/* Modal Inner */
.fddi-consent-inner {
    padding: 14px 16px 13px;
}

/* Banner Header */
.fddi-consent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.fddi-consent-header-left {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.fddi-consent-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef3c7;
    color: #92400e;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #fde68a;
}

.fddi-consent-badge i {
    color: #b45309;
    font-size: 10px;
}

.fddi-consent-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #142a40;
    margin: 0;
    line-height: 1.25;
}

.fddi-consent-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.fddi-consent-close:hover {
    color: #1e293b;
}

/* Banner Description */
.fddi-consent-desc {
    font-size: 11px;
    line-height: 1.45;
    color: #475569;
    margin-bottom: 10px;
}

.fddi-consent-desc strong {
    color: #142a40;
    font-weight: 600;
}

.fddi-consent-desc a {
    color: #9e1717;
    font-weight: 600;
    text-decoration: underline;
}

.fddi-consent-desc a:hover {
    color: #b91c1c;
}

/* Preferences Accordion (Collapsible) */
.fddi-consent-preferences {
    display: none;
    margin-bottom: 10px;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.fddi-consent-preferences.show {
    display: block;
}

.fddi-pref-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid #edf2f7;
}

.fddi-pref-item:last-child {
    border-bottom: none;
    padding-bottom: 2px;
}

.fddi-pref-info {
    flex: 1;
}

.fddi-pref-name {
    font-size: 11.5px;
    font-weight: 700;
    color: #142a40;
    margin: 0 0 2px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.fddi-pref-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
}

.fddi-badge-required {
    background: #e2e8f0;
    color: #475569;
}

.fddi-badge-optional {
    background: #dbeafe;
    color: #1e40af;
}

.fddi-pref-desc {
    font-size: 10px;
    line-height: 1.35;
    color: #64748b;
    margin: 0;
}

/* iOS Toggle Switches */
.fddi-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 19px;
    flex-shrink: 0;
    margin-top: 2px;
}

.fddi-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.fddi-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
}

.fddi-slider:before {
    position: absolute;
    content: "";
    height: 15px;
    width: 15px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.fddi-switch input:checked + .fddi-slider {
    background-color: #142a40;
}

.fddi-switch input:focus + .fddi-slider {
    box-shadow: 0 0 1px #142a40;
}

.fddi-switch input:checked + .fddi-slider:before {
    transform: translateX(15px);
}

.fddi-switch input:disabled + .fddi-slider {
    background-color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Banner Action Buttons */
.fddi-consent-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fddi-consent-buttons-primary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.fddi-btn-accept {
    background: #142a40;
    color: #ffffff !important;
    border: 1px solid #142a40;
    padding: 7px 10px;
    font-size: 11.5px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 2px 4px rgba(20,42,64,0.15);
}

.fddi-btn-accept:hover {
    background: #1e3a58;
    border-color: #1e3a58;
    color: #f7b927 !important;
}

.fddi-btn-reject {
    background: #ffffff;
    color: #475569 !important;
    border: 1px solid #cbd5e1;
    padding: 7px 10px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.fddi-btn-reject:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #1e293b !important;
}

.fddi-btn-pref {
    background: transparent;
    border: none;
    color: #64748b !important;
    padding: 2px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
    text-align: center;
}

.fddi-btn-pref:hover {
    color: #9e1717 !important;
}

.fddi-btn-save-custom {
    width: 100%;
    background: #142a40;
    color: #ffffff !important;
    border: 1px solid #142a40;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 2px 5px rgba(20,42,64,0.12);
}

.fddi-btn-save-custom:hover {
    background: #1e3a58;
    border-color: #1e3a58;
    color: #f7b927 !important;
}


/* -------------------------------------------------------------
 * 4. Toast Notification
 * ------------------------------------------------------------- */
.fddi-consent-toast {
    position: fixed;
    bottom: 22px;
    left: 22px;
    right: auto;
    background: #142a40;
    color: #ffffff;
    border-left: 3.5px solid #10b981;
    padding: 9px 15px;
    border-radius: 6px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    font-family: 'Open Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 999999;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.3s ease;
}

.fddi-consent-toast.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.fddi-consent-toast i {
    color: #34d399;
    font-size: 14px;
}


/* -------------------------------------------------------------
 * 5. Responsive Adjustments
 * ------------------------------------------------------------- */
@media (max-width: 480px) {
    .fddi-whatsapp-btn {
        bottom: 74px;
        left: 14px;
        width: 48px;
        height: 48px;
    }
    .fddi-wa-tooltip {
        display: none; /* Hide text bubble on narrow mobile to save screen estate */
    }
    .fddi-consent-banner {
        bottom: 12px;
        left: 12px;
        right: auto;
        width: calc(100vw - 24px);
        max-width: 350px;
    }
    .fddi-consent-trigger {
        bottom: 14px;
        left: 14px;
        right: auto;
        padding: 6px 11px;
        font-size: 11px;
    }
    body.fddi-consent-active .fddi-whatsapp-btn {
        bottom: 315px;
    }
}
