/* FunnelBridge Frontend Styles */

/* Auto-inherit colors from site theme */
:root {
    /* Try to inherit from common WordPress/theme variables first */
    --funnelbridge-primary: var(--wp--preset--color--primary, var(--theme-primary, #22c55e));
    --funnelbridge-primary-dark: var(--wp--preset--color--primary-dark, var(--theme-primary-dark, #16a34a));
    --funnelbridge-secondary: var(--wp--preset--color--secondary, var(--theme-secondary, #3b82f6));
    --funnelbridge-text: var(--wp--preset--color--foreground, var(--theme-text, #1e293b));
}

/* Detect site's primary color from buttons/links and apply to modal */
.funnelbridge-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    
    /* Inherit font from site */
    font-family: inherit;
}

.funnelbridge-modal.active {
    display: block;
}

.funnelbridge-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    animation: funnelbridge-fade-in 0.3s ease;
}

.funnelbridge-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: funnelbridge-slide-up 0.4s ease;
}

.funnelbridge-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 30px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    z-index: 10;
    transition: color 0.2s;
}

.funnelbridge-modal-close:hover {
    color: #000;
}

.funnelbridge-modal-body {
    padding: 40px 30px 30px;
}

.funnelbridge-greeting {
    text-align: center;
    margin-bottom: 30px;
}

.funnelbridge-greeting h3 {
    font-size: 24px;
    margin: 0 0 10px 0;
    color: var(--funnelbridge-text);
}

.funnelbridge-greeting p {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

.funnelbridge-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.funnelbridge-btn {
    padding: 16px 24px;
    border: 2px solid;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
}

/* "Send info" button - inherits site's primary color */
.funnelbridge-btn-info {
    border-color: var(--funnelbridge-primary);
    color: var(--funnelbridge-primary-dark);
}

.funnelbridge-btn-info:hover {
    background: var(--funnelbridge-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* "Schedule call" button - inherits site's secondary/link color */
.funnelbridge-btn-call {
    border-color: var(--funnelbridge-secondary);
    color: var(--funnelbridge-secondary);
}

.funnelbridge-btn-call:hover {
    background: var(--funnelbridge-secondary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.funnelbridge-calendly-container {
    margin-top: 20px;
}

.funnelbridge-calendly-container iframe {
    width: 100%;
    min-height: 700px;
    border: none;
    border-radius: 8px;
}

.funnelbridge-success-message {
    text-align: center;
    padding: 40px 20px;
}

.funnelbridge-success-icon {
    width: 60px;
    height: 60px;
    background: var(--funnelbridge-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fff;
    margin: 0 auto 20px;
    animation: funnelbridge-scale-in 0.5s ease;
}

.funnelbridge-success-message h3 {
    font-size: 24px;
    margin: 0 0 10px 0;
    color: var(--funnelbridge-text);
}

.funnelbridge-success-text {
    font-size: 16px;
    color: #64748b;
    margin: 0;
}

@keyframes funnelbridge-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes funnelbridge-slide-up {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes funnelbridge-scale-in {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .funnelbridge-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .funnelbridge-modal-body {
        padding: 30px 20px 20px;
    }
    
    .funnelbridge-greeting h3 {
        font-size: 20px;
    }
    
    .funnelbridge-calendly-container iframe {
        min-height: 600px;
    }
}
