/**
 * Course Enrollment Widget Frontend Styles
 */

.ewc-button-wrapper {
    display: block;
}

.ewc-enrollment-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    text-decoration: none;
    font-family: inherit;
    line-height: 1;
    padding: 12px 24px;
    font-size: 16px;
}

a.ewc-enrollment-button {
    box-sizing: border-box;
}

a.ewc-enrollment-button:hover {
    text-decoration: none;
}

.ewc-enrollment-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Icon Spacing */
.ewc-button-icon {
    display: inline-flex;
    align-items: center;
}

.ewc-icon-left {
    margin-right: 8px;
}

.ewc-icon-right {
    margin-left: 8px;
}

/* Full Width for Justified */
.ewc-button-wrapper[style*="text-align: justify"] .ewc-enrollment-button,
.ewc-button-wrapper .ewc-enrollment-button.ewc-full-width {
    width: 100%;
}

/* Loading State Animation */
@keyframes ewc-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.ewc-enrollment-button.ewc-loading {
    animation: ewc-pulse 1.5s ease-in-out infinite;
    pointer-events: none;
}

.ewc-enrollment-button:disabled {
    cursor: not-allowed;
}

/* Error State */
.ewc-enrollment-button.ewc-error {
    animation: none;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

/* Retry State */
@keyframes ewc-retry-pulse {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

.ewc-enrollment-button.ewc-loading .ewc-button-text:after {
    content: '';
    display: inline-block;
    animation: ewc-dots 1.5s steps(4, end) infinite;
}

@keyframes ewc-dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}
