/* Websly Floating Contact Card CSS */

/* Base wrappers */
.ws-floating-contact-card-wrapper {
    display: flex;
    width: 100%;
    pointer-events: none;
    z-index: 999;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

/* Inline and normal flow mode */
.ws-floating-contact-card-wrapper.inline-mode {
    position: relative;
}
.ws-floating-contact-card-wrapper.align-center {
    justify-content: center;
}
.ws-floating-contact-card-wrapper.align-left {
    justify-content: flex-start;
    padding-left: 2rem;
}
.ws-floating-contact-card-wrapper.align-right {
    justify-content: flex-end;
    padding-right: 2rem;
}

/* 
 * Overlay Mode positioning 
 * Uses absolute centering on the block border boundary 
 */
.ws-floating-contact-card-wrapper.overlay-mode {
    position: relative;
    height: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    width: 100%;
}

.ws-floating-contact-card-wrapper.overlay-mode .ws-floating-contact-card {
    position: absolute;
    z-index: 999;
}

.ws-floating-contact-card-wrapper.overlay-mode.align-center .ws-floating-contact-card {
    left: 50%;
    transform: translate(-50%, -50%);
}

.ws-floating-contact-card-wrapper.overlay-mode.align-left .ws-floating-contact-card {
    left: 2rem;
    transform: translateY(-50%);
}

.ws-floating-contact-card-wrapper.overlay-mode.align-right .ws-floating-contact-card {
    right: 2rem;
    transform: translateY(-50%);
}


/* WordPress Outer block wrapper normalizations for both frontend and editor canvas */
.wp-block-websly-floating-contact-card {
    transition: all 0.3s ease;
}

/* Collapse block container space if in overlay mode */
.wp-block-websly-floating-contact-card:has(.overlay-mode) {
    height: 0 !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    position: relative;
    z-index: 999;
}

/* Editor-specific outer block container overrides */
.editor-styles-wrapper .wp-block[data-type="websly/floating-contact-card"] {
    min-height: 0 !important;
}

.editor-styles-wrapper .wp-block[data-type="websly/floating-contact-card"]:has(.overlay-mode) {
    height: 0 !important;
    min-height: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    position: relative;
    z-index: 999;
}


/* Card itself design */
.ws-floating-contact-card {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    max-width: calc(100% - 2rem);
    box-sizing: border-box;
}

.ws-floating-contact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

/* Shapes */
.ws-floating-contact-card.shape-default {
    border-radius: 12px;
}
.ws-floating-contact-card.shape-pill {
    border-radius: 9999px;
}
.ws-floating-contact-card.shape-square {
    border-radius: 0px;
}

/* Variants */
/* 
 * 1. glass-dark (Adaptive: light glass in light mode, dark glass in dark mode) 
 * Defaults to light mode appearance 
 */
.ws-floating-contact-card.variant-glass-dark {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #17171a;
}
.ws-floating-contact-card.variant-glass-dark .ws-floating-contact-card-button {
    background: #17171a;
    color: #ffffff !important;
}
.ws-floating-contact-card.variant-glass-dark .ws-floating-contact-card-button:hover {
    background: #232326;
}
.ws-floating-contact-card.variant-glass-dark .ws-floating-contact-card-avatar {
    border-color: rgba(0, 0, 0, 0.1);
}

/* Dark mode override for glass-dark */
.dark .ws-floating-contact-card.variant-glass-dark {
    background: rgb(23, 23, 26) !important;
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}
.dark .ws-floating-contact-card.variant-glass-dark .ws-floating-contact-card-button {
    background: #ffffff;
    color: #010004 !important;
}
.dark .ws-floating-contact-card.variant-glass-dark .ws-floating-contact-card-button:hover {
    background: #eaeaea;
}
.dark .ws-floating-contact-card.variant-glass-dark .ws-floating-contact-card-avatar {
    border-color: rgba(255, 255, 255, 0.1);
}

/* 2. glass-light (Stays light) */
.ws-floating-contact-card.variant-glass-light {
    background: rgba(255, 255, 255, 0.75) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #000000;
}
.ws-floating-contact-card.variant-glass-light .ws-floating-contact-card-button {
    background: #17171a;
    color: #ffffff !important;
}
.ws-floating-contact-card.variant-glass-light .ws-floating-contact-card-button:hover {
    background: #232326;
}
.ws-floating-contact-card.variant-glass-light .ws-floating-contact-card-avatar {
    border-color: rgba(0, 0, 0, 0.1);
}

/* 3. theme-surface (Adaptive based on Theme Semantic System) */
.ws-floating-contact-card.variant-theme-surface {
    background: var(--bg-surface, #f8fafc) !important;
    border: 1px solid color-mix(in srgb, var(--text-base) 10%, transparent);
    color: var(--text-base, #1e293b);
}
.ws-floating-contact-card.variant-theme-surface .ws-floating-contact-card-button {
    background: var(--theme-accent, #1e293b);
    color: var(--theme-text-on-accent, #ffffff) !important;
}
.ws-floating-contact-card.variant-theme-surface .ws-floating-contact-card-button:hover {
    opacity: 0.9;
}
.ws-floating-contact-card.variant-theme-surface .ws-floating-contact-card-avatar {
    border-color: color-mix(in srgb, var(--text-base) 10%, transparent);
}

/* Avatar area styling */
.ws-floating-contact-card-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    transition: border-radius 0.3s ease;
}

.ws-floating-contact-card.shape-default .ws-floating-contact-card-avatar {
    border-radius: 6px;
}
.ws-floating-contact-card.shape-pill .ws-floating-contact-card-avatar {
    border-radius: 50%;
}
.ws-floating-contact-card.shape-square .ws-floating-contact-card-avatar {
    border-radius: 0px;
}

.ws-floating-contact-card-avatar video,
.ws-floating-contact-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ws-floating-contact-card-avatar .ws-avatar-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: currentColor;
    opacity: 0.9;
}

.ws-floating-contact-card-avatar .ws-avatar-icon-wrap iconify-icon {
    font-size: 24px;
}

/* Content texts */
.ws-floating-contact-card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 120px;
}

.ws-floating-contact-card-title {
    font-family: var(--font-titles), Inter, sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
    margin: 0;
}

.ws-floating-contact-card-subtitle {
    font-family: var(--font-body), Inter, sans-serif;
    font-weight: 500;
    font-size: 11px;
    line-height: 1.2;
    opacity: 0.65;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* CTA container & button */
.ws-floating-contact-card-cta {
    flex-shrink: 0;
}

.ws-floating-contact-card-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: var(--font-body), Inter, sans-serif;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.ws-floating-contact-card-button .ws-button-icon {
    display: flex;
    align-items: center;
    transition: transform 0.25s ease;
}

.ws-floating-contact-card-button:hover .ws-button-icon {
    transform: translateX(3px);
}

/* Mobile responsive override */
@media (max-width: 480px) {
    .ws-floating-contact-card {
        padding: 8px 10px;
        gap: 10px;
    }
    .ws-floating-contact-card-avatar {
        width: 36px;
        height: 36px;
    }
    .ws-floating-contact-card-title {
        font-size: 12px;
    }
    .ws-floating-contact-card-subtitle {
        font-size: 9px;
    }
    .ws-floating-contact-card-button {
        padding: 6px 10px;
        font-size: 11px;
        gap: 6px;
    }
}

/* Additional Shapes */
.ws-floating-contact-card.shape-curved {
    border-radius: 24px;
}
.ws-floating-contact-card.shape-curved .ws-floating-contact-card-avatar {
    border-radius: 12px;
}

/* ---------------------------------------------------------
 * Layout Options
 * --------------------------------------------------------- */

/* 1. Vertical Layout */
.ws-floating-contact-card.layout-vertical {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 20px;
    gap: 12px;
}
.ws-floating-contact-card.layout-vertical .ws-floating-contact-card-info {
    text-align: center;
    align-items: center;
    min-width: unset;
}
.ws-floating-contact-card.layout-vertical .ws-floating-contact-card-subtitle {
    margin-top: 4px;
}
.ws-floating-contact-card.layout-vertical .ws-floating-contact-card-cta {
    width: 100%;
}
.ws-floating-contact-card.layout-vertical .ws-floating-contact-card-button {
    width: 100%;
    justify-content: center;
}

/* 2. Compact Layout */
.ws-floating-contact-card.layout-compact {
    padding: 6px 10px;
    gap: 10px;
}
.ws-floating-contact-card.layout-compact .ws-floating-contact-card-avatar {
    width: 36px;
    height: 36px;
}
.ws-floating-contact-card.layout-compact.shape-curved .ws-floating-contact-card-avatar {
    border-radius: 8px;
}
.ws-floating-contact-card.layout-compact.shape-default .ws-floating-contact-card-avatar {
    border-radius: 4px;
}
.ws-floating-contact-card.layout-compact .ws-floating-contact-card-title {
    font-size: 12px;
}
.ws-floating-contact-card.layout-compact .ws-floating-contact-card-subtitle {
    font-size: 9px;
}
.ws-floating-contact-card.layout-compact .ws-floating-contact-card-button {
    padding: 6px 10px;
    font-size: 11px;
    gap: 6px;
}

/* Integrated Block Absolute Positioning (within .relative parents like hero blocks) */
.websly-hero-v3 .ws-floating-contact-card-wrapper,
.websly-hover-hero .ws-floating-contact-card-wrapper {
    position: absolute;
    width: auto;
    z-index: 50;
    pointer-events: none;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
}

/* Integrated Desktop Positions with opposite coordinate unsets */
.websly-hero-v3 .ws-floating-contact-card-wrapper.pos-top-left,
.websly-hover-hero .ws-floating-contact-card-wrapper.pos-top-left {
    top: calc(1.5rem + var(--cc-offset-y, 0px)) !important;
    left: calc(1.5rem + var(--cc-offset-x, 0px)) !important;
    right: auto !important;
    bottom: auto !important;
}
.websly-hero-v3 .ws-floating-contact-card-wrapper.pos-top-right,
.websly-hover-hero .ws-floating-contact-card-wrapper.pos-top-right {
    top: calc(1.5rem + var(--cc-offset-y, 0px)) !important;
    right: calc(1.5rem - var(--cc-offset-x, 0px)) !important;
    left: auto !important;
    bottom: auto !important;
}
.websly-hero-v3 .ws-floating-contact-card-wrapper.pos-bottom-left,
.websly-hover-hero .ws-floating-contact-card-wrapper.pos-bottom-left {
    bottom: calc(1.5rem - var(--cc-offset-y, 0px)) !important;
    left: calc(1.5rem + var(--cc-offset-x, 0px)) !important;
    right: auto !important;
    top: auto !important;
}
.websly-hero-v3 .ws-floating-contact-card-wrapper.pos-bottom-right,
.websly-hover-hero .ws-floating-contact-card-wrapper.pos-bottom-right {
    bottom: calc(1.5rem - var(--cc-offset-y, 0px)) !important;
    right: calc(1.5rem - var(--cc-offset-x, 0px)) !important;
    left: auto !important;
    top: auto !important;
}
.websly-hero-v3 .ws-floating-contact-card-wrapper.pos-bottom-center,
.websly-hover-hero .ws-floating-contact-card-wrapper.pos-bottom-center {
    bottom: calc(1.5rem - var(--cc-offset-y, 0px)) !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    transform: translate(calc(-50% + var(--cc-offset-x, 0px)), 0) !important;
}

/* Responsive Overrides (under 768px) */
@media (max-width: 768px) {
    .websly-hero-v3 .ws-floating-contact-card-wrapper.pos-top-left,
    .websly-hero-v3 .ws-floating-contact-card-wrapper.pos-top-right,
    .websly-hero-v3 .ws-floating-contact-card-wrapper.pos-bottom-left,
    .websly-hero-v3 .ws-floating-contact-card-wrapper.pos-bottom-right,
    .websly-hero-v3 .ws-floating-contact-card-wrapper.pos-bottom-center,
    .websly-hover-hero .ws-floating-contact-card-wrapper.pos-top-left,
    .websly-hover-hero .ws-floating-contact-card-wrapper.pos-top-right,
    .websly-hover-hero .ws-floating-contact-card-wrapper.pos-bottom-left,
    .websly-hover-hero .ws-floating-contact-card-wrapper.pos-bottom-right,
    .websly-hover-hero .ws-floating-contact-card-wrapper.pos-bottom-center {
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
    }
    
    .ws-floating-contact-card-wrapper.mobile-pos-top-center {
        top: calc(1rem + var(--cc-offset-y, 0px)) !important;
        left: 50% !important;
        bottom: auto !important;
        right: auto !important;
        transform: translate(calc(-50% + var(--cc-offset-x, 0px)), 0) !important;
    }
    .ws-floating-contact-card-wrapper.mobile-pos-bottom-center {
        bottom: calc(1rem - var(--cc-offset-y, 0px)) !important;
        left: 50% !important;
        top: auto !important;
        right: auto !important;
        transform: translate(calc(-50% + var(--cc-offset-x, 0px)), 0) !important;
    }
    .ws-floating-contact-card-wrapper.mobile-pos-bottom-left {
        bottom: calc(1rem - var(--cc-offset-y, 0px)) !important;
        left: calc(1rem + var(--cc-offset-x, 0px)) !important;
        top: auto !important;
        right: auto !important;
        transform: none !important;
    }
    .ws-floating-contact-card-wrapper.mobile-pos-bottom-right {
        bottom: calc(1rem - var(--cc-offset-y, 0px)) !important;
        right: calc(1rem - var(--cc-offset-x, 0px)) !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
    }
    .ws-floating-contact-card-wrapper.mobile-pos-hidden {
        display: none !important;
    }
    
    /* Mobile shape overrides */
    .ws-floating-contact-card.mobile-shape-default {
        border-radius: 12px;
    }
    .ws-floating-contact-card.mobile-shape-default .ws-floating-contact-card-avatar {
        border-radius: 6px;
    }
    .ws-floating-contact-card.mobile-shape-pill {
        border-radius: 9999px;
    }
    .ws-floating-contact-card.mobile-shape-pill .ws-floating-contact-card-avatar {
        border-radius: 50%;
    }
    .ws-floating-contact-card.mobile-shape-square {
        border-radius: 0px;
    }
    .ws-floating-contact-card.mobile-shape-square .ws-floating-contact-card-avatar {
        border-radius: 0px;
    }
    .ws-floating-contact-card.mobile-shape-curved {
        border-radius: 24px;
    }
    .ws-floating-contact-card.mobile-shape-curved .ws-floating-contact-card-avatar {
        border-radius: 12px;
    }

    /* Mobile vertical layout overrides */
    .ws-floating-contact-card.layout-vertical {
        flex-direction: column !important;
        padding: 12px 14px;
        gap: 8px;
    }
}

/* Premium 2D (height + width) expansion entrance animation */
.ws-floating-contact-card.animate-expand {
    --collapsed-size: 70px;
    width: var(--collapsed-size) !important;
    height: var(--collapsed-size) !important;
    max-width: var(--collapsed-size) !important;
    max-height: var(--collapsed-size) !important;
    min-width: var(--collapsed-size) !important;
    min-height: var(--collapsed-size) !important;
    padding: 10px !important;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 1.2s cubic-bezier(0.16, 1, 0.3, 1), 
                width 1.2s cubic-bezier(0.16, 1, 0.3, 1), 
                min-width 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                max-height 1.2s cubic-bezier(0.16, 1, 0.3, 1), 
                height 1.2s cubic-bezier(0.16, 1, 0.3, 1), 
                min-height 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                padding 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ws-floating-contact-card.animate-expand.layout-compact {
    --collapsed-size: 50px;
    padding: 6px !important;
}

@media (max-width: 480px) {
    .ws-floating-contact-card.animate-expand {
        --collapsed-size: 54px;
        padding: 8px !important;
    }
    .ws-floating-contact-card.animate-expand.layout-compact {
        --collapsed-size: 50px;
        padding: 6px !important;
    }
}

.ws-floating-contact-card.animate-expand .ws-floating-contact-card-info,
.ws-floating-contact-card.animate-expand .ws-floating-contact-card-cta {
    opacity: 0;
    transform: translateX(-15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    flex-shrink: 0;
}

.ws-floating-contact-card.animate-expand.layout-vertical .ws-floating-contact-card-info {
    transform: translateY(-15px);
}

/* Expanded State */
.ws-floating-contact-card.animate-expand.is-expanded {
    min-width: unset !important;
    max-width: 500px !important;
    width: auto !important;
    min-height: unset !important;
    max-height: 500px !important;
    height: auto !important;
    padding: 10px 14px !important;
}

.ws-floating-contact-card.animate-expand.layout-compact.is-expanded {
    padding: 6px 10px !important;
}

.ws-floating-contact-card.animate-expand.layout-vertical.is-expanded {
    padding: 16px 20px !important;
}

@media (max-width: 480px) {
    .ws-floating-contact-card.animate-expand.is-expanded {
        padding: 8px 10px !important;
    }
    .ws-floating-contact-card.animate-expand.layout-compact.is-expanded {
        padding: 6px 10px !important;
    }
    .ws-floating-contact-card.animate-expand.layout-vertical.is-expanded {
        padding: 12px 14px !important;
    }
}

.ws-floating-contact-card.animate-expand.is-expanded .ws-floating-contact-card-info,
.ws-floating-contact-card.animate-expand.is-expanded .ws-floating-contact-card-cta {
    opacity: 1;
    transform: translate(0, 0) !important;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s, 
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}

/* Bypass animation/collapse in Gutenberg editor to keep inputs editable */
.editor-styles-wrapper .ws-floating-contact-card.animate-expand,
.ws-is-editor .ws-floating-contact-card.animate-expand {
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    min-width: unset !important;
    min-height: unset !important;
    padding: 10px 14px !important;
    white-space: normal !important;
}

.editor-styles-wrapper .ws-floating-contact-card.animate-expand.layout-compact,
.ws-is-editor .ws-floating-contact-card.animate-expand.layout-compact {
    padding: 6px 10px !important;
}

.editor-styles-wrapper .ws-floating-contact-card.animate-expand.layout-vertical,
.ws-is-editor .ws-floating-contact-card.animate-expand.layout-vertical {
    padding: 16px 20px !important;
}

.editor-styles-wrapper .ws-floating-contact-card.animate-expand .ws-floating-contact-card-info,
.editor-styles-wrapper .ws-floating-contact-card.animate-expand .ws-floating-contact-card-cta,
.ws-is-editor .ws-floating-contact-card.animate-expand .ws-floating-contact-card-info,
.ws-is-editor .ws-floating-contact-card.animate-expand .ws-floating-contact-card-cta {
    opacity: 1 !important;
    transform: none !important;
}


