/* TP Clubigo Product Display Styles */

.tp-clubigo-product-points-container {
    margin: 15px 0;
    direction: rtl;
}

/* Points Box for Product Pages */
.tp-clubigo-points-box {
    display: inline-flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    margin: 10px 0;
}

/* Member Points Box */
.tp-clubigo-points-box.member {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.tp-clubigo-points-box.member:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Guest Points Box with Animation */
.tp-clubigo-points-box.guest {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
    position: relative;
    cursor: pointer;
}

.tp-clubigo-points-box.guest::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #007cba;
    border-radius: 8px;
    opacity: 0;
    animation: borderDraw 3s ease-in-out infinite;
}

.tp-clubigo-points-box.guest:hover {
    background: #e9ecef;
    border-color: #007cba;
    transform: translateY(-1px);
}

.tp-clubigo-points-box.guest:hover::before {
    animation-play-state: paused;
    opacity: 1;
}

/* Border Drawing Animation */
@keyframes borderDraw {
    0% {
        opacity: 0;
        clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
    }
    25% {
        opacity: 1;
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    }
    50% {
        opacity: 1;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 100% 100%);
    }
    75% {
        opacity: 1;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    100% {
        opacity: 1;
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
}

/* Points Icon */
.tp-clubigo-points-box .points-icon {
    font-size: 18px;
    margin-left: 8px;
    display: inline-block;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Points Text */
.tp-clubigo-points-box .points-text {
    line-height: 1.4;
}

.tp-clubigo-points-box.member .points-text strong {
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.tp-clubigo-points-box.guest .points-text {
    font-weight: 600;
}

/* Shop Page Points Display */
.tp-clubigo-shop-points {
    display: inline-flex;
    align-items: center;
    background: #f8f9fa;
    color: #495057;
    padding: 6px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    position: absolute;
    top: 0px;
    right: 5px;
}

.tp-clubigo-shop-points:hover {
    background: #e9ecef;
    border-color: #007cba;
    transform: translateY(-1px);
}

.tp-clubigo-shop-points .points-icon {
    font-size: 14px;
    margin-left: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tp-clubigo-points-box {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .tp-clubigo-points-box .points-icon {
        font-size: 16px;
        margin-left: 6px;
    }
    
    .tp-clubigo-shop-points {
        padding: 5px 8px;
        font-size: 11px;
    }
}

/* RTL Support */
[dir="rtl"] .tp-clubigo-points-box {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .tp-clubigo-points-box .points-icon {
    margin-left: 0;
    margin-right: 8px;
}

[dir="rtl"] .tp-clubigo-shop-points .points-icon {
    margin-left: 0;
    margin-right: 4px;
}

/* Integration with WooCommerce */
.woocommerce div.product .tp-clubigo-product-points-container {
    margin: 15px 0 20px 0;
}

.woocommerce ul.products li.product .tp-clubigo-shop-points {
    margin-top: 5px;
}

/* Variable Product Specific */
.tp-clubigo-points-box.variable-range {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.tp-clubigo-points-box.variable-range:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

/* Loading State */
.tp-clubigo-points-loading {
    display: inline-flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #6c757d;
    font-size: 14px;
}

.tp-clubigo-points-loading::before {
    content: '⏳';
    margin-left: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Error State */
.tp-clubigo-points-error {
    display: inline-flex;
    align-items: center;
    padding: 12px 16px;
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    font-size: 14px;
}

.tp-clubigo-points-error::before {
    content: '⚠️';
    margin-left: 8px;
}

/* Success Animation */
.tp-clubigo-points-updated {
    animation: pointsUpdate 0.6s ease-out;
}

@keyframes pointsUpdate {
    0% {
        transform: scale(1);
        background-color: inherit;
    }
    50% {
        transform: scale(1.05);
        background-color: #d4edda;
    }
    100% {
        transform: scale(1);
        background-color: inherit;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .tp-clubigo-points-box.member {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }
    
    .tp-clubigo-points-box.guest {
        background: #fff;
        color: #000;
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .tp-clubigo-points-box,
    .tp-clubigo-shop-points,
    .tp-clubigo-points-box .points-icon {
        animation: none;
        transition: none;
    }
    
    .tp-clubigo-points-box:hover,
    .tp-clubigo-shop-points:hover {
        transform: none;
    }
    
    .tp-clubigo-points-box.guest::before {
        animation: none;
        opacity: 1;
    }
}
