/* ============================================
   Duplicate Purchase Prevention Styles
   ============================================ */

/* Purchased Badge - Green indicator on course thumbnails */
.purchased-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(67, 160, 71, 0.4);
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.purchased-badge i {
    font-size: 14px;
}

/* "You Own This" Indicator */
.owned-indicator {
    background-color: #e8f5e9;
    border-left: 4px solid #43a047;
    padding: 12px 16px;
    margin-bottom: 15px;
    border-radius: 4px;
    color: #2e7d32;
    font-weight: 500;
}

.owned-indicator i {
    color: #43a047;
    margin-right: 8px;
}

/* View My Course Button */
.btn-view-course {
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
    color: #ffffff !important;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-view-course:hover {
    background: linear-gradient(135deg, #388e3c 0%, #43a047 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(67, 160, 71, 0.3);
}

.btn-view-course i {
    font-size: 16px;
}

/* Owned Course Card - Replaces price box on details page */
.owned-course-card {
    background: linear-gradient(135deg, #f1f8f4 0%, #e8f5e9 100%);
    border: 2px solid #81c784;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.owned-course-card .ownership-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #43a047 0%, #66bb6a 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.owned-course-card .ownership-icon i {
    font-size: 32px;
    color: #ffffff;
}

.owned-course-card h4 {
    color: #2e7d32;
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 20px;
}

.owned-course-card .purchase-date {
    color: #558b2f;
    font-size: 14px;
    margin-bottom: 20px;
}

.owned-course-card .course-progress {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #a5d6a7;
}

.owned-course-card .course-progress h5 {
    color: #2e7d32;
    font-size: 16px;
    margin-bottom: 10px;
}

.owned-course-card .progress {
    height: 10px;
    border-radius: 10px;
    background-color: #c8e6c9;
    overflow: hidden;
}

.owned-course-card .progress-bar {
    background: linear-gradient(90deg, #43a047 0%, #66bb6a 100%);
    transition: width 0.6s ease;
}

.owned-course-card .progress-percentage {
    color: #2e7d32;
    font-weight: 600;
    margin-top: 8px;
    font-size: 14px;
}

/* Disabled "Add to Cart" button for purchased courses */
.btn-add-cart.disabled,
.btn-add-cart:disabled {
    background-color: #e0e0e0;
    color: #9e9e9e;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Course card overlay for purchased courses */
.course-card.purchased {
    position: relative;
}

.course-card.purchased::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(76, 175, 80, 0.05);
    pointer-events: none;
    border-radius: inherit;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .purchased-badge {
        font-size: 10px;
        padding: 4px 10px;
    }

    .owned-course-card {
        padding: 16px;
    }

    .owned-course-card .ownership-icon {
        width: 48px;
        height: 48px;
    }

    .owned-course-card .ownership-icon i {
        font-size: 24px;
    }

    .owned-course-card h4 {
        font-size: 18px;
    }

    .btn-view-course {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Animation for purchased badge */
@keyframes purchasedPulse {
    0% {
        box-shadow: 0 2px 8px rgba(67, 160, 71, 0.4);
    }
    50% {
        box-shadow: 0 2px 16px rgba(67, 160, 71, 0.6);
    }
    100% {
        box-shadow: 0 2px 8px rgba(67, 160, 71, 0.4);
    }
}

.purchased-badge.animated {
    animation: purchasedPulse 2s ease-in-out infinite;
}
