/**
 * Frontend styles for Stripe Subscription Manager
 */

/* Subscription button wrapper */
.strp-sub-subscription-button-wrapper {
    margin: 15px 0;
}

/* Subscription button */
.strp-sub-subscribe-button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.strp-sub-subscribe-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.strp-sub-subscribe-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.strp-sub-subscribe-button:focus-visible,
.strp-sub-cancel-subscription:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Lifetime access notice */
.strp-sub-lifetime-notice {
    padding: 15px 20px;
    margin: 20px 0;
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    border-radius: 4px;
}

.strp-sub-lifetime-notice strong {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
    color: #0369a1;
}

.strp-sub-lifetime-notice p {
    margin: 0;
    color: #075985;
}

/* Subscriptions table in My Account */
.woocommerce-MyAccount-subscriptions {
    margin-top: 20px;
}

/* Cancel subscription button */
.strp-sub-cancel-subscription {
    padding: 6px 12px;
    font-size: 14px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.strp-sub-cancel-subscription:hover {
    background: #b91c1c;
}

/* Loading state */
.strp-sub-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.strp-sub-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: strp-sub-spin 0.6s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    .strp-sub-loading::after {
        animation: none;
    }
}

/* Inline notices (replaces browser alert()) */
.strp-sub-notice {
    padding: 10px 16px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}

.strp-sub-notice--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.strp-sub-notice--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Responsive */
@media (max-width: 768px) {
    .strp-sub-subscribe-button {
        width: 100%;
        padding: 14px 20px;
    }
}

/* RTL Support */
[dir="rtl"] .strp-sub-button {
    direction: ltr;
}

[dir="rtl"] .strp-sub-notice {
    text-align: right;
}
