/* ==========================================================================
   BS CKI Đặng Phước Đạt - Medical Contact Suite (Frontend Styles)
   Designed for: bacsidanang.com | tuyentienliet.com | chuyengioi.vn | phauthuatrobot.com
   ========================================================================== */

:root {
    --bsdat-primary: #0a4d68;
    --bsdat-primary-dark: #063447;
    --bsdat-accent: #088395;
    --bsdat-phone: #e53935;
    --bsdat-zalo: #0068ff;
    --bsdat-whatsapp: #25d366;
    --bsdat-messenger: #0084ff;
    --bsdat-facebook: #1877f2;
    --bsdat-youtube: #ff0000;
    --bsdat-map: #f57c00;
    --bsdat-surface: #ffffff;
    --bsdat-bg-soft: #f4f9fc;
    --bsdat-border: #d8e8f2;
    --bsdat-text: #1e293b;
    --bsdat-muted: #475569;
    --bsdat-shadow: 0 10px 30px rgba(10, 77, 104, 0.18);
}

/* 1. FLOATING CONTACT DOCK (DESKTOP & TABLET) */
.bsdat-floating-dock {
    position: fixed;
    bottom: 24px;
    z-index: 99998;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: all 0.3s ease;
}

.bsdat-floating-dock.bsdat-pos-right {
    right: 20px;
    align-items: flex-end;
}

.bsdat-floating-dock.bsdat-pos-left {
    left: 20px;
    align-items: flex-start;
}

.bsdat-dock-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.bsdat-floating-dock.bsdat-pos-right .bsdat-dock-list {
    align-items: flex-end;
}

.bsdat-floating-dock.bsdat-pos-left .bsdat-dock-list {
    align-items: flex-start;
}

.bsdat-floating-dock.bsdat-collapsed .bsdat-dock-item-collapsible {
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px) scale(0.9);
    pointer-events: none;
    height: 0;
    margin: 0;
    overflow: hidden;
}

.bsdat-dock-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    background: var(--bsdat-surface);
    color: var(--bsdat-text) !important;
    padding: 6px 14px 6px 6px;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.14);
    border: 1px solid rgba(10, 77, 104, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
    position: relative;
    line-height: 1.2;
}

.bsdat-dock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(10, 77, 104, 0.24);
    background: #f8fbff;
}

.bsdat-dock-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    flex-shrink: 0;
    position: relative;
}

.bsdat-dock-icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.bsdat-dock-label {
    display: flex;
    flex-direction: column;
    text-align: left;
    padding-right: 4px;
}

.bsdat-dock-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
}

.bsdat-dock-sub {
    font-size: 11px;
    color: #475569;
    white-space: nowrap;
}

/* Channel Colors */
.bsdat-bg-phone { background: linear-gradient(135deg, #e53935, #c62828); }
.bsdat-bg-zalo { background: linear-gradient(135deg, #0068ff, #0052cc); }
.bsdat-bg-whatsapp { background: linear-gradient(135deg, #25d366, #128c7e); }
.bsdat-bg-messenger { background: linear-gradient(135deg, #00b2ff, #006aff); }
.bsdat-bg-facebook { background: linear-gradient(135deg, #1877f2, #0d5bd9); }
.bsdat-bg-youtube { background: linear-gradient(135deg, #ff0000, #cc0000); }
.bsdat-bg-clinic { background: linear-gradient(135deg, #0a4d68, #088395); }

/* Pulse animation for Hotline & Zalo */
@keyframes bsdat-pulse-ring {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.6); }
    70% { transform: scale(1); box-shadow: 0 0 0 12px rgba(229, 57, 53, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}

.bsdat-pulse-phone {
    animation: bsdat-pulse-ring 2s infinite;
}

/* Toggle minimize button */
.bsdat-dock-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--bsdat-primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(10, 77, 104, 0.3);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.bsdat-dock-toggle:hover {
    background: var(--bsdat-primary-dark);
    transform: scale(1.05);
}

.bsdat-dock-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* 2. MOBILE STICKY BOTTOM BAR */
.bsdat-mobile-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #ffffff;
    border-top: 1px solid #cbd5e1;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.12);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.bsdat-mobile-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-width: 600px;
    margin: 0 auto;
}

.bsdat-mobile-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    padding: 6px 4px;
    border-radius: 10px;
    color: #1e293b !important;
    font-size: 11px;
    font-weight: 700;
    gap: 4px;
    border: none;
    background: #f8fafc;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.bsdat-mobile-item:active {
    background: #e2e8f0;
}

.bsdat-mobile-item.bsdat-mob-primary {
    background: linear-gradient(135deg, #e53935, #c62828);
    color: #ffffff !important;
}

.bsdat-mobile-item.bsdat-mob-zalo {
    background: #eff6ff;
    color: #0052cc !important;
}

.bsdat-mobile-item.bsdat-mob-wa {
    background: #f0fdf4;
    color: #15803d !important;
}

.bsdat-mobile-item.bsdat-mob-info {
    background: #f0f9ff;
    color: #0a4d68 !important;
}

.bsdat-mobile-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bsdat-mobile-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* 3. MODAL POPUP: CLINIC LOCATIONS, CHANNELS & QUICK BOOKING */
.bsdat-modal-overlay {
    position: fixed;
     inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.bsdat-modal-overlay.bsdat-open {
    display: flex;
}

.bsdat-modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    border-radius: 16px;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
    border: 1px solid #e2e8f0;
    animation: bsdat-modal-in 0.22s ease-out;
}

@keyframes bsdat-modal-in {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.bsdat-modal-header {
    background: linear-gradient(135deg, #0a4d68 0%, #088395 100%);
    color: #ffffff;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.bsdat-doc-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bsdat-doc-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid #ffffff;
    background: #e2e8f0;
    flex-shrink: 0;
}

.bsdat-doc-meta {
    display: flex;
    flex-direction: column;
}

.bsdat-doc-name {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.bsdat-doc-title {
    font-size: 12.5px;
    color: #e0f2fe;
    margin-top: 2px;
}

.bsdat-modal-actions-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bsdat-lang-switch {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
}

.bsdat-lang-switch:hover {
    background: rgba(255, 255, 255, 0.3);
}

.bsdat-modal-close {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bsdat-modal-body {
    padding: 20px;
    color: #1e293b;
}

.bsdat-channel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.bsdat-channel-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 13.5px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    border: 1px solid transparent;
}

.bsdat-channel-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.bsdat-channel-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

.bsdat-ch-phone { background: #fef2f2; color: #b91c1c !important; border-color: #fecaca; }
.bsdat-ch-zalo { background: #eff6ff; color: #1d4ed8 !important; border-color: #bfdbfe; }
.bsdat-ch-wa { background: #f0fdf4; color: #15803d !important; border-color: #bbf7d0; }
.bsdat-ch-msg { background: #f0f9ff; color: #0369a1 !important; border-color: #bae6fd; }
.bsdat-ch-fb { background: #f8fafc; color: #1e40af !important; border-color: #e2e8f0; }
.bsdat-ch-yt { background: #fff1f2; color: #be123c !important; border-color: #fecdd3; }

.bsdat-location-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #0a4d68;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
}

.bsdat-loc-title {
    font-size: 14px;
    font-weight: 700;
    color: #0a4d68;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.bsdat-loc-addr {
    font-size: 13px;
    color: #334155;
    margin-bottom: 8px;
    line-height: 1.45;
}

.bsdat-loc-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bsdat-loc-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none !important;
    background: #e0f2fe;
    color: #0369a1 !important;
}

.bsdat-loc-badge:hover {
    background: #bae6fd;
}

/* Quick message generator inside modal */
.bsdat-quick-form {
    background: #f4f9fc;
    border: 1px solid #cfe2f3;
    border-radius: 10px;
    padding: 14px;
    margin-top: 14px;
}

.bsdat-form-heading {
    font-size: 13.5px;
    font-weight: 700;
    color: #0a4d68;
    margin-bottom: 10px;
}

.bsdat-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.bsdat-input, .bsdat-select, .bsdat-textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    color: #1e293b;
    background: #ffffff;
    box-sizing: border-box;
}

.bsdat-textarea {
    min-height: 58px;
    resize: vertical;
    margin-bottom: 10px;
}

.bsdat-submit-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.bsdat-send-btn {
    border: none;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* 4. INLINE ARTICLE CONTACT CARD (SHORTCODE & AUTO POST FOOTER)
   NOTE: Strictly uses <div role="heading"> instead of <h2>/<h3> to avoid
   the byte-offset preg_match_all + mb_substr bug on bacsidanang.com */
.bsdat-inline-card {
    background: linear-gradient(180deg, #f4f9fc 0%, #ffffff 100%);
    border: 2px solid #0a4d68;
    border-radius: 14px;
    padding: 22px;
    margin: 28px 0;
    box-shadow: 0 8px 24px rgba(10, 77, 104, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1e293b;
    line-height: 1.6;
}

.bsdat-inline-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #d8e8f2;
    margin-bottom: 16px;
}

.bsdat-inline-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #0a4d68;
    flex-shrink: 0;
}

.bsdat-inline-heading {
    font-size: 19px;
    font-weight: 800;
    color: #0a4d68;
    line-height: 1.3;
    margin-bottom: 4px;
}

.bsdat-inline-subtitle {
    font-size: 13.5px;
    color: #475569;
    font-weight: 600;
}

.bsdat-inline-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14.5px;
    margin-bottom: 18px;
}

.bsdat-inline-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.bsdat-inline-item a {
    color: #088395;
    font-weight: 700;
    text-decoration: none;
}

.bsdat-inline-item a:hover {
    text-decoration: underline;
}

.bsdat-inline-cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bsdat-inline-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff !important;
    text-decoration: none !important;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.bsdat-inline-cta:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

.bsdat-inline-portals {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
    font-size: 13px;
    color: #475569;
}

.bsdat-inline-portals a {
    color: #0a4d68;
    font-weight: 600;
    text-decoration: none;
    margin: 0 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .bsdat-floating-dock {
        bottom: 76px;
        right: 12px !important;
    }
    .bsdat-floating-dock .bsdat-dock-label {
        display: none;
    }
    .bsdat-floating-dock .bsdat-dock-btn {
        padding: 4px;
        border-radius: 50%;
    }
    .bsdat-mobile-bar {
        display: block;
    }
    body.bsdat-has-mobile-bar {
        padding-bottom: 68px !important;
    }
    .bsdat-channel-grid,
    .bsdat-form-row,
    .bsdat-submit-row {
        grid-template-columns: 1fr;
    }
    .bsdat-inline-header {
        flex-direction: column;
        text-align: center;
    }
}
