/* Button Components */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 44px;
    min-width: 44px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-transform: none;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: var(--messenger-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--messenger-blue-dark);
}

.btn-secondary {
    background: var(--bot-bubble);
    color: var(--text-dark);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

.btn-success {
    background: var(--success-green);
    color: white;
}

.btn-success:hover {
    background: #3bc886;
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    font-size: 1.1rem;
    padding: 16px 32px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 1rem;
    font-weight: 600;
}

.btn-whatsapp:hover {
    background: linear-gradient(135deg, #20b358 0%, #0f7269 100%);
    transform: translateY(-1px);
}

.btn-whatsapp::before {
    content: "💬";
    font-size: 1.2rem;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
    width: 100%;
    margin: 8px 0;
    border-radius: 24px;
}

/* Messenger-style bubble buttons */
.chat-bubble-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 132, 255, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 18px;
    padding: 8px 16px;
    margin: 4px 6px 4px 0;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    min-height: 36px;
    font-family: inherit;
}

.chat-bubble-button:hover {
    background: rgba(0, 132, 255, 1);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 132, 255, 0.3);
}

.chat-bubble-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 132, 255, 0.2);
}

.chat-bubble-button.primary {
    background: transparent;
    color: var(--messenger-blue);
    border-color: var(--messenger-blue);
}

.chat-bubble-button.primary:hover {
    background: rgba(0, 132, 255, 0.1);
    border-color: var(--messenger-blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 132, 255, 0.2);
}

.chat-bubble-button.success {
    background: transparent;
    color: var(--success-green);
    border-color: var(--success-green);
}

.chat-bubble-button.success:hover {
    background: rgba(66, 211, 146, 0.1);
    border-color: #3bc886;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 211, 146, 0.2);
}

.chat-bubble-button.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.chat-bubble-button.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Button containers for multiple bubbles */
.chat-bubble-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    padding: 0;
}

/* Fixed bubble buttons above WhatsApp CTA */
.fixed-bubble-actions {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 999;
    padding: 0 20px;
    max-width: calc(100vw - 40px);
    /* Mobile browser fixes */
    -webkit-transform: translateX(-50%);
    -moz-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    /* Ensure visibility on mobile */
    will-change: transform;
    pointer-events: auto;
}

.fixed-bubble-actions .chat-bubble-button {
    margin: 0;
    white-space: nowrap;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(0, 132, 255, 0.9);
    color: white;
}

/* Legacy button styles - keep for backwards compatibility but override in chat */
.message-bubble .btn {
    display: none; /* Hide old style buttons in chat */
}

.message-bubble .btn:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Loading state */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Disabled state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Icon buttons */
.btn-icon {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Step completion indicators */
.step-completed {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid var(--success-green);
    border-radius: 12px;
    color: var(--success-green);
    font-weight: 600;
    margin: 1rem 0;
}

.step-completed::before {
    content: "✓";
    background: var(--success-green);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

/* Requirements list */
.requirements-list {
    background: rgba(66, 211, 146, 0.08);
    border-left: 4px solid var(--success-green);
    padding: 16px;
    margin: 16px 0;
    border-radius: 0 12px 12px 0;
}

.requirements-list h4 {
    color: var(--messenger-blue);
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.requirements-list ul {
    list-style: none;
    padding: 0;
}

.requirements-list li {
    padding: 0.25rem 0;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.requirements-list li::before {
    content: "📋";
    margin-right: 0.5rem;
}

/* Tips section */
.tips-section {
    background: rgba(0, 132, 255, 0.05);
    border: 1px solid rgba(0, 132, 255, 0.15);
    border-radius: 16px;
    padding: 16px;
    margin: 16px 0;
}

.tips-section h4 {
    color: var(--messenger-blue);
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.tips-section ul {
    list-style: none;
    padding: 0;
}

.tips-section li {
    padding: 8px 0;
    color: var(--text-dark);
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0, 132, 255, 0.08);
}

.tips-section li:last-child {
    border-bottom: none;
}

.tips-section li::before {
    content: "💡";
    margin-right: 0.5rem;
}

/* Urgency indicator */
.urgency-badge {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin: 16px 0;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.urgency-badge::before {
    content: "⏰";
    margin-right: 0.5rem;
}

/* Social proof */
.social-proof {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid var(--success-green);
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: center;
}

.social-proof .number {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--success-green);
}

.social-proof .text {
    color: var(--text-dark);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Form elements */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--messenger-blue);
    box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.1);
}

/* Fixed WhatsApp CTA */
.fixed-whatsapp-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: transparent;
    padding: 16px 20px 20px;
    z-index: 1000;
    /* Mobile browser fixes */
    width: 100%;
    min-height: 80px;
    /* Ensure it stays visible */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    /* Mobile viewport fixes */
    bottom: env(safe-area-inset-bottom, 0);
    /* Force hardware acceleration */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Prevent mobile browser from hiding the element */
    position: -webkit-sticky;
    position: sticky;
    position: fixed;
}

.btn-whatsapp-fixed {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    font-size: 1.1rem;
    padding: 16px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
    font-family: inherit;
}

.btn-whatsapp-fixed:hover {
    background: linear-gradient(135deg, #20b358 0%, #0f7269 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp-fixed:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp-fixed svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Adjust chat container to account for fixed button */
.chat-container {
    padding-bottom: 180px;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    .btn {
        font-size: 0.95rem;
        padding: 12px 20px;
    }
    
    .btn-large {
        padding: 14px 24px;
        font-size: 1.05rem;
    }
    
    .btn-whatsapp {
        font-size: 1rem;
        padding: 14px 24px;
    }
    
    .btn-whatsapp-fixed {
        font-size: 1rem;
        padding: 14px 20px;
        gap: 10px;
    }
    
    .btn-whatsapp-fixed svg {
        width: 18px;
        height: 18px;
    }
    
    .fixed-whatsapp-cta {
        padding: 12px 16px 16px;
        /* Mobile viewport height fixes */
        bottom: max(env(safe-area-inset-bottom), 0px);
        /* Use dynamic viewport height on supporting browsers */
        min-height: max(70px, env(safe-area-inset-bottom) + 70px);
    }
    
    .chat-container {
        padding-bottom: 160px;
        /* Account for mobile viewport changes */
        min-height: 100vh;
        min-height: 100dvh; /* Dynamic viewport height for modern browsers */
    }
    
    .chat-bubble-button {
        font-size: 0.85rem;
        padding: 6px 12px;
        border-radius: 16px;
        min-height: 32px;
    }
    
    .chat-bubble-buttons {
        gap: 3px;
        margin-top: 6px;
    }
    
    .fixed-bubble-actions {
        bottom: max(90px + env(safe-area-inset-bottom), 90px);
        padding: 0 16px;
        gap: 6px;
        /* Mobile positioning enhancements */
        transform: translate3d(-50%, 0, 0);
        -webkit-transform: translate3d(-50%, 0, 0);
    }
    
    .requirements-list,
    .tips-section {
        padding: 12px;
    }
    
    .social-proof .number {
        font-size: 1.3rem;
    }
}

/* Additional mobile browser compatibility */
@supports (height: 100dvh) {
    .chat-container {
        min-height: 100dvh;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .fixed-whatsapp-cta {
        /* iOS Safari bottom safe area */
        padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
    }
}