/* ===========================
   WooCommerce Points System Styles
   =========================== */

/* RTL Support for Arabic */
body.rtl .wc-points-account,
body[dir="rtl"] .wc-points-account,
.wc-points-account {
    direction: rtl;
    text-align: right;
}

body.rtl .wc-points-redemption,
body[dir="rtl"] .wc-points-redemption,
.wc-points-redemption {
    direction: rtl;
    text-align: right;
}

/* Arabic Font Improvement */
.wc-points-account,
.wc-points-redemption {
    font-family: 'Tajawal', 'Cairo', 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* My Account - Points Page */
.wc-points-account {
    max-width: 800px;
    margin: 0 auto;
}

.wc-points-balance-card {
    background: linear-gradient(135deg, var(--ast-global-color-1) 0%, var(--ast-global-color-2) 100%);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.points-balance {
    text-align: center;
    margin-bottom: 30px;
}

.balance-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.balance-amount {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 5px;
    line-height: 1;
}

.balance-amount .points-text {
    font-size: 18px;
    font-weight: normal;
    opacity: 0.9;
}

.balance-value {
    font-size: 18px;
    opacity: 0.9;
}

.points-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
}

.info-item {
    font-size: 14px;
}

.info-item strong {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item p {
    margin: 0;
    opacity: 0.9;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .points-info {
        grid-template-columns: 1fr;
    }
    
    .balance-amount {
        font-size: 36px;
    }
}

/* Call to Action */
.wc-points-cta {
    text-align: center;
    margin-bottom: 30px;
}

.wc-points-cta .button {
    padding: 15px 40px;
    font-size: 16px;
    border-radius: 5px;
    background: #667eea;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wc-points-cta .button:hover {
    background: var(--ast-global-color-2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Info Message */
.wc-points-info-message {
    background: #ecf6f8;
    border-left: 4px solid var(--ast-global-color-2);
    padding: 15px 20px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.wc-points-info-message p {
    margin: 0;
    color: var(--ast-global-color-2);
    font-weight: 500;
}

/* Points History */
.wc-points-history {
    margin-top: 40px;
}

.wc-points-history h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #333;
}

.wc-points-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

.wc-points-table thead {
    background: #f8f9fa;
}

.wc-points-table th {
    padding: 15px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    border-bottom: 2px solid #e9ecef;
}

.wc-points-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.wc-points-table tbody tr:last-child td {
    border-bottom: none;
}

.wc-points-table tbody tr:hover {
    background: #f8f9fa;
}

.points-cell {
    font-weight: bold;
    font-size: 16px;
}

.points-cell.earned {
    color: #28a745;
}

.points-cell.redeemed {
    color: #dc3545;
}

.transaction-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.transaction-badge.transaction-earned {
    background: #d4edda;
    color: #155724;
}

.transaction-badge.transaction-redeemed {
    background: #f8d7da;
    color: #721c24;
}

.transaction-badge.transaction-restored {
    background: #d1ecf1;
    color: #0c5460;
}

.transaction-badge.transaction-review {
    background: #e2d9f3;
    color: #432874;
}

.transaction-badge.transaction-expired {
    background: #e2e3e5;
    color: #383d41;
}

.expiry-cell {
    font-size: 13px;
    color: #555;
}

.expiry-used {
    color: #999;
    font-style: italic;
}

/* Warning info item */
.info-item--warning {
    background: rgba(255, 193, 7, 0.15);
    border-radius: 6px;
    padding: 8px 12px;
}

.info-item--warning strong {
    color: #856404 !important;
}

.info-item--warning p {
    color: rgba(255, 255, 255, 0.95) !important;
}

.transaction-badge br {
    display: none;
}

/* Empty State */
.wc-points-empty {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

/* Checkout - Points Redemption */
.wc-points-redemption {
    background: #f8f9fa;
    padding: 25px;
    margin: 20px 0;
    border-radius: 8px;
    border: 2px solid #e9ecef;
}

.wc-points-redemption h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.wc-points-redemption-info {
    margin-bottom: 20px;
}

.wc-points-redemption-info p {
    margin: 0 0 5px 0;
    color: #555;
}

.wc-points-redemption-info .small-text {
    font-size: 13px;
    color: #777;
}

.wc-points-redemption-field {
    margin-bottom: 20px;
}

.wc-points-redemption-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.points-input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.points-input-group input[type="number"] {
    flex: 1;
    min-width: 120px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.points-input-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.points-input-group button {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

#apply-points-btn {
    background: var(--ast-global-color-1);
    color: #fff;
}

#apply-points-btn:hover:not(:disabled) {
    background: var(--ast-global-color-2);
    transform: translateY(-1px);
}

#apply-points-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#remove-points-btn {
    background: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
}

#remove-points-btn:hover {
    background: #dc3545;
    color: #fff;
}

/* Quick Select */
.wc-points-quick-select {
    margin-top: 15px;
}

.quick-select-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.quick-select-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-select-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #555;
}

.quick-select-btn:hover {
    background: var(--ast-global-color-1);
    color: #fff;
    border-color: var(--ast-global-color-1);
}

/* Messages */
.wc-points-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.wc-points-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wc-points-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wc-points-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-points-redemption {
        padding: 20px;
    }
    
    .points-input-group {
        flex-direction: column;
    }
    
    .points-input-group input[type="number"],
    .points-input-group button {
        width: 100%;
    }
    
    .wc-points-table {
        font-size: 14px;
    }
    
    .wc-points-table th,
    .wc-points-table td {
        padding: 10px 8px;
    }
}

@media (max-width: 480px) {
    .wc-points-table {
        font-size: 12px;
    }
    
    .wc-points-table th:first-child,
    .wc-points-table td:first-child {
        display: none;
    }
}
