/**
 * Stripe Payment Skeleton Loading Animation
 * Shared across Divi Membership and Divi Form Builder
 */

/* ===== Base Skeleton Styles ===== */
.stripe-skeleton {
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e6e6e6;
}

.stripe-skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 0, 0, 0.03) 50%,
        transparent 100%
    );
    animation: stripe-skeleton-shimmer 1.5s infinite;
    transform: translateX(-100%);
}

@keyframes stripe-skeleton-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ===== Simple Mode Skeleton (Card Only) ===== */
.stripe-skeleton-simple {
    padding: 16px;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stripe-skeleton-simple .skeleton-card-icon {
    width: 32px;
    height: 24px;
    background: #f0f0f0;
    border-radius: 3px;
    flex-shrink: 0;
}

.stripe-skeleton-simple .skeleton-card-number {
    flex: 1;
    height: 20px;
    background: #f0f0f0;
    border-radius: 3px;
}

.stripe-skeleton-simple .skeleton-card-expiry {
    width: 60px;
    height: 20px;
    background: #f0f0f0;
    border-radius: 3px;
}

.stripe-skeleton-simple .skeleton-card-cvc {
    width: 45px;
    height: 20px;
    background: #f0f0f0;
    border-radius: 3px;
}

/* ===== Advanced Mode Skeleton (Full Payment Element) ===== */
.stripe-skeleton-advanced {
    padding: 20px;
    min-height: 200px;
}

.stripe-skeleton-advanced .skeleton-section {
    margin-bottom: 20px;
}

.stripe-skeleton-advanced .skeleton-section:last-child {
    margin-bottom: 0;
}

.stripe-skeleton-advanced .skeleton-label {
    width: 80px;
    height: 14px;
    background: #f0f0f0;
    border-radius: 3px;
    margin-bottom: 8px;
}

.stripe-skeleton-advanced .skeleton-input {
    width: 100%;
    height: 44px;
    background: #f0f0f0;
    border-radius: 4px;
}

.stripe-skeleton-advanced .skeleton-row {
    display: flex;
    gap: 12px;
}

.stripe-skeleton-advanced .skeleton-row .skeleton-input {
    flex: 1;
}

.stripe-skeleton-advanced .skeleton-row .skeleton-input.half {
    flex: 0 0 calc(50% - 6px);
}

/* Payment method tabs skeleton */
.stripe-skeleton-advanced .skeleton-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e6e6e6;
}

.stripe-skeleton-advanced .skeleton-tab {
    width: 80px;
    height: 36px;
    background: #f0f0f0;
    border-radius: 4px;
}

.stripe-skeleton-advanced .skeleton-tab.active {
    background: #e0e0e0;
}

/* ===== Accordion Layout Skeleton ===== */
.stripe-skeleton-accordion {
    padding: 0;
    min-height: 180px;
}

.stripe-skeleton-accordion .skeleton-accordion-item {
    border-bottom: 1px solid #e6e6e6;
    padding: 16px 20px;
}

.stripe-skeleton-accordion .skeleton-accordion-item:last-child {
    border-bottom: none;
}

.stripe-skeleton-accordion .skeleton-accordion-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stripe-skeleton-accordion .skeleton-accordion-icon {
    width: 24px;
    height: 24px;
    background: #f0f0f0;
    border-radius: 4px;
}

.stripe-skeleton-accordion .skeleton-accordion-title {
    flex: 1;
    height: 18px;
    background: #f0f0f0;
    border-radius: 3px;
    max-width: 120px;
}

.stripe-skeleton-accordion .skeleton-accordion-chevron {
    width: 16px;
    height: 16px;
    background: #f0f0f0;
    border-radius: 2px;
}

/* ===== Loading State Container ===== */
.stripe-loading-container {
    position: relative;
    min-height: 50px;
}

.stripe-loading-container .stripe-skeleton {
    position: relative;
    z-index: 1;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.stripe-loading-container.loaded .stripe-skeleton {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

/* ===== Dark Mode Support ===== */
/* Note: Stripe Payment Element uses its own theme, so we keep skeleton light to match default Stripe appearance */
