/* Less Simple Venmo Payment - Button Styles */

.lsvp-venmo-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    width: calc(100% - 4px);
    margin: 16px auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    max-width: calc(100% - 4px);
    overflow: hidden;
    text-align: center;
}

.lsvp-venmo-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.lsvp-venmo-button:focus {
    outline: 2px solid #005a87;
    outline-offset: 2px;
}

/* Venmo Blue Style */
.lsvp-venmo-button.venmo-blue {
    background-color: #3D95CE;
    color: white;
}

.lsvp-venmo-button.venmo-blue:hover {
    background-color: #358bb8;
    color: white;
}

/* Black Style */
.lsvp-venmo-button.black {
    background-color: #000000;
    color: white;
}

.lsvp-venmo-button.black:hover {
    background-color: #333333;
    color: white;
}

/* Dark Blue Style */
.lsvp-venmo-button.dark-blue {
    background-color: #1a365d;
    color: white;
}

.lsvp-venmo-button.dark-blue:hover {
    background-color: #2c5282;
    color: white;
}

/* Venmo Logo SVG */
.lsvp-venmo-logo {
    display: block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin: 0;
    vertical-align: middle;
    opacity: 1 !important;
    visibility: visible !important;
    border-radius: 5px;
    object-fit: contain;
}

/* The logo background is built into the SVG now */
.lsvp-venmo-button .lsvp-venmo-logo {
    /* Logo styling is handled by the SVG itself */
}

.lsvp-venmo-button.venmo-blue .lsvp-venmo-logo {
    /* No override needed - SVG handles its own colors */
}

.lsvp-venmo-button.black .lsvp-venmo-logo {
    /* No override needed - SVG handles its own colors */
}

.lsvp-venmo-button.dark-blue .lsvp-venmo-logo {
    /* No override needed - SVG handles its own colors */
}

/* Fallback icon using CSS if SVG doesn't render */
.lsvp-venmo-button::before {
    content: "V";
    display: block;
    width: 24px;
    height: 24px;
    background: #3D95CE;
    color: white;
    border-radius: 5px;
    text-align: center;
    line-height: 24px;
    font-weight: 700;
    font-size: 14px;
    margin: 0;
    flex-shrink: 0;
}

/* Hide fallback when SVG is successfully loaded */
.lsvp-venmo-button.has-svg::before {
    display: none;
}

/* Container for block checkout */
.lsvp-checkout-container {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
    overflow: hidden;
    text-align: center;
}

/* Container for product pages */
.lsvp-product-container {
    margin: 20px 0;
    padding: 0;
    clear: both;
    text-align: center;
}

.lsvp-product-note {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #666;
    text-align: center;
    font-style: italic;
}

/* Product page button styling */
.lsvp-product-venmo-button {
    margin: 15px auto 10px auto;
    font-size: 15px;
    padding: 12px 24px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lsvp-checkout-title {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.lsvp-checkout-description {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lsvp-venmo-button {
        padding: 12px 14px;
        font-size: 15px;
        width: 100%;
        max-width: 100%;
    }
    
    .lsvp-checkout-container {
        margin: 15px 0;
        padding: 12px;
        max-width: 100%;
        overflow: hidden;
    }
    
    .lsvp-checkout-container .lsvp-venmo-button {
        padding: 12px 14px;
        font-size: 15px;
        margin: 16px auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .lsvp-product-container {
        margin: 10px 0;
    }
    
    .lsvp-product-venmo-button {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .lsvp-checkout-container {
        margin: 10px 0;
        padding: 8px;
    }
    
    .lsvp-venmo-button {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .lsvp-checkout-container .lsvp-venmo-button {
        padding: 10px 12px;
        font-size: 14px;
        margin: 12px auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .lsvp-venmo-logo {
        width: 20px;
        height: 20px;
        margin: 0;
    }
    
    /* Smaller fallback icon on mobile */
    .lsvp-venmo-button::before {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 12px;
        margin: 0;
    }
}

/* Block checkout specific positioning */
.wp-block-woocommerce-checkout .lsvp-checkout-container {
    order: -1; /* Place before other payment methods */
    width: 100%;
    overflow: hidden;
}

/* Classic checkout positioning for skip-cart scenarios */
.woocommerce-checkout .lsvp-checkout-container {
    width: 100%;
    overflow: hidden;
    margin: 20px auto;
    max-width: 600px;
}

/* Ensure button stays within checkout container */
.lsvp-checkout-container .lsvp-venmo-button {
    margin: 16px auto;
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Additional positioning for various checkout layouts */
#order_review .lsvp-checkout-container,
.woocommerce-checkout-review-order .lsvp-checkout-container {
    margin: 15px 0;
    max-width: calc(100% - 20px);
}

/* Ensure proper spacing in all contexts */
main .lsvp-checkout-container,
.content .lsvp-checkout-container {
    max-width: calc(100% - 40px);
    margin: 20px auto;
}

/* Force container to respect parent bounds */
.wp-block-woocommerce-checkout .lsvp-checkout-container,
.woocommerce-checkout .lsvp-checkout-container {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* Constrain button within any parent container */
.lsvp-venmo-button {
    min-width: 0; /* Allow button to shrink */
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.lsvp-venmo-button span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 0 1 auto;
    min-width: 0;
    text-align: center;
    line-height: 1;
}

/* Animation for loading state */
.lsvp-venmo-button.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.lsvp-venmo-button.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: lsvp-spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes lsvp-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
} 