/**
 * Front-end stylesheet for LeadPulse WP.
 * Provides modern, premium visual styling with smooth animations, custom CSS variables, and layout styles.
 */

:root {
    --lp-primary: #6366f1;
    --lp-primary-hover: #4f46e5;
    --lp-bg: #ffffff;
    --lp-text: #1f2937;
    --lp-text-muted: #6b7280;
    --lp-border: #e5e7eb;
    --lp-radius: 12px;
    --lp-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --lp-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Common Container Styles */
.leadpulse-card {
    background: var(--lp-bg);
    border: 1px solid var(--lp-border);
    border-radius: var(--lp-radius);
    padding: 24px;
    margin: 20px 0;
    box-shadow: var(--lp-shadow);
    color: var(--lp-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.leadpulse-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--lp-shadow-lg);
}

/* Gradient highlights */
.leadpulse-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--lp-primary), #3b82f6);
}

.leadpulse-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--lp-text);
}

.leadpulse-desc {
    font-size: 14px;
    color: var(--lp-text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Form layouts */
.leadpulse-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.leadpulse-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 640px) {
    .leadpulse-form-row.two-cols {
        grid-template-columns: 1fr 1fr;
    }
}

.leadpulse-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.leadpulse-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--lp-text);
}

.leadpulse-input,
.leadpulse-select,
.leadpulse-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--lp-border);
    border-radius: calc(var(--lp-radius) - 4px);
    font-size: 14px;
    background-color: #f9fafb;
    color: var(--lp-text);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.leadpulse-input:focus,
.leadpulse-select:focus,
.leadpulse-textarea:focus {
    outline: none;
    border-color: var(--lp-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.leadpulse-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Consent checkboxes */
.leadpulse-consent-wrap {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0;
}

.leadpulse-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid var(--lp-border);
    accent-color: var(--lp-primary);
    cursor: pointer;
    margin-top: 2px;
}

.leadpulse-consent-text {
    font-size: 12px;
    color: var(--lp-text-muted);
    line-height: 1.4;
}

.leadpulse-consent-text a {
    color: var(--lp-primary);
    text-decoration: underline;
}

/* Buttons */
.leadpulse-btn {
    background-color: var(--lp-primary);
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    padding: 12px 24px;
    border: none;
    border-radius: calc(var(--lp-radius) - 4px);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.leadpulse-btn:hover {
    background-color: var(--lp-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.leadpulse-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Channel specific classes */
.leadpulse-whatsapp-card::before {
    background: linear-gradient(90deg, #25d366, #128c7e);
}
.leadpulse-whatsapp-btn {
    background-color: #25d366;
}
.leadpulse-whatsapp-btn:hover {
    background-color: #128c7e;
}

.leadpulse-telegram-card::before {
    background: linear-gradient(90deg, #0088cc, #229ed9);
}
.leadpulse-telegram-btn {
    background-color: #0088cc;
}
.leadpulse-telegram-btn:hover {
    background-color: #229ed9;
}

/* All Channels tabbed/combined container */
.leadpulse-all-channels-tabs {
    display: flex;
    border-bottom: 1px solid var(--lp-border);
    margin-bottom: 20px;
    overflow-x: auto;
}
.leadpulse-all-tab {
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--lp-text-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.leadpulse-all-tab.active {
    color: var(--lp-primary);
    border-bottom-color: var(--lp-primary);
}

.leadpulse-tab-content {
    display: none;
}
.leadpulse-tab-content.active {
    display: block;
    animation: lpFadeIn 0.3s ease;
}

@keyframes lpFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Push notification slide-in opt-in */
.leadpulse-push-optin {
    position: fixed;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    padding: 22px;
    z-index: 999999;
    display: flex;
    flex-direction: row;
    gap: 18px;
    align-items: flex-start;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    opacity: 0;
}

.leadpulse-push-optin.show {
    opacity: 1;
}

.leadpulse-push-optin-icon-col {
    flex-shrink: 0;
}

.leadpulse-push-icon-badge {
    width: 52px;
    height: 52px;
    background-color: #f1f5f9;
    color: #475569;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.leadpulse-push-optin-content-col {
    flex-grow: 1;
    text-align: left;
}

.leadpulse-push-optin-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
    line-height: 1.35;
}

.leadpulse-push-optin-text {
    font-size: 13px;
    color: #475569;
    margin: 0 0 16px 0;
    line-height: 1.45;
}

.leadpulse-push-optin-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
}

.leadpulse-push-btn-deny {
    background: transparent;
    border: none;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    padding: 6px 12px;
    transition: color 0.2s;
}

.leadpulse-push-btn-deny:hover {
    color: #1d4ed8;
}

.leadpulse-push-btn-allow {
    background-color: #3b82f6;
    color: #ffffff;
    border: none;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 24px;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    transition: background-color 0.2s, transform 0.1s;
}

.leadpulse-push-btn-allow:hover {
    background-color: #2563eb;
}

/* Success Messages */
.leadpulse-success-feedback {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    border-radius: calc(var(--lp-radius) - 4px);
    padding: 14px;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    display: none;
    animation: lpFadeIn 0.3s ease;
}

.leadpulse-error-feedback {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    border-radius: calc(var(--lp-radius) - 4px);
    padding: 14px;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    display: none;
    animation: lpFadeIn 0.3s ease;
}

/* Sticky bottom footer bar style */
.leadpulse-bar-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--lp-bg);
    border-top: 1px solid var(--lp-border);
    padding: 14px 24px;
    box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.05);
    z-index: 99999;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-sizing: border-box;
}

.leadpulse-bar-footer .leadpulse-form-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    max-width: 600px;
}

.leadpulse-bar-footer .leadpulse-input {
    background: #ffffff;
}

/* Floating WhatsApp button widget */
.leadpulse-float-wa {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    z-index: 99999;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.leadpulse-float-wa:hover {
    transform: scale(1.1);
}

.leadpulse-float-wa svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

/* Floating Telegram button widget */
.leadpulse-float-tg {
    position: fixed;
    bottom: 96px; /* Positioned right above WhatsApp button */
    right: 24px;
    width: 60px;
    height: 60px;
    background-color: #0088cc;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    z-index: 99999;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.leadpulse-float-tg:hover {
    transform: scale(1.1);
}

.leadpulse-float-tg svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* Floating Bell button widget */
.leadpulse-float-bell {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 60px;
    height: 60px;
    background-color: var(--lp-primary, #6366f1);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    z-index: 99999;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: lpPulse 2.5s infinite;
}

.leadpulse-float-bell:hover {
    transform: scale(1.1);
}

.leadpulse-float-bell svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

@keyframes lpPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(99, 102, 241, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* Custom styles for Push prompt style variations (A/B testing styles) */
.leadpulse-push-optin.leadpulse-push-top-banner {
    top: 20px;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translate(-50%, -150%);
    width: 95%;
    max-width: 480px; /* Matches the size of the reference card perfectly */
}
.leadpulse-push-optin.leadpulse-push-top-banner.show {
    transform: translate(-50%, 0);
}

.leadpulse-push-optin.leadpulse-push-bottom-widget {
    bottom: 24px;
    left: 24px;
    right: auto;
    width: 95%;
    max-width: 380px;
    transform: translateY(120%);
}
.leadpulse-push-optin.leadpulse-push-bottom-widget.show {
    transform: translateY(0);
}

/* Multi-step Funnel Overlay & modal dialog */
.leadpulse-funnel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.leadpulse-funnel-modal {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    text-align: center;
}
.leadpulse-funnel-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    line-height: 1;
}
.leadpulse-funnel-icon {
    font-size: 40px;
    margin-bottom: 12px;
}
.leadpulse-funnel-title {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 8px 0;
}
.leadpulse-funnel-text {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    margin: 0 0 20px 0;
}
.leadpulse-funnel-divider {
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 20px 0 15px 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.leadpulse-funnel-divider::before,
.leadpulse-funnel-divider::after {
    content: '';
    display: block;
    flex-grow: 1;
    height: 1px;
    background: #e2e8f0;
}

.leadpulse-funnel-modal .wa-btn {
    background-color: #25d366 !important;
}
.leadpulse-funnel-modal .wa-btn:hover {
    background-color: #128c7e !important;
}
.leadpulse-funnel-modal .tg-btn {
    background-color: #0088cc !important;
}
.leadpulse-funnel-modal .tg-btn:hover {
    background-color: #229ed9 !important;
}
