/* ================================================
   Contact Icon Plugin - Frontend Styles v2.0
   Design: pill bar (closed) + options panel (open)
   ================================================ */

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

/* ---------- Widget Container ---------- */
.contact-icon-widget {
    position: fixed;
    z-index: 999999;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.contact-icon-widget.loaded {
    opacity: 1;
}

.contact-icon-widget.animate-in {
    transform: translateY(0);
}

/* ---------- Hide per device ---------- */
@media (min-width: 769px) {
    .contact-icon-widget.hide-desktop { display: none !important; }
}
@media (max-width: 768px) {
    .contact-icon-widget.hide-mobile  { display: none !important; }
}

/* ---------- Positioning ---------- */
.contact-icon-widget.position-bottom-right { bottom: 24px; right: 24px; }
.contact-icon-widget.position-bottom-left  { bottom: 24px; left: 24px; align-items: flex-start; }
.contact-icon-widget.position-top-right    { top: 24px;    right: 24px; }
.contact-icon-widget.position-top-left     { top: 24px;    left: 24px;  align-items: flex-start; }

/* ---------- Full width footer mode ---------- */
.contact-icon-widget.full-width-footer {
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100%;
    align-items: center;
    border-radius: 0;
}
.contact-icon-widget.full-width-footer .contact-main-bar {
    border-radius: 0;
    width: 100%;
    justify-content: center;
}
.contact-icon-widget.full-width-footer .contact-options-panel {
    bottom: 64px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
}

/* ====================================================
   MAIN BAR (closed state) — pill shape like screenshot
   ==================================================== */
.contact-main-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #7B1A1A; /* deep crimson – matches screenshot */
    color: #fff;
    border-radius: 50px;
    padding: 10px 18px 10px 10px;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0,0,0,0.28);
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 0.25s ease;
    min-width: 210px;
    position: relative;
    user-select: none;
    border: none;
    outline: none;
}

.contact-main-bar:hover {
    transform: scale(1.04) translateY(-2px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.contact-main-bar:active {
    transform: scale(0.98);
}

/* Pulsing ring on the bar */
.contact-main-bar::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50px;
    border: 2px solid rgba(255,255,255,0.25);
    animation: barRingPulse 2.4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes barRingPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50%       { opacity: 0;   transform: scale(1.04); }
}

/* Main icon circle */
.contact-main-bar__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
    position: relative;
}

/* Online dot */
.contact-main-bar__icon::after {
    content: '';
    position: absolute;
    width: 11px;
    height: 11px;
    background: #4ADE80;
    border: 2px solid #7B1A1A;
    border-radius: 50%;
    bottom: 1px;
    right: 1px;
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(74,222,128,0.7); }
    50%       { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(74,222,128,0); }
}

/* Texts */
.contact-main-bar__texts {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
    min-width: 0;
}

.contact-main-bar__title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.contact-main-bar__subtitle {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.82;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

/* Badge pill */
.contact-main-bar__badge {
    background: rgba(255,255,255,0.20);
    border: 1px solid rgba(255,255,255,0.30);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.03em;
}

/* Close X (shown when open) */
.contact-main-bar__close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}
.contact-main-bar__close:hover { background: rgba(255,255,255,0.32); }

/* ====================================================
   OPTIONS PANEL (open state)
   ==================================================== */
.contact-options-panel {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
    padding: 8px;
    min-width: 220px;
    position: absolute;
    opacity: 0;
    transform: translateY(12px) scale(0.95);
    transform-origin: bottom right;
    transition: opacity 0.3s cubic-bezier(0.34,1.56,0.64,1),
                transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
    pointer-events: none;
    /* positioned ABOVE the bar */
    bottom: calc(100% + 12px);
    right: 0;
}

.contact-icon-widget.position-bottom-left .contact-options-panel,
.contact-icon-widget.position-top-left    .contact-options-panel {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

.contact-icon-widget.position-top-right .contact-options-panel,
.contact-icon-widget.position-top-left  .contact-options-panel {
    bottom: auto;
    top: calc(100% + 12px);
    transform-origin: top right;
}

.contact-options-panel.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Small triangle pointer */
.contact-options-panel::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 28px;
    width: 16px;
    height: 16px;
    background: #fff;
    transform: rotate(45deg);
    border-radius: 2px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.06);
}

.contact-icon-widget.position-bottom-left .contact-options-panel::after { right: auto; left: 28px; }
.contact-icon-widget.position-top-right  .contact-options-panel::after  { bottom: auto; top: -8px; box-shadow: -2px -2px 6px rgba(0,0,0,0.06); }
.contact-icon-widget.position-top-left   .contact-options-panel::after  { bottom: auto; top: -8px; right: auto; left: 28px; }

/* ---------- Individual contact option ---------- */
.contact-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
    color: #1a1a1a;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.contact-option:hover {
    background: #f5f5f7;
    transform: translateX(3px);
    text-decoration: none;
    color: #1a1a1a;
}

.contact-option:active { transform: scale(0.97); }
.contact-option:focus  { outline: 2px solid #a855f7; outline-offset: 2px; }

/* Separator line between options */
.contact-option + .contact-option {
    border-top: 1px solid rgba(0,0,0,0.06);
    border-radius: 0 0 14px 14px;
}
.contact-option:first-child { border-radius: 14px 14px 0 0; }
.contact-option:only-child  { border-radius: 14px; }

/* Colored icon circle */
.contact-option__icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.contact-option:hover .contact-option__icon { transform: scale(1.12); }

/* Colors per option type */
.contact-option__icon--quote    { background: #7C3AED; color: #fff; }
.contact-option__icon--phone    { background: #2563EB; color: #fff; }
.contact-option__icon--whatsapp { background: #16A34A; color: #fff; }

/* Option texts */
.contact-option__texts {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.contact-option__label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.contact-option__sub {
    font-size: 11px;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.3;
}

/* ====================================================
   OVERLAY
   ==================================================== */
.contact-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.08);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}
.contact-overlay.show { opacity: 1; }

/* ====================================================
   RESPONSIVE
   ==================================================== */
@media (max-width: 768px) {
    .contact-icon-widget.position-bottom-right,
    .contact-icon-widget.position-top-right  { right: 14px; }
    .contact-icon-widget.position-bottom-left,
    .contact-icon-widget.position-top-left   { left: 14px; }
    .contact-icon-widget.position-bottom-right,
    .contact-icon-widget.position-bottom-left { bottom: 14px; }
    .contact-icon-widget.position-top-right,
    .contact-icon-widget.position-top-left    { top: 14px; }

    .contact-main-bar    { min-width: 180px; padding: 8px 14px 8px 8px; }
    .contact-main-bar__icon { width: 38px; height: 38px; }
    .contact-main-bar__title  { font-size: 12px; }
    .contact-main-bar__subtitle { font-size: 10px; }
    .contact-options-panel { min-width: 200px; }
}

@media (max-width: 400px) {
    .contact-main-bar { min-width: 160px; }
    .contact-main-bar__badge { display: none; }
}

/* ====================================================
   ACCESSIBILITY & PRINT
   ==================================================== */
@media (prefers-reduced-motion: reduce) {
    .contact-icon-widget,
    .contact-main-bar,
    .contact-options-panel,
    .contact-option { transition: none !important; animation: none !important; }
}

@media print {
    .contact-icon-widget { display: none !important; }
}
