/* ==========================================================================
   Guest Access for Tutor LMS — Frontend Guest Button Styles
   Version: 2.0.0
   Author: Trilbyte
   ========================================================================== */

/* ---------- Cart Button ---------- */
.twc-guest-cart-wrapper {
    margin: 16px 0;
    text-align: center;
}

.twc-add-to-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 360px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #ffffff;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
    line-height: 1.4;
}

.twc-add-to-cart-btn:hover {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
    transform: translateY(-1px);
    color: #ffffff;
}

.twc-add-to-cart-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

/* View Cart state */
.twc-add-to-cart-btn.twc-view-cart {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

.twc-add-to-cart-btn.twc-view-cart:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.45);
}

/* Loading state */
.twc-add-to-cart-btn.twc-loading {
    pointer-events: none;
    opacity: 0.85;
}

/* Success pulse animation */
.twc-add-to-cart-btn.twc-success-pulse {
    animation: twcSuccessPulse 0.6s ease;
}

@keyframes twcSuccessPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }

    100% {
        transform: scale(1);
    }
}

/* Added checkmark flash */
.twc-add-to-cart-btn.twc-added::after {
    content: '✓';
    position: absolute;
    right: 16px;
    font-size: 18px;
    animation: twcCheckIn 0.4s ease;
}

@keyframes twcCheckIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Spinner */
.twc-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: twcSpinFront 0.6s linear infinite;
}

@keyframes twcSpinFront {
    to {
        transform: rotate(360deg);
    }
}

/* Cart icon */
.twc-btn-icon-cart {
    font-size: 18px;
    line-height: 1;
}

/* Course price display */
.twc-course-price {
    margin-top: 10px;
    font-size: 14px;
    color: #6b7280;
    text-align: center;
}

.twc-course-price .woocommerce-Price-amount {
    font-weight: 700;
    color: #111827;
    font-size: 18px;
}

.twc-course-price del .woocommerce-Price-amount {
    color: #9ca3af;
    font-weight: 400;
    font-size: 14px;
}

/* ---------- Responsive ---------- */
@media screen and (max-width: 640px) {
    .twc-add-to-cart-btn {
        max-width: 100%;
        font-size: 15px;
        padding: 12px 24px;
    }
}