/**
 * Frontend Styles for Beehiiv OfferConnect Bridge
 */

/* Beehiiv Form Wrapper */
.bob-beehiiv-wrapper {
    margin: 20px 0;
    max-width: 100%;
    overflow: hidden;
}

.bob-beehiiv-wrapper iframe {
    border: none;
    width: 100%;
    max-width: 100%;
}

/* OfferConnect Wrapper */
.bob-offerconnect-wrapper {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

#bob-offerconnect-container {
    min-height: 200px;
    display: none;
}

#bob-offerconnect-loading {
    text-align: center;
    padding: 40px 20px;
}

#bob-offerconnect-loading p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Loading animation */
.bob-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #333;
    animation: bob-spin 1s ease-in-out infinite;
}

@keyframes bob-spin {
    to { transform: rotate(360deg); }
}

/* Success Message */
.bob-success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    border: 1px solid #c3e6cb;
}

/* Error Message */
.bob-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    border: 1px solid #f5c6cb;
}

/* Custom Form Styles */
.bob-custom-form-wrapper {
    margin: 20px 0;
    max-width: 600px;
    width: 100%;
}

.bob-subscribe-form {
    position: relative;
}

.bob-form-group {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.bob-email-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    outline: none;
    transition: all 0.3s ease;
    font-family: inherit;
}

.bob-email-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.bob-email-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.bob-submit-button {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    touch-action: manipulation;
}

.bob-submit-button:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.bob-submit-button:active {
    transform: translateY(0);
}

.bob-submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Form Messages */
.bob-form-message {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.bob-form-message.bob-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.bob-form-message.bob-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Form Loader */
.bob-form-loader {
    text-align: center;
    padding: 15px;
}

.bob-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: bob-spin 0.8s linear infinite;
}

/* Hero Section */
.bob-hero-section {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 40px;
    overflow: visible;
    min-height: 350px;
    /* Mobile performance */
    touch-action: manipulation;
}

.bob-hero-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    z-index: 2;
    position: relative;
}

.bob-hero-content {
    text-align: left;
    padding-right: 20px;
}

.bob-hero-title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 20px 0;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.bob-hero-subtitle {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 28px 0;
    color: #ffffff;
    opacity: 0.95;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.bob-hero-form {
    max-width: 500px;
    margin: 0;
    background: transparent;
    padding: 0;
}

.bob-hero-form .bob-custom-form-wrapper {
    margin: 0;
}

.bob-hero-form .bob-form-group {
    gap: 0;
}

.bob-hero-form .bob-email-input {
    background: #ffffff !important;
    border: none !important;
    border-radius: 6px 0 0 6px !important;
    padding: 16px 18px !important;
    font-size: 15px !important;
    height: auto !important;
}

.bob-hero-form .bob-email-input:hover {
    background: #ffffff !important;
    opacity: 1 !important;
}

.bob-hero-form .bob-submit-button {
    background: #2563eb !important;
    padding: 16px 48px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: 0 6px 6px 0 !important;
    min-width: 200px !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    height: auto !important;
}

.bob-hero-form .bob-submit-button:hover {
    background: #1d4ed8;
    transform: none;
    box-shadow: none;
}

/* Phone mockup placeholder area */
.bob-hero-phone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    max-height: 400px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .bob-beehiiv-wrapper,
    .bob-offerconnect-wrapper {
        margin: 15px 0;
        padding: 15px;
    }
    
    /* Custom Form Mobile */
    .bob-form-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .bob-email-input,
    .bob-submit-button {
        width: 100%;
        font-size: 15px;
    }
    
    .bob-submit-button {
        padding: 16px 24px;
    }
    
    /* Hero Section Mobile - Optimized for performance */
    .bob-hero-section {
        padding: 20px 16px;
        min-height: auto;
        /* Performance optimizations */
        contain: layout style;
        will-change: auto;
    }
    
    .bob-hero-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .bob-hero-content {
        text-align: center;
        padding-right: 0;
    }
    
    .bob-hero-title {
        font-size: 28px !important;
        margin-bottom: 12px;
        line-height: 1.2;
    }
    
    .bob-hero-subtitle {
        font-size: 14px !important;
        margin-bottom: 20px;
        line-height: 1.4;
    }
    
    .bob-hero-form {
        max-width: 100%;
    }
    
    .bob-hero-phone {
        display: none;
    }
    
    /* Mobile form optimization */
    .bob-form-group {
        contain: layout;
    }
    
    /* Disable animations on mobile for better performance */
    .bob-loading-spinner,
    .bob-spinner {
        animation-duration: 1.2s;
    }
}
